» ubuntu の記事

grub menu 入舊的kernels 

apt-get remove linux-server
apt-get update
apt-get -f install
apt-get upgrade

#清理舊的 kernels 
apt-get autoremove

 

nano /etc/cron.d/php5

Change

09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null ; -delete

to

09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete

 

~ nginx setting php sock in ubuntu(android) ~

connie 2013.04.08 | ubuntu | | No Comments
nano /etc/php5/fpm/pool.d/www.conf
;listen = 127.0.0.1:9000
listen = /tmp/php5-fpm.sock
listen.owner = www-data //same as nginx user
listen.group = www-data
listen.mode = 0666
nano /etc/nginx/sites-available/default
location ~ \.php$ {
            fastcgi_pass   unix:/tmp/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
            include        fastcgi_params;
        }

 

apt-get install php5-mysql php-apc php5-gd php5-mcrypt

 

必需東西

  1. Root機(笑,未root 可以再見了
  2. Android Terminal Emulator , 即putty
  3. Hacker's Keyboard , 感覺好小小既keyboard skin,最小你會講小左好多粗口:)
  4. Complete Linux Installer , linux container
  5. Astro File , android file system

 安裝晒以上東東後,開啟 Complete Linux Installer 

去install guides 到choose 你要安裝既OS 到,尼到會用ubuntu 12.04 尼做example

Screenshot_2013-04-01-19-47-49

Page 1 主要係叫你開USB debugging mode , 同夠位donwload ubuntu OS images

Screenshot_2013-04-01-19-47-58

之後Page2 donwload image 

Screenshot_2013-04-01-19-48-01

之後有3個size可以 download , 睇餸食飯。

Screenshot_2013-04-01-19-52-28

sourceforge 係幾好,用4G download 都好快完成, (小妹係唔係就係另mobile network 塞車的兇手,喂

Screenshot_2013-04-01-19-52-31

download 完成後就解壓,內有2個file , 一個係img , 一個係md5

Astro File check 一下md5 有無問題,按實>properties>MD5 checksum

之後將img放到你想放既位置。

完成後回到Complete Linux Installer , 去launch

SETTINGS>Edit 變更images link

save> Start Linux

開了後會自動跳到Android Terminal Emulator,問你開唔開ssh, vnc, y晒佢你就有好日子過

之後save ,一切都變回你懂的東西,update 一野

apt-get upgrade && update

install LAMP

apt-get install apache2 mysql-server php5

Screenshot_2013-04-01-19-23-02

完成

~ Mount A Network Share On Ubuntu ~

connie 2013.03.26 | ubuntu | | No Comments

先要安裝以下東東

apt-get install cifs-utils

安裝後要去新增一個directory for mount network drive

mkdir /media/share

之後手動試一下連接

mount.cifs //192.168.0.0/folder/  /media/share/ -o user=USERID,pass=PASSWORD

成功的話,將佢加去開機的指令

nano /etc/fstab

加入以下的東東

//192.168.0.0/folder/  /media/share/  cifs  username=USERID,password=PASSWORD  0  0

之後reboot , 看看mount 不mount 到了: )

~ crontab on ubuntu ~

connie 2013.03.25 | ubuntu | | No Comments

先寫好個shell script,並將佢set 做可以execute

chmod 755 filename

之後去

nano /etc/crontab

建議你先set 做一分鐘run一次,睇下run 唔run 到先

*/1  *   * * *  root    /home/user/sh/backup.sh
分 時 日 月 週 執行者身份  指令串

/ 代表毎隔幾耐run 一野,而 / 前需要有 * 的,上面的指令=一分鐘run 一次

如果想2月1日0:00 send email 請如下

0 0 1 2 * mail connie < /home/happy_birthday.txt

done : )

~ add 7z compression with password for ubuntu ~

connie 2013.03.21 | ubuntu | | No Comments

先裝上7z on ubuntu

apt-get install p7zip-full

之後如果要加password 落過zip file 到可以用以下script

7z a -r -mhe=on -pmy_password output.7z a_directory
7z a -mhe=on -pmy_password output.7z a_file

解壓
7z x output.7z

~ Remove the Grub boot on Ubuntu ~

connie 2013.03.20 | ubuntu | | No Comments

當你的ubuntu server update 好多次之後,

就要開始清一清 Grub boot sector

唔係就會出現,以下error

/boot is using 91.2% of 227MB

先用以下cmd check 一check 現在用緊既kernels

uname -r

會出現以下的東東,不要remove 這個

3.2.0-39-generic

之後再list out all kernel which is stored in Grub boot

dpkg --list | grep linux-image

ubuntu_boot

remove uname -r 對下的kernels

sudo dpkg --purge linux-image-x.x.x.x-generic

完成後update

sudo update-grub2

 

~ install mcrypt in ubuntu ~

connie 2013.01.22 | ubuntu | | No Comments
apt-get install php5-mcrypt
/etc/init.d/apache2 restart

 

« Previous Page | HOME |

Smiley face

March 2024
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31