SSH command examples

ssh user@host
Connect to host as user

ssh -p 1234 user@host
Connect to host on port 1234 as user

ssh-copy-id user@hostA
dd your key to host for user to enable a keyed or passwordless login

Linux File Permissions

chmod XXX file

4 – read (r)
2 – write (w)
1 – execute (x)

Examples:

chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world

Linux Command - tail -n +2

df -k | tail -n +2

Output the second line to end content of df -k.

df -k | sed /^[^/].*/d

Regular expression remove the Not / start lines.

Linux Command cheat sheet

URL rewrite underscores to dashes

According to SEO(Search Engine Optimization),that google do not recognize underscores as spaces between words. They do however, recognize dashes to separate words and tag keyword phrases.

So we need this .htaccess file.

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^tag/(.*)_(.*)$ http://www.yoursite.com/tag/$1-$2 [R=301,L]
RewriteRule ^tag/(.*)_(.*)$ http://yoursite.com/tag/$1-$2 [R=301,L]

How to config wordpress to show more than 15 recent posts

The default wordpress widgets - Recent Posts will only show at most 15 item.But I want show more!

FTP and find the wp-includes/widgets.php.Download and edit it.

Change the

20 Drupal themes

Ubuntu join windows Domain(Active Directory)

Install and Configure likewise-open

sudo apt-get update
sudo apt-get install likewise-open
sudo domainjoin-cli join fqdn.of.your.domain Administrator
sudo update-rc.d likewise-open defaults
sudo /etc/init.d/likewise-open start

After that is done, you can log out, then log back in with your domain\username account (You have to add the domain\ first).

Duplicate Audio CDs with cdrdao in Ubuntu

You can use this cdrdao to duplicate Audio CD.

Howto Duplicate Audio CDs using cdrdao in Ubuntu

Config Nautilus always show location bar

You can press Ctrl+L to show Nautilus Location entry.If you want nautilus always show location bar.Just open a Terminal and type
gconf-editor

Find the /apps/nautilus/preferences/always_use_location_entry,change value to True.

Syndicate content