2015年7月29日 星期三

建立加密磁區 on Unbut / Linux / Raspberry with losetup


/* 0. Make sure you had loaded the cryptoloop module */
/* Otherwise you will get error about losetup  ioctl: LOOP_SET_STATUS: Invalid argument */
sudo modprobe cryptoloop

/* 1. Generate target encrypted partition file */
sudo dd if=/dev/zero of=/media/10M.img bs=1M count=10

/* 2. Encrypt the partition file, it will ask you the desired password. */
sudo losetup -e aes -k 256 /dev/loop0 /media/10M.img

/* 3. Make filesystem for the encrypted partition. */
sudo mkfs.ext4 /dev/loop0

/* 4. change permission and generate a test file */
mkdir /dev/shm/mydir
sudo mount -t ext4 /dev/loop0 /dev/shm/mydir
sudo chwon user:group /dev/shm/mydir
sudo chown user:group /dev/shm/mydir
echo "test" > /dev/shm/tc/test.txt
ls -lt /dev/shm/tc/

/* 5. Finish. umount the dir and loop0 */
sudo umount /dev/shm/mydir
sudo losetup -d /dev/loop0






After you umount the encrypted partition, you should see an empty folder.

/* 6. If you need to use this partition, mount it with encryption option. */
/* It will ask you the password. */
sudo mount -t ext4 /media/mydir/10G.img /dev/shm/mydir -o encryption=aes

2015年5月6日 星期三

ubuntu 14.o4 工作列新增監看網路流量及系統資訊


1.安裝 indicator-sysmonitor 及 dstat

Ref:
install indicator-sysmonitor

$ sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor

$ sudo apt-get update

$ sudo apt-get install indicator-sysmonitor  dstat

2. 內建的網路流量監控太陽春,可以自己寫script來監控

(假設系統有一有線及一個無線裝置, 可以依實際狀況改script)








設定畫面如上圖, script檔案




2015年1月30日 星期五

Ubuntu 安裝最新版 adboe flash (18) for Firefox

由於adobe flash停止出新版LINUX flash, 所以LINUX一直停在11版

後來有人出了NPAPI版的flash給chrome (pepper flash),
悲劇是 firefox不支援NAPAI, 所以不給用

現在有人多包一層freshplayerplugin, 讓firefox可以去load pepper flasha的模組, 就可以享用最新版adobe flash player了

想當然而, 就是先裝 pepper flash, 然後裝 freshplayerplugin

1. 加入 pepper flash PPA
sudo add-apt-repository ppa:skunk/pepper-flash
2. 加入 freshplayerplugin PPA
sudo add-apt-repository ppa:nilarimogard/webupd8

3. 安裝 pepper flash跟 freshplayerplugin
sudo apt-get update
sudo apt-get install pepflashplugin-installer freshplayerplugin

之後就有16版的flash在 firefox上囉, 當然 Chrome也是可以用


透過PPA安裝最新版flash (pepper flash) chrome可直接用

安裝fresh flash player讓firefox可使用pepper flash

安裝 oracle java 8 for Ubuntu 14.04

Ref
1. 新增來源
sudo apt-add-repository ppa:webupd8team/java

2. 更新並安裝 oracle java 8
sudo apt-get update
sudo apt-get install oracle-java8-installer