2015年12月17日 星期四

[linux] centos iptables add rules

1. check : iptables -L
2. check : iptables --line -vnL
3. add rule : iptables -I INPUT 5 -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
4. check : iptables --line -vnL

ref : http://www.binarytides.com/open-http-port-iptables-centos/

2015年8月26日 星期三

[OS] Windows GPT to MBR


Windows GPT to MBR

1.使用Win7光碟或者USB引導,進入系統安裝界面。
2.按Shift + F10打開命令提示符。
3.輸入”Diskpart”(不用輸入引號,下同),並ENTET,進入操作界面
4.輸入:”list disk”,查看硬碟信息。
5.輸入:”select disk 0”,選擇disk 0爲當前操作的硬碟。
6.輸入:”Clean”,清空當前硬碟分區。
7.輸入:”convert mbr”,轉換爲MBR分區。
8.操作完成,關閉此命令提示符窗口,繼續按照正常的方法安裝Win7系統即可。


Ref : https://zh-tw.facebook.com/notes/fb%E5%A4%A7%E6%84%9B%E5%9E%8B%E7%94%B7%E6%97%A5%E8%AA%8C-%E5%90%B3%E5%BF%A0%E8%AB%BA/%E5%A6%82%E4%BD%95%E5%9C%A8win8-%E8%BD%89win7-gpt%E6%A0%BC%E5%BC%8F-%E5%AE%89%E8%A3%9D%E6%A8%A1%E5%BC%8F%E4%B8%AD-%E8%A7%A3%E6%B1%BA%E4%B8%8D%E8%83%BD%E5%AE%89%E8%A3%9D%E7%9A%84%E6%A0%BC%E5%BC%8F%E8%99%95%E7%90%86/694713627247563

2015年2月23日 星期一

[android] Android Image Crop

Android Image Crop
Intent intent = new Intent("com.android.camera.action.CROP");
// this will open all images in the Galery
intent.setDataAndType(photoUri, "image/*");
intent.putExtra("crop", "true");
// this defines the aspect ration
intent.putExtra("aspectX", aspectY);
intent.putExtra("aspectY", aspectX);
// this defines the output bitmap size
intent.putExtra("outputX", sizeX);
intent.putExtra("outputY", xizeY);
// true to return a Bitmap, false to directly save the cropped iamge
intent.putExtra("return-data", false);
//save output image in uri
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
Ref :

01 . http://stackoverflow.com/questions/3846338/how-to-crop-an-image-in-android

02. example source :
http://linux.linuxidc.com/2012%E5%B9%B4%E8%B5%84%E6%96%99/11%E6%9C%88/11%E6%97%A5/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Android%20MediaStore%E8%A3%81%E5%89%AA%E5%A4%A7%E5%9B%BE%E7%89%87/

2015年2月9日 星期一

[Cross Compile] OpenSSL Cross Compile

UDP Socket Server & Client in C

source : ftp://ftp.openssl.org/source/
(1) cd into openssl-1.0.0d folder
(2) ./Configure linux-generic32 shared
(3) Edit Makefile Flag : CC, CFLAG, MAKEDEPPOG
(4) make clean
(5) make