Recent Post

Categories

Archives

Cow Computing

10 Mar 12

Jailkit – Limit User Account on Linux

There’s once I was required to setup a limited shell access user account on a commercial hardware product, in which to secure the original system from being modified and at the same time to provide a flexible environment for general work. I was on the way to make use of chroot command. Then i was lucky to came across Jailkit, which saved me a lot of time. So, i would like to use this post to give a little introduction on how to use it.

# First, let's create a directory for the jail account
mkdir /jail
chown root:root /jail

# Then we create a new user account specially for jail account
# *replace <group name>, <username>, <password> with your own value
groupadd <group name>
useradd -d /home/jail -g <group name> -p <password> <username>

# For example, if we only want to allow the jail account to have ssh and basic shell access
jk_init -v -j /jail basicshell ssh

# Then we shall jail the user account we previously created to the jail directory
jk_jailuser -m -j /jail <username>

Read More / Comment »

10 Feb 8

Fsutil – The Useful Administrative Tools in Windows

Fsutil is a command-line utility for performing file system related tasks,  such as displaying/managing file or drive properties, dismounting or extending a volume etc. Fsutil is a very powerful tool and is meant to be used by system administrator to perform advance operations. In this post, i will try to share my knowledge on fsutil to perform some simple yet useful tasks.

(*Do learn about what you are doing before executing a command.)

1. Creating a file of a specific size instantly, e.g. 1GB

# fsutil file createnew <filename> <filesize>
fsutil file createnew testfile 1073741824

Read More / Comment »

10 Jan 16

Some Useful HotKey for Eclipse

If you develop heavily on Java, Eclipse definitely should be your primary programming tool (other than Text Editor).
To be more effective in coding, one must master the tools he/she uses. In terms of Eclipse, hotkey is one of the chapter which should be learnt. After sometimes, the hotkey usage will eventually speed up your coding.

Below are some common ones:

Ctrl + Shift + P // Go to the corresponding ending brace
Ctrl + Q // Go back to last edited location
Alt + Left/Right Arrow // Go to previous or next editor
Ctrl + I // Format code
Ctrl + 1 // Generate try/catch or do/if/while/for
Ctrl + / // Comment/Uncomment
F3 // Find Method
Ctrl + L // Go to line
Ctrl + Space // Toggle code assist
Ctrl + Shift + Space // Toggle arguments hints