Categories Archives: Uncategorized

.htaccess force SSL (AutoSSL safe)

The following is safe to use on Cpanel/WHM with AutoSSL enabled. RewriteEngine On RewriteCond %{HTTPS} !on RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

JunOS (MX) Cheat Sheet

BGP Commands BGP Summary (IPv4 and IPv6): show bgp summary BGP Received routes (shows routes BEFORE filtering? Always check local routing table): show route receive-protocol bgp <neighbor> BGP Sent routes: show route advertising-protocol bgp <neighbor> Shut/unshut a BGP peer <set|delete> protocols bgp <group> neighbor <neighbor> shutdown Reload inbound routes clear bgp neighbor soft-inbound <neighbor|all> Reload […]

Categories: Uncategorized. Comments Off on JunOS (MX) Cheat Sheet

Starting a temporary MySQL instance for table/DB recovery

In this example we assume a restored backup of mysql’s datadir exists at /mnt/restore/mysql. mysqld –port=3307 –socket=/mnt/restore/mysql/tmp.sock –datadir=/mnt/restore/mysql –pid-file=/mnt/restore/mysql/ –user=mysql If the backups are ‘dirty’ and innoDB corruption won’t let it start, you can try –innodb-force-recovery=N if needed (start with N = 1 and go up to 4 as neccesary). If the instance was part […]

Categories: Uncategorized. Comments Off on Starting a temporary MySQL instance for table/DB recovery

XenServer recovery – XAPI won’t start

If running XenServer on a RAID array with writeback (controller cache) enabled and no battery backup, don’t lose power. If you do, you will discover the state.db is corrupt and XAPI fails to start. Everything is down, Dom0 lost it’s network config, you’re screwed. Maybe. This tutorial assumes you’ve got a metadata backup, all your […]

Windows Vista through Windows 10 Boot Repair

After cloning a larger HDD to a smaller SSD, you will most likely face a blinking cursor or other boot issues.   The following steps should get you back on track from a rescue command prompt: bootrec.exe /fixmbr bootsect.exe /nt60 all /force bootrec.exe /rebuildbcd If you are getting integrity check errors on winload.exe, you can try […]

Categories: Uncategorized. Comments Off on Windows Vista through Windows 10 Boot Repair

Grub with Xen Guests

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 […]

Categories: Uncategorized. Comments Off on Grub with Xen Guests

XenServer 6.2 with Software RAID

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 # […]

JWplayer iframe codes for Wowza

Allows easy embedding of on-demand and live media from a Wowza server using Iframes and a PHP server capable of .htaccess rewrite rules. Example of embed code: <iframe src=”” frameborder=”0″ scrolling=”no” width=”432px” height=”320px”></iframe>

Removing RAID metadata

Sometimes a hardware RAID controller or fakeraid (BIOS) can leave metadata that makes it impossible to install Windows or Linux, or it installs correctly, but causes a kernel panic or a 0xb7 blue screen error on the first boot. The only method I could find to delete the metadata *quickly* is to zero out the […]