54 articles Linux

HP Smart array CLI commands

HP Smart array CLI commands (these should apply to any system with the CLI installed) Show configuration /opt/hp/hpssacli/bin/hpssacli ctrl all show config Controller status /opt/hp/hpssacli/bin/hpssacli ctrl all show status Show detailed controller information for all controllers /opt/hp/hpssacli/bin/hpssacli ctrl all show detail Show detailed controller information for controller in slot 0 /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 show detail…

Graphing disk temperatures with the Eluna Graph System

I have been using the Eluna Graph System for several years, as I like it’s simplicity. As per this post, I graph my ESXi disk temperatures so that I can keep an eye on them. Content of create.sh: #!/bin/bash rrdtool create esxi_disks.rrd \ –start `date +%s` \ –step 300 \ DS:disk1:GAUGE:600:0:U \ DS:disk2:GAUGE:600:0:U \ DS:disk3:GAUGE:600:0:U…

Blocking bogons with iptables

ipsets is a fairly recent addition to the netfilter family. It is possible to define networks / addresses and then use them in iptables. ipset –create bogons nethash ipset –add bogons 10.0.0.0/8 ipset –add bogons 192.168.0.0/16 ipset –add bogons 0.0.0.0/8 ipset –add bogons 169.254.0.0/16 ipset –add bogons 172.16.0.0/12 ipset –add bogons 192.0.2.0/24 ipset –add bogons…

MySQL initial run

This serves to remind me how to initialise a new MySQL installation, if it doesn’t happen automatically. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password ‘new-password’ /usr/bin/mysqladmin -u root -h password ‘new-password’ Alternatively you can run:…

Fix font path for gnuplot

In the console enter: In my gnuplot (bash) scripts I have: export GDFONTPATH=”/usr/share/fonts/truetype/ttf-dejavu/” export GNUPLOT_FONTPATH=”/usr/share/fonts/truetype/ttf-dejavu/” Other methods: export GDFONTPATH=”/your/font/directory/fonts/” before you start gnuplot. The fonts should be in the folder “/fonts”. To make this persistent across reboots, and to set the paths for fonts in postscript terminal, add lines similar to the ones below to…

Identify and replace a failed disk in Linux RAID

1 Preliminary Note In this example I have two hard drives, /dev/sda and /dev/sdb, with the partitions /dev/sda1 and /dev/sda2 as well as /dev/sdb1 and /dev/sdb2. /dev/sda1 and /dev/sdb1 make up the RAID1 array /dev/md0. /dev/sda2 and /dev/sdb2 make up the RAID1 array /dev/md1. /dev/sda1 + /dev/sdb1 = /dev/md0 /dev/sda2 + /dev/sdb2 = /dev/md1 /dev/sdb…

Some useful Linux commands

Rename files / folders with spaces: IFS=$’\n’;for f in `find .`; do file=$(echo $f | tr [:blank:] ‘_’); [ -e $f ] && [ ! -e $file ] && mv “$f” $file;done;unset IFS Rsync: rsync -r -a -v rsync://ns2/storage/www-srv /storage/ ^^^ from ns2 to new host – (run on new host) Rsync (local to remote)…