Auto-loading Kernel Modules at System Boot in CentOS/RHEL

I’m used to add the module in /etc/modprobe.conf , It’s also possible to add module parameters in the /etc/modprobe.d/ and to load modules from /etc/rc.local if you want that.

What I found today is that RedHat based systems like RHEL6, RHEL5, CentOS 6, CentOS 5 tend to try to do it their own way: They use the /etc/sysconfig/modules/ directory under the RedHat specific /etc/sysconfig directory for this.

CentOS/RHEL loads its kernel modules at boot time using the wrapper script located in /etc/rc.sysinit. At about line number 145 you can find a loop which basically instructs system to load any user defined kernel modules in /etc/sysconfig/modules/ directory:

Let’s say you want to load dm_script module used for LUKS at boot time:

Make sure the script is executable:

Thanks to Darius at AphoniaStream for such quick and easy article: Auto-loading Kernel Modules at System Boot in CentOS/RHEL | AphoniaStream.

TEMPer for messuaring temperature in server rooms

I have just ordered the TEMPer from amazon.com. I will connect it to a server and run a small perl script to probe it for the temperature. I will let ZenOss run this script and fetch the outcome of the script to collect and check against my defined ok values.

I looked it up on the internet and saw that it is told to be coming without instructions and drivers.

Continue reading

Best practice cable rack rooms

I remember one of the first places I worked as a sysadmin. The cables in the server room several places looked like a mess. This was a non-commercial work-place, where the government gave us just what we needed, not more.

The sight of the server room where a pity sight. I have learned that long network cables make a lot of mess. To make you server room as tidy as possible when it comes to network cables, it is smart to keep several lengths of new network cables available. Always find the right size for the cable so it does not make a mess.

The cables in the server room I refer to was hanging from one part of the wall, into a big pile because the cables where to long, before it was connected to a patch panel. It had another connector than the usual RJ-45.

Here are some pictures to show how you can cable your network so it becomes easier to manage.

NComm-Cable-in-Tray NComm-Data-Rack

Continue reading

howto disable java in Chrome, Firefox or Safari

Here is how to disable Java in you browser:

All Java exploits come from Java running in your browser.

Disable java in Chrome

Type “chrome://plugins” into your address bar. This will bring up a new tab. Find the item on the list that reads just plain “Java” and click below it where it says “Disable” in blue. Restart your browser.

Continue reading

Fix permissions on profilePath and homeDirectory

I was doing a cleanup of users home and profile directories.
I found out that we needed to fix permissions on most of the directories to be able to do f.ex backup.

As admin, I ended up creating a small script fix.bat

which I call like this:

Linux Shell Script To Backup and Restore MBR (Master Boot Recored)

I might not recommend using a shell script for doing backup and restore of your MBR, but it can help a lot to read a script to understand how backup of MBR can be done.

What you need is dd, sfdisk, and a few bytes available on your disk, nfs or usb where you want to store it.

Make a MBR backup. It takes 512 bytes:

Make a backup of your partition table for your $devname

To restore partition table from a earlier sfdisk backed up partiton table:

I struggle to understand why we restore the 448 bytes when we f.ex http://en.wikipedia.org/wiki/Master_boot_record says that it is 446 B (boot loader) + 16 B (partition 1) + 16 B (partition 2) + 16 B (partition 3) + 16 B (partition 4) + 2 B (bootsignature)

To restore only the boot-record, which is the first 448 bytes of the mbr record.

To restore the full MBR

See a nice backup script to take backup of partition table and master boor record MBR here:

http://bash.cyberciti.biz/diskadmin/linux-shell-script-backup-restore-disk-mbr/

Disable users in AD who have not logged in within 35 days

Disable users who have not logged in within 35 days