2017-04-24

Debian Apache2.4 簡潔網址2-Clean URLs(2)

2017-04-24

Apache 2.4.10 簡潔網址2 (Clean URLs 2)
 
Apache 2 版本 : 2.4.10
Debian 版本 : 8.7 jessie ( stable )

  • apache2 加上 mod_rewrite 模組
    sudo a2enmod rewrite
  • < DoukWiki Dir > /conf/local.php 設定
    $conf['basedir'] = '/home/username/dokuwiki/';
    $conf['baseurl'] = '/';
    $conf['userewrite'] = '1'; //使用 apache 的 mod_rewrite 提供簡潔網址模式
    $conf['useslash'] = 1;
  • dokuwiki ( < DoukWiki Dir > ) 目錄下 .htaccess 檔
    RewriteEngine on
    
    RewriteBase /~username/dokuwiki/
  • 重起動 apache2
    sudo /etc/init.d/apache2 restart
    
    sudo service apache2 restart

----
相關 - Debian Apache2 簡潔網址-Clean URLs (2010-04-27)


2016-10-28

合併兩文字檔成一檔(兩欄)

合併兩文字檔成一檔 ( 兩欄 ) ( paste )

2016-10-28

  • 檔案1(f1.txt)
    abc
    123
    def
    456
  • 檔案2(f2.txt)
    0000
    1111
    2222
    3333
    4444
  • 指令(command) ( -d “,” 以逗號為分隔,預設為 Tab )

合併兩行(Merge 2 line)

合併兩行(Merge 2 line) ( awk | sed )

2016-10-28

  • 檔案(merge.txt)
    abc
    123
    def
    456
  • awk 指令(command)
    awk '{if(NR%2==0){printf $0 "\n"}else{printf "%s:",$0}}' merge.txt 
    awk 'NR%2{printf "%s:",$0;next}{print;}' merge.txt

2016-10-21

Program Comment(程式註解)

2016-10-21 Program Comment 程式註解

記錄一下, 老忘了

程式註解(Comment)


語言 單行註解 多行註解
perl # =head
多行註解
=cut
AutoHotKey ;
C // /* 多行註解 */
C++ // , # /* 多行註解 */
Java // , # /* 多行註解 */
C# // , # /* 多行註解 */
vb ', REM 無多行註解
php // , # /* 多行註解 */
jsp // /* 多行註解 */
pascal // { 多行註解 }
delphi // { 多行註解 }
bash #
Power Language { 多行註解 }

---
缺的以後再補...


2016-10-02

Zero 獲2016年全國大學生圍棋十傑賽-首傑

2016年全國大學生圍棋十傑賽首傑 - Zero 平

連結 - http://www.haifong.org/?p=12542

獲選為 第十五回世界學生王座臺灣男子代表

記一下

----

2016-08-07

sudoers

2016-08-07 不能偷懶, 十年了, 還是要記下 Memo.

sudo 權限管理

  • 檔案 - /etc/sudoers
  • 編輯
     sudo visudo 
    • Host alias specification
    • User alias specification
    • Cmnd alias specification(在命令別名加入命令)
       Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/halt, /sbin/reboot 
    • User privilege specification
      • 預設 sudo 群組
         %sudo   ALL=(ALL:ALL) ALL 

2016-01-31

Debian jessie mount iPhone

Debian 8.3 jessie mount iPhone

2016-01-31

為了取出照片(Photo) , 只好用 USB 線, 掛載 iPhone.

Step-by-step :
  • Debian 安裝套件
    sudo aptitude install libimobiledevice-utils gvfs-backends
        gvfs-bin gvfs-fuse
    
  • 將 /etc/fuse.conf 內最後一行 #user_allow_other 的註解(#)拿掉
    sudo vim /etc/fuse.conf 
    改成
    user_allow_other