I am using this cronjob for monitoring updates and SMART values.
# Monitoring cronjob
33 3 * * 0 root apt-get update ; apt-get -q --simulate upgrade
34 3 * * 0 root smartctl -a /dev/sda ; smartctl -a /dev/sdb
Dont forget to reload cron!
You will need this package: “smartmontools” for “smartctl”.
The output will be send via mail at root. You can configure that in “/etc/aliases” and then running “newaliases”.
I recently got the error “Argument list too long” when trying to remove many files in a folder:
$ rm *
bash: /bin/rm: Argument list too long
If all the files do not contain whitespace or special chars, this will work:
Otherwise you you need a solution with special handling of filenames.
I use Pidgin for some IRC channels but there is a problem with some channels with special chars in their channel topic text. There seem to be some special chars that are used for colors and similar, but pidgin does not handle them correctly in the xml files like blist.xml (buddylist).
More about that bug in this tickets:
My fix for the bug: Creating a start script for pidgin, that converts the badly escaped stuff in the xml files:
if [ -f ~/.purple/blist.xml ]
mv ~/.purple/blist.xml ~/.purple/blist.xml.tmp
cat ~/.purple/blist.xml.tmp | sed 's/\&#x/\&#x/g' > ~/.purple/blist.xml
If you want to disable your firewall on your centos machine, try this command:
either then manually changing the file
Also check out the other “system-config-*” commands
I recently installed CentOS 6.2 in a VirtualBox and was pretty astonished, because it did not have networking or a eth0 working.
You need to change this file:
More info about that problem:
If more than one person has to manage a server, it might come in handy to have some kind of versioning of the config files.
But also having the possibility to keep track of local configuration changes in your system could be very usefull.
I found 2 tools that can help you:
etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository. It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades. It tracks file metadata that revison control systems do not normally support, but that is important for /etc, such as the permissions of /etc/shadow. It’s quite modular and configurable, while also being simple to use if you understand the basics of working with revision control.
$ apt-get install etckeeper
Changetrack logs modifications of a set of files, and allows recovery of the tracked files from any stage of development. The changes are presented in a powerful web-based form, a text file, or an email message. A handful of options allow situation-specific configuration, but the code is readily available for more complex modifications.
$ apt-get install changetrack
You need to create a file
/etc/apt/apt.conf with the following content:
You need root permissions to create/edit that file, but for using apt-get you already do so.
When you see this message in /proc/mdstat, it means that the raid partition is in auto-read-only mode. This mode is set when the device has not been written to since the last check.
In case of a normal partition, just try to write a file and the mode should disappear.
When its a swap partition, you can use this commands:
I got a cron email with this content, so i started investigating:
checkarray: W: array md0 in auto-read-only state, skipping...
It seas about a Warning (W:), but i think it should rather be a notice…