chmod 755 for dir 644 for files

2 Comments

find . -type d -print0 | xargs -0 chmod 0775 # For directories
find . -type f -print0 | xargs -0 chmod 0664 # For files

Default Gateway on Ubuntu

Leave a comment


josh@wombat:/etc/network$ more interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

## Network interface(s)
## You should (un)comment and edit according to your needs.

# The primary network interface (dhcp)
#auto eth0
#iface eth0 inet dhcp

# The primary network interface (static IP)
auto eth0
iface eth0 inet static
address 192.168.1.45
netmask 255.255.255.0
#gateway 192.168.1.1
gateway 192.168.1.254
broadcast 192.168.1.255

Colourful PS1 that still auto wraps

Leave a comment

export PS1="\u@\h\[\e[1;4;33m\][LIVE]\[\e[0m\]:\W$ "

\u@\h\

  • user @ hostname

\[\e[1;4;33m\]

  • enclosing “\[” and “\]” – to /not/ confuse the screen mode so that auto wrapping is preserved.
  • “\e” – is the escape, you could use “33” too
  • “1;4;33” – “1” is for “bold”, “4” is for “underline”, and “33” is for “yellow”, you can add background colour by adding the ascii code for background colour – just separate these numbers with “;”

\[\e[0m\]

  • 0 resets to normal display

\W

  • working directory

find and delete

Leave a comment

find . -name ".svn" -exec rm -rf {} \;

tar gzip several files into a single archive

2 Comments

from http://www.gzip.org/#faq7

for GNU tar: gtar cvzf file.tar.gz filenames
for any tar: tar cvf - filenames | gzip > file.tar.gz

using apt-get in Ubuntu …

Leave a comment

I downloaded a vm appliance – ubuntu edgy server – by Joao InacioI (Thanks mate!) and it was quick and easy. But it did not come with openssh-server (sshd) where I can ssh into… *sigh* so here what i had to go through to get it.

sudo apt-get install openssh-server

But it didn’t work : “Package not available… But referred to by another package” … after googling around, I realised it was becasue the had to include the universe repository which apt-get depends on.

sudo vi /etc/apt/source.list

follow the comments in that file, I basically uncommented the last 2 lines.

sudo apt-get update

this will do and update

sudo apt-get install openssh-server

this thime it works !!