Live Chat!

touch your files

* * * * * 1 votos

November 14th, 2006 toydi

When you touch a file, you change both its accessed and modified time.
Here’s a file and its status:
$ stat foobar
File: `foobar’
Size: 154 Blocks: 8 IO Block: 4096 regular file
Device: 304h/772d [...]

Posted in Common, stat, touch | Hits: 6079 | 2 Comments »

ssh tunneling with local port

          0 votos

November 7th, 2006 mysurface

I remember I do post an example of how to do a dynamic tunnelling through ssh.
For this post, I am going to tunnel specific port from a remote site to my localhost. Assume the remote site have vncserver which open a display port at :1 for you, and its domain name is “myvnc.net”. VNC need [...]

Posted in Admin, ssh | Hits: 4032 | No Comments »

search and replace

* * * *   1 votos

November 1st, 2006 mysurface

This is a very common needs, to search a keyword and replace it with another. Give you a simple example, when I want to perform a ubuntu distribution upgrade from dapper to edgy, I need to edit the file /etc/apt/sources.list.
To do that i can either uses vim, or simply uses sed.
The vim way.
sudo vim /etc/apt/source.list
When [...]

Posted in Misc, Text Manipulation, sed, sudo, vi, vim | Hits: 8889 | 2 Comments »

Generating Random numbers

* * * * * 1 votos

October 27th, 2006 mysurface

We can obtain pure random (NOT pseudo-random) bytes from /dev/random. Linux kernel harnesses a good source of randomness from you. The random bytes in /dev/random is measuring based on the time delay between your input actions.
so seems /dev/random provided random bytes, we need to turn the bytes into an integer so that we could read. [...]

Posted in Bash, Misc, echo, od, touch | Hits: 10180 | No Comments »

say yes to everything

          0 votos

October 23rd, 2006 mysurface

Sometimes some commands always like to ask you for comfirmation. Are you sure … (Y/n). Sometimes, that is irritating, especially when you do yum update.
yum is package manager for Red Hat based linux, it usually takes a long time to get ready to download the update packages. Once yum is ready, it will ask you [...]

Posted in Admin, Misc, alias, yes, yum | Hits: 5734 | 3 Comments »

Creating Samba User

          0 votos

October 22nd, 2006 liewsheng

After you have install samba sever, yous still can’t login samba server. You will need create a samba user :
smbpasswd -a username
‘-a’ switch tell smbpasswd we want to add a new user, is the user you want to add. Please take note, username must exist in /etc/passwd file else you will need the [...]

Posted in Admin, smbpasswd, useradd | Hits: 11713 | 2 Comments »

ssh dynamic tunneling

* * * * * 2 votos

October 16th, 2006 mysurface

SSH is a very powerful tool, besides connecting to remote ssh server, execute command remotely and transfer files, it is port forwarding and ssh tunneling. In this example I am going to introduce you how to uses ssh to create a dynamic tunnel that makes your own computer as an internet proxy.
Let say you are [...]

Posted in Admin, ssh | Hits: 8028 | 1 Comment »

Shutdown/Reboot using ’shutdown’

* * ½     2 votos

October 15th, 2006 liewsheng

It have a lot of way to shutdown/reboot your machine, the easier way is using shutdown button in gnome or KDE menu ;p The another way is using ‘init’ which already intro in Shutdown Using ‘init’. Now I will intro a another command - ’shutdown’.
’shutdown’ have more option than init, you can specific how long [...]

Posted in Admin, shutdown | Hits: 8304 | 3 Comments »

mount a samba point

* * * *   1 votos

October 10th, 2006 mysurface

You may heard about smbmount, smbfs or cifs. Yes if you are looking for how to mount a point to access to other machine through samba, you come to a right page.

How to mount a samba point might be vary at different linux distro, I ll recomment you at least read the manuals at your [...]

Posted in Admin, mount, mount.cifs, smbmount, sudo | Hits: 17131 | 4 Comments »

Enable a user to gain write permission when mounting

          0 votos

October 10th, 2006 mysurface

We need to perform mounting with root privilege, but after a simple mounting, we need to be root in order to write to the mounting point. This is the default for a simple mounting, check out more mounting examples here.

But we can grant the mount point ownership to other user besides root. We can do [...]

Posted in Admin, cat, mount, pipeline | Hits: 10998 | No Comments »