How to connect to an SSH-Server

To connect to a system's terminal with a static network IP and an SSH-Server installed, open a terminal and enter following command, exchanging the network IP with the one of your SSH-Server:

ssh [email protected]

Enter the target SSH-Server's root password afterwards. To exit the server's shell, enter

exit

How to Block Web Pages (Linux Mint 11)

To block web pages on Linux Mint, there is a simple tool in your Control Center. Go to Menu > Control Center > System > Domain Blocker and you will be asked for your password. A plain window with just a few buttons will appear afterwards.

To add web pages to the blocking list, click on Add and type in the (un-)desired page. It may occur that you have to enter it two times, one with www. and one without www..

To adopt the changes restart your browser and the entered web page should no longer be available.

How to Create New Shellscripts

This guide explains how you can create new shellscripts to execute in a terminal (I am using Linux Mint 11). Your scripts are usually stored in /bin and /usr/bin, however the sh file which we are going to use is located in /bin, so we are going to create the script there. Open a terminal and become root with

su

Now create a new text document in /bin and make it writable and executable:

touch /bin/newscript

chmod 777 /bin/newscript

Open the newly created file with a text editor and write the following code in the first line of the file:

#!/bin/sh

Save the file now. Through this line it has become a script executed with the default shell, although it has no content yet. However you can either write your own script into it using Shell Script or use it to combine scripts you execute together a lot to save time.

How to Kill Processes on UNIX Based Operating Systems

This guide explains how to kill processes on Unix based operating
systems.

To kill a process you need to know its Process ID (PID). To find out that, open a terminal and enter

ps -e

The list of processes has two columns that are important for you, which are PID and CMD. CMD gives you the name of the process whereas PID gives you the ID. Search the list for the process you want to kill and enter

kill -9 PID

Replace PID with the PID of the process you want to kill. This procedure is similar to the one of Windows' Task Manager.

Tutorial: take a screenshot on a iPad 2

This tutorial explains the process to take a screenshot from your iPad or iPhone screen. There is no app required to take the screenshots.

1) Navigate to the screen that that shall be saved as screenhot. In my example I will take a screenshot of the home screen.

2) Press the "Power" button (in the upper right corner of the iPad) and the "Home" button (in the middle of the lower bar of the iPad) simultaniously.

You will hear a "camera click" and the screen will fade to white for a second when the screenshot is taken. The screenshot is saved into Photos folder on the iPad.

To view the screenshot, open the "Photos" app:

and tap on the photo.

The easiest way to transfer the screenshot to your desktop PC or MAC is to send it by email. Tap on the Icon in the upper right corner of the screen:

and select "Email Photo":

 

This tutorial works on iPad and iPad 2 and iPhone.

Redirect http requests to a new folder with apache rewrite rules

When you reorganize the structure of a website, you might want to redirect requests to files in a old folder to a new one without loosing the pagerank. In this example, I will redirect all requests from directory "olddir" to directory "newdir", so that requests like http://www.yourdomain.tld/olddir/page.htm get redirected to http://www.yourdomain.tld/newdir/page.htm without loosing the Google pagerank of the pages.

The following rewrite rules can be added into a .htaccess file in the website directory or in the vhost configuration.

RewriteEngine on
RewriteRule ^olddir/(.*)$ newdir/$1 [R=301,L]

This rewrite rule redirects automatically all requests to pages or subdirectorys of "olddir" to the same page or subdirectory in "newdir".

Reduce load of backup scripts with nice and ionice

Runing a nightly backup script on a server system like a webhosting server can produce high load and longer latencys for other processes, e.g. HTML or .php pages load slow during backup because the backup script takes too much I/O or CPU resources.

On Linux systems there are two shell utilitys available to set the I/O and CPU Scheduling for a appliaction or script. The utilitys are named nice and ionice.

Reduce the I/O priority of the script "/usr/local/bin/backup.sh" so that it does not disrupt other processes:

/usr/bin/ionice -c2 -n7 /usr/local/bin/backup.sh

The -n parameter must be between 0 and 7, where lower numbers mean higher priority.

To reduce the CPU priority, use the command nice:

/usr/bin/nice -n 19 /usr/local/bin/backup.sh

The -n parameter can range from -20 to 19, where lower numbers mean higher priority

Nice and ionice can also be combined, to run a script at low I/O and CPU priority:

/usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /usr/local/bin/backup.sh

 

Disable quota for a Linux user or group on the shell

Linux user quotas can be edited with the commands edquota or setquota on the shell. While edquota opens the quota settings in a editor like vim, setquota allows you to specify the quota settings on the commandline.

Example for disabling the quota for the user "testuser":

setquota -u testuser 0 0 0 0 -a

Example for disabling quota for the group "testgroup":

setquota -g testgroup 0 0 0 0 -a

Convert the charset of file names from iso-8859-15 to utf8

When you copy files from a older Linux or Windows system to a new Linux system, the filenames can get broken and have to be converted. Handy tool to translate the charset of filenames is convmv.

Example

convmv -f iso-8859-15 -t utf8 -r /var/www/myhome.lan/web/images/*

Your Perl version has fleas #37757 #49830
Starting a dry run without changes...
mv "/var/www/var/www/myhome.lan/web/images/gr▒n.jpg"     "var/www/myhome.lan/web/images/web/images/grün.jpg"

To finally execute the command (not dry run), use the --notest option:

convmv --notest -f iso-8859-15 -t utf8 -r /var/www/myhome.lan/web/images/*

Thanks to PlanetFox for this FAQ.