53 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: 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 .bashrc, which should be in your home folder. The exact directory structure differs…

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)…

Create and manage Linux volumes (LVM)

Create the physical volume: pvcreate /dev/sdb Create the Volume Group: vgcreate vg_backuppc_storage /dev/sdb Create the logical volume: lvcreate -l +100%FREE vg_backuppc_storage Create a filesystem on the logical volume: mkfs.ext4 /dev/vg_backuppc_storage/lvol0 Resize the physical volume: (need to unmount the LV before doing this) pvresize /dev/sdb Extend the volume: lvextend -l +100%FREE -r /dev/vg_backuppc_storage/lvol0 Mount your new…