Search Results

BASH – making tab completion case insensitive

This is very lazy, but comes in handy for example if your browsing a Windows mount with random uppercases in file/folder names. Add: make your tab completion case insensitive To your $HOME/.inputrc file (create the file if it doesn’t exist).  Alternatively you can make this userwide by adding it to /etc/inputrc . You might need […]

Using mod_proxy to avoid DNS propagation during site migration

There are a number of ways to migrate a site to a new server, whilst avoiding downtime or data concurrency issues. For a highly dynamic site, generally I would edit the old and new site connection strings to both use the same database during switchover.  mod_proxy is a useful method perhaps if a new version […]

Identifying apache process usage

When apache is running with php as an apache module rather than as a CGI, all processes will run as the apache user.  This makes it a little tricky on a busy multi-site box to identify which sites are using resources and keeping sessions open.  This little command will identify the working directory that the […]

Mounting Windows drives and shares in Linux

The following have come in handy for mounting a Windows share on a Linux computer: mount -t cifs -o username=user,password=password,umask=000 //winbox/winshare /mnt/home/ or smbmount //winbox/winshare /mnt/home/ -o username=user,password=password,rw An example of mounting a local NTFS partition held on the same machine: ntfsmount /dev/sda2 /mnt/windows -o umask=0002,silent

Yum Automatic Updates

You can install yum-cron to automatically download and install all available updates: yum install yum-cron chkconfig –list | grep yum – should show that the service is disabled chkconfig yum-cron on service yum-cron start Job Done – it will now check for and apply updates every night.  If its business critical solution though its probably […]

Random integers in BASH

Never really had a need for it before in BASH, but the following formula allows you to create random integers between two values: rnumber=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Useful for example to create random passwords that have a length within a set range. < /dev/urandom tr -dc A-Za-z0-9_$*?!.:=@#% | head -c$((RANDOM %4 +8))

Configuring MySQL over SSL for client connections

Useful for setting up encrypted connections between client and server.  Parts of this can be substituted if you wished to get a certificate issued from a trusted CA. 1. Check that SSL has been compiled in MySQL on the server: SHOW VARIABLES LIKE ‘have_openssl’; or mysql –ssl –help If it says disabled or yes then […]

Linux ip useful commands

ip -4 -o addr – nicely formatted list of IPv4 addresses on machine ip link show – shows the available interfaces on machine

Exchange 2007 – Renewing self signed SSL

If your running Exchange 2007 and you don’t really have the need for an SSL that’s issued by a valid CA, then you can just renew the self signed one that’s automatically generated on server build.  Most devices are happy to connect to an unsigned SSL once an exceptions been made, but they may well […]

Bulk DNS Query in Plesk

I put this command together to grab DNS information relating to all of the domains hosted on a Plesk server.  Useful if your migrating to a new server and need to know where to update the DNS zones.  This checks the nameservers but can easily be substituted with A or MX: for domain in $(mysql […]