Skip to content

Instantly share code, notes, and snippets.

View chrisnharvey's full-sized avatar

Chris Harvey chrisnharvey

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chrisnharvey on github.
  • I am chrisnharvey (https://keybase.io/chrisnharvey) on keybase.
  • I have a public key whose fingerprint is 0B5B 154A 0538 BD35 7EE5 8189 024E 65A3 F7E9 2A36

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am chrisnharvey on github.
* I am chrisnharvey (https://keybase.io/chrisnharvey) on keybase.
* I have a public key whose fingerprint is A631 2570 CD95 C5B8 110D 256E 44D0 E775 F45F 2EE1
To claim this, I am signing this object:
#!/bin/bash
rm -rf ~/.climb
mkdir ~/.climb
epiphany -a http://example.com --profile ~/.climb >/dev/null 2>&1 &
sleep 60s;
wmctrl -r :ACTIVE: -b remove,maximized_vert; wmctrl -r :ACTIVE: -b remove,maximized_horz; wmctrl -r :ACTIVE: -e 0,0,0,674,768
sleep 10s;
wmctrl -r :ACTIVE: -e 0,-2,-31,2200,1100
#!/bin/bash
LOGFILE="/var/log/clamav/clamav-$(date +'%Y-%m-%d').log";
EMAIL_MSG="Please see the log file attached.";
EMAIL_FROM="server1@xxx.com";
EMAIL_TO="servers@xxx.co.uk";
DIRTOSCAN="/srv";
for S in ${DIRTOSCAN}; do
DIRSIZE=$(du -sh "$S" 2>/dev/null | cut -f1);
@chrisnharvey
chrisnharvey / webtorrent-test.js
Created February 25, 2016 21:03
Webtorrent test
var WebTorrent = require('webtorrent')
var fs = require('fs')
var client = new WebTorrent()
var magnetURI = 'test.torrent'
client.download(magnetURI, function (torrent) {
// Got torrent metadata!
console.log('Torrent magnet link:', torrent.magnetURI)
@chrisnharvey
chrisnharvey / chroot.sh
Created October 7, 2015 23:08
Arch Linux Install Script
#!/bin/bash
locale-gen
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
pacman -S --noconfirm grub-bios
grub-install /dev/sda
@chrisnharvey
chrisnharvey / deploy.sh
Created July 8, 2014 19:49
Sculpin deploy script
#!/bin/bash
if [ "${VARIABLE}" = "1" ]; then
echo "This is a pull request, nothing to deploy"
exit
fi
echo skulpin-test.chrisnharvey.com > ./output_prod/CNAME
cd ./output_prod
@chrisnharvey
chrisnharvey / solr
Created May 4, 2014 12:55
Solr init.d script
#!/bin/sh
# Starts, stops, and restarts Apache Solr.
#
# chkconfig: 35 92 08
# description: Starts and stops Apache Solr
SOLR_DIR="/var/solr"
JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=mustard -jar start.jar"
LOG_FILE="/var/log/solr.log"
@chrisnharvey
chrisnharvey / install_composer
Created January 22, 2014 13:04
Global composer installer
#!/usr/bin/env bash
curl -sS https://getcomposer.org/installer | php -- --install-dir=/tmp
/tmp/composer.phar global require composer/composer
echo '# Composer' >> ~/bash_profile
echo 'export PATH=~/.composer/vendor/bin:$PATH' >> ~/.bash_profile
rm /tmp/composer.phar
echo 'Composer installed globally.'
echo "You can now install global packages by running 'composer global require vendor/package'"
@chrisnharvey
chrisnharvey / gist:7717051
Created November 30, 2013 09:35
wxphp XRC demo
<?php
class myApp extends wxApp
{
function pushBut()
{
exit('sdfsdf');
}
function OnInit()
{