FAQforge provides answers for frequently asked questions for the Linux-, MAC and Windows operating systems.
Keep the spamassassin filter rules up to date in ISPConfig 3
To update the spamassassin rules regularily on your ISPConfig 3 server, add the following line to the root crontab by running:
crontab -e
then insert the following line:
23 4 */2 * * /usr/bin/sa-update –no-gpg &> /dev/null
and save the file. The path to the sa-update script is /usr/bin/sa-update on Ubuntu and Debian Linux, if you use a different linux distrubution, run the command:
which sa-update
to find the location of the sa-update script and adjust the path in the crontab line above so that it matches the path on your system.
How to kill processes in “D” state in Linux?
If a process is shown with process state “D” in tools like ps or top, then its a zombie process. Example:
ps axl | grep D F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 104 2579 9109 20 0 5024 2116 refrig D ? 0:00 cleanup -z -t unix -u -c
Zombie processes can not be killed with the normal commands like “kill -9 PID”, you will have to reboot the system to kill them.
How to use apt-file to find which .deb package contains a specific file
Sometimes you need to know which debian package contains a specific file e.g. because you deleted a system file accidently or you try to install a new software that requires this file. The apt package management utility which is used in Debian and Ubuntu comes with a handy tool called apt-file which allows a saerch for filenames in the package database.
Install apt-file
apt-get install apt-file
Update the apt-file database
apt-file update
Search for a specific file name, e.g. “lcrypto”
apt-file search /bin/bash
apt-file search /bin/bash
bash: /bin/bash
bash: /usr/bin/bashbug
bash-minimal: /bin/bash-minimal
bash-static: /bin/bash-static
bashdb: /usr/bin/bashdb
mybashburn: /usr/bin/bashburn
Calibrate the screen colors and gamma in Windows 7
To start the Windows 7 dccw application that calibrates the colors and gamma of your monitor, press the keys [Windows] + [R] to open the windows command line and enter:
dccw
Then click on “OK”.
and click on “next” and follow the instructions on the screen.
Robocopy single- and multithreaded benchmark on Windows 7
A commenter of my robocopy article asked me if a multithreaded copy tool like robocopy is really faster then a single threaded copy tool like xcopy as normally the harddisk is the bottleneck and not the CPU when copying files. As I did not found any benchmarks, I decided to do my own benchmark. Here are the results:
In my test, I copied a folder hierarchy with 429 directories and 6313 files with a overall size of 522 MB. I’ve run every test 2 times to ensure that the speed differences are not caused by filesystem caching. I know that this test was not made under scientific conditions, so if you have your own results, feel free to post them here as comment.
xcopy
Command:
xcopy D:\server\test D:\tmp\test /D /E /Y /Q
Time to copy files
First run: 42 seconds
Second run: 41 seconds
robocopy with 1 thread
Command:
robocopy D:\server\test D:\tmp\test /MT:1 /E /LOG:d:\tmp\robocopy.log
Time to copy the files
First run: 43 seconds
Second run: 41 seconds
robocopy with 10 threads
Command:
robocopy D:\server\test D:\tmp\test /MT:10 /E /LOG:d:\tmp\robocopy.log
Time to copy the files
First run: 38 seconds
Second run: 36 seconds
Conclusion: Using a multithreaded copy tool like robocopy with 10 threads speeds up file copying and makes sense if you have to copy a large number of files. At least on my system.
Copy files faster in Windows 7 with robocopy
Windows 7 comes with a new version of the robocopy command that is able to copy files much faster then the normal copy command or copy function of the file explorer by using several simultanious threads. So if you plan to copy a large number of files, e.g. to make a backup, use the robocopy command.
Example Copy files from C:\myFiles to F:\backup and use 10 simultanious threads. To execute robocopy, open the windows shell window or press the keys [Windows] + [R] to open the windows command line, then enter the command:
robocopy C:\myFiles F:\backup /MT:10
To get the full list of robocopy options, execute the command:
robocopy /?
For Windows XP or Vista, you can get the robocopy command from the Microsoft Resource Kit Tools
How to create a rescue CD in Windows 7
Windows 7 contains a application to create a rescue CD easily which can be used to boot the system and diagnose problems in Windows.
To create the rescue disc, press the keys [Windows] + [R] to open the windows command line and enter:
systemre
Test the phising filter of your web browser
If you like to test if the phising filter of your webbrowser works, open the following URL of the mozilla test page in the browser:
You should get a result page that looks similar to this one if you use the Mozilla Firefox browser:
Make the gnome desktop in Ubuntu 9.10 to look like Windows XP
The following steps describe the Installation of the XPGnome theme for Ubuntu Linux. Run the following commands in the Ubuntu Shell window to make Ubuntu look like Windows XP:
cd /tmp
wget http://ubuntu.online02.com/files/XP_Gnome.tar.gz
cd XP_Gnome
./InstallXpGnome.sh
Screenshots:
How to link a network drive into a folder on Windows 7
Have you ever tried to install a software on a network drive or use a network drive as data directory were the software installer checks for the drive type and refuses the installation on network drives? A workaround that helped me in these cases is to use a symlink on Windows. For example, the application wants to put its data in the path C:\ProgramData\appname but you want the data to be stored on the mapped network drive X:\mydata\appname, you can use the following command on the windows commandline to symlink the directorie:
mklink /d “C:\ProgramData\appname” “X:\mydata\appname”
The benefit is, that the application installer detects now C: as valid local harddrive and uses the symlinked path to store its data on the network drive X:\mydata\appname.
The general syntax for the mklink command is:
mklink /d symlinkpath targetdirectory


