Recursive grep + sed search and replace
One-liner recursive grep + sed search and replace for php or other file types: grep “subject” * -rl –include=*.php | xargs sed -i -e ‘s/subject/replacement/g’
One-liner recursive grep + sed search and replace for php or other file types: grep “subject” * -rl –include=*.php | xargs sed -i -e ‘s/subject/replacement/g’
This reg key will enable the ability to boot from MegaRAID storage devices using the megasys2.sys driver. Useful to run before hand when upgrading or otherwise changing hardware to something with a LSI 9260, 9271 or similar card. This reg key REQUIRES that you already have the correct megasas2.sys driver installed one way or another. […]
Recently I upgraded my remote office connection to 100Mbps (cable) and spent almost a month dealing with slow downloads over an openVPN client connection. Uploads were fine (maxing out the pipe) but downloads were 12-20 Mbps at best and fluctuating like crazy. TCP client mode actually performed better than UDP so I knew something was […]
I cooked up a Munin plugin for my Surfboard 6141 which monitors ALL available data from the status page. If you’re having intermittant signal issues and want to keep detailed data for cable technicians, this is for you! Check it out on Github: https://github.com/djamps/munin-surfboard6141
After facing issue after issue with Idera/R1soft’s PXE and CD-ROM boot media — specifically, ancient kernels which are unable to obtain network connectivity on modern hardware, I decided to roll my own PXE boot image including the R1soft agent and a few other tools with the latest Debian stable. It turned out to be easier […]
In order for grub to ‘see’ virtual disks, you have to tell it about them with the ‘device’ command: # grub grub> device (hd0) /dev/xvda grub> root (hd0,0) grub> setup (hd0) grub> quit Keep in mind, installing grub on the MBR is not always necessary with Xen PV guests, but is highly useful for V2P […]
Historically XenServer does not support software RAID out-the-box, and this is unchanged in the latest 6.2 release. We can convert it to RAID after installation. First we set up the 2nd disk by copying the partition tables whilst enabling a degraded RAID on it, then copy data over with custom initrd. sgdisk -R/dev/sdb /dev/sda # […]
On a new XenServer deployment EXT storage is default. Although EXT is nice (ability to manipulate raw VHD files and use sparse storage), LVM is faster and more stable. Here is how to switch between storage modes (be sure to back up all data first, as this will wipe everything in the repo): Use ‘xe […]
From time to time the du command doesn’t match up with df. This is due to deleted files that are still held open by a process. You can total the deleted but ‘still open’ file usage: lsof | awk ‘/deleted/ {sum+=$7} END {print sum}’ Or, to simply list all the files and their processes: lsof […]
Allows easy embedding of on-demand and live media from a Wowza server using Iframes and a PHP server capable of .htaccess rewrite rules. http://djlab.com/stuff/jwplayer.zip Example of embed code: <iframe src=”http://mysite.com/jwplayer/Sportswire/sw-584-1.mp4?autoPlay=0&poster=http://mysite.com/images/poster.jpg” frameborder=”0″ scrolling=”no” width=”432px” height=”320px”></iframe>