About ClarkChen

Nothing~Later I'll be back...

Escapes your comfort zone

“People want color”
“So, let’s do something better”
“You refuse to do anything that vaguely escapes your comfort zone.”
“I’m just trying to do it right.”

10351603_10202416086118566_8254040042653813846_n

廣告

How to repair a corrupted FAT32 file system

Try typing the following command in the Linux terminal:

Install dosfstools package

The package you need to install in your Linux PC to be able to format disk using FAT32 file system is: dosfstools

install dosfstools in Debian / Ubuntu

apt-get install dosfstools

dosfstools-3.0.13:

sudo dosfsck -w -r -l -a -v -t /dev/sdc1

or
dosfstools-3.0.26

sudo fsck.fat -w -r -l -a -v -t /dev/sdc1

20141117_fsckfat

If your partition is /dev/sdb1, for example, then unmount it first by running this command:

umount /dev/sdc1

Now you can verify and repair your partition by running this command:

sudo dosfsck -t -a -w /dev/sdc1

想寫出造福世界的程式?你得先…

引文

想寫出造福世界的程式?你得先通過著作權這關!

 

 

 

 

 

 TechOrange

網路時代剛起步之時,許多人理所當然地認為一切來自於網路的東西都是免費的,不管是音樂、小說或者是其他創作。但隨著時間的推移,網路的各項規範日漸成熟,各式各樣的智慧財產權、著作權,甚至是專屬於網路技術的專利問題開始慢慢浮現。

現在大家不再把網路上所有資源視為免費,也出現不少因違法下載音樂、遊戲等鋃鐺入獄的網民。但是,你知道寫程式也有著作權相關問題嗎?

  •  GitHub 有 77% 的程式碼、專案皆無宣告著作權 

Social coding 網站 GitHub 發布了一個名為 ChooseALicense.com 的網站,希望提醒使用者著作權問題,因為太多的程式設計師,不論新手或是是老手,並不了解著作權問題,沒有為自己寫的程式量身訂做地選擇適合的著作權法。

雖然說 GitHub 其中一項宗旨在於開放,不管是老手、新手都可以在上面討論、撰寫、共和合作程式碼,聽起來像由程式碼打造的桃花源。桃花源縱然美好,但現實就像是桃子上的蟲,總是破壞美麗,據統計,77% 在 GitHub 上的程式碼、專案都沒有宣告著作權方式。

GitHub 的新網站聲明:

你有不宣告著作權的權利,這也不是你的義務,但不宣告適合的著作權就代表同意使用預設的方案,其他人將沒有權限修改、再製、衍生你發布的程式碼,這可能不是你的本意。

也許你開發了一段有用的程式碼,打算造福世人,但卻忘記選擇正確的著作權法,這段程式法永遠沒有辦法免費流傳於世界上。

  •  常見的三個著作權

GitHub 的 ChooseALicense.com 網站簡述了三個常見的著作權協議如下:

1. MIT License :源自於麻省理工學院,作者只想保留版權,提供使用者免費複製、修改、散布等權利,但必須包含版權與許可聲明。

2. Apache License : 由著名的非盈利開源組織 Apache 採用的協議,也開放給使用者修改、再發布,但須滿足些許條件,須滿足的條件與最被廣泛使用的 BSD 協議類似。

3. GPL License ( v2 、 v3 版本): GPL 的出發點是程式碼免費的使用、引用、衍生等( 例如 Linux 、 WordPress ),但不允許修改後和衍生的程式碼做為閉源的商業軟件發佈和銷售。其他發布時需伴隨的協議與 BSD 類似。

當然不只這三種,目前經過 Open Source Initiative 組織通過的協議共有 58 種。下次在 GitHub 發布程式碼之前,按照自己程式碼的特性與未來發布計畫等,好好地選擇一個適合的著作權協議吧 !

(參考資料來源: Fast Company ;圖片來源: tacker 、 Wikimedia, CC Licensed )

Create a Samba User on Ubuntu

Create a Samba User on Ubuntu
If you are using Samba Server on your network, you will want to create users that have access to use it. There’s a very simple command structure on how to do so.

I’m assuming that you’ve already installed Samba Server at this point.

There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a <username>

圖片

Next, we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

<username> = “<username>”

Now you can create samba shares and give access to the users that you listed here.

圖片

圖片

sudo: unable to resolve host ubuntu-server

sudo: unable to resolve host ubuntu-server

My /etc/hosts file:

127.0.0.1       localhost
127.0.1.1       ubuntu-server

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
FF02::2 ip6-allrouters

/etc/hostname gives:

ubuntu-server

I think there is some other setting that causes the unable to resole host, but I cannot find these.

Edit the /etc/hosts, you have a typo 127.0.1.1 is not loopback, change it to 127.0.0.1, save and reboot.

How to configure Samba using a graphical interface in Ubuntu

引文

One of the most asked features for Samba is a graphical user interface to help with configuration and management,  there are now several GUI interfaces to Samba available, one of these tools is samba server configuration tool.

“The Samba Server Configuration Tool is a graphical interface for managing Samba shares, users, and basic server settings. It modifies the configuration files in the /etc/samba/ directory. Any changes to these files not made using the application are preserved.”

 

In our previous post we showed you how to configure samba via command line, today we will see together how to configure samba using a graphical interface in Ubuntu

Installing Samba:

First thing we need to do is to install samba, go to Software center in Ubuntu and search for samba then install the package. If you want to install it via terminal then copy this command :

sudo apt-get  install  samba samba-common

Installing Samba Server configuration Tool:

Now install the graphical interface System-config samba

sudo apt-get install system-config-samba

Configuration of samba using a graphical interface:

Now we will try for example to share the directory  /home/pirat9/share folder to do that,

First open GUI samba  server configuration tool by going to System–> Administration–>Samba

Add the  folder you want to share and setup the permissions access.

Now  right click on the  folder directory you want to share and open the  share  options

Then select share this folder

If you want to setup folder access permissions, right click on the folder and open properties (See screenshot bellow)

If you want to add a password to the user: open a terminal and type the command  :

sudo  smbpasswd  -a pirat9

and  then type your password.

Now the configuration is done.

Now lets try to check if we can for example connect from a windows machine. To do that

In a windows machine go to start –>Run and type :

 ip  or  hostname

You will be asked to insert the user and password

Check the  share  folder

And is done.

For questions please refer to our Q/A forum at : http://ask.unixmen.com/ 

[轉]縮小VMWare Workst…

引文

縮小VMWare Workstation中vmdk檔案的大小

Original url:

http://www.minitw.com/pcskill/reduction-in-vmware-workstation-vmdk-file-size.htm?variant=zh-tw

隨著使用時間的拉長,vmware 中 vmdk的檔案大小隻會越來越大,

就算在guest os中把檔案刪掉了,host os中的vmdk檔案也不會縮小。

以下方法,可以有效的把vmdk檔縮小到guest os中真正有使用到的檔案大小,

讓你的vmdk檔不再虛胖。以下方法適用guest os為windows系統。

1.先進入guest os中,把不要的檔案刪除。

2.於guest os中執行清理磁碟,把暫存檔清除。

3.於guest os中,下載SDelete程式,並且解壓縮
本站下載:SDelete.zip  版本:v1.6
官方下載:http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx

4.於guest os中進入console端
開始 -> 執行 -> CMD

5.進入解壓縮後的SDelete目錄
執行下面的指令(如果你的vmdk檔不只分割一個磁區的話,請自行參考sdelete的使用說明)

sdelete -c -z

———————SDelete 使用說明———————-

SDelete – Secure Delete v1.6
Copyright (C) 1999-2010 Mark Russinovich
Sysinternals – http://www.sysinternals.com

usage: sdelete [-p passes] [-s] [-q] <file or directory> …
sdelete [-p passes] [-z|-c] [drive letter] …

-a Remove Read-Only attribute
-c Clean free space
-p passes Specifies number of overwrite passes (default is 1)
-q Don’t print errors (Quiet)
-s or -r Recurse subdirectories
-z Zero free space (good for virtual disk optimization)

———————SDelete 使用說明 END—————–

6.SDelete跑完後,把guest os關機。

7.於VMWare中進入設定頁面,依下圖點選

選擇硬碟 -> 點選Utilites -> 點選Compact

跑完後,就大功告成了,去看看你的vmdk檔,檔案大小已經縮小囉