Skip to content

Instantly share code, notes, and snippets.

View rixrix's full-sized avatar
👋
hi!

Richard Sentino rixrix

👋
hi!
  • Auckland, New Zealand
  • 01:26 (UTC -12:00)
View GitHub Profile
@rixrix
rixrix / MS Access image extractor
Last active December 14, 2015 07:48
A simple script that will extract image(s) from MS Access DB exported as XML file. It uses XMLReader basically to extrac big XML files. Tested on 1.11GB file size
#!/usr/bin/env php
<?php
/**
* Here's a little script that will extract images from MS Access DB exported as XML file.
* It uses XMLReader basically to extract big XML files. Tested on 1.11GB file size
*/
function xmlparser($file, $saveTo = '') {
$wrapperName = 'Photo';
@rixrix
rixrix / .DS_Store destroyer
Created April 24, 2013 23:55
.DS_Store destroyer
sudo find / -name ".DS_Store" -depth -exec rm {} \;
@rixrix
rixrix / deploy.rb
Created April 29, 2013 11:56
FIX for Capistrano's SSH error "Net::SSH::AuthenticationFailed error". This is a common error that you might encounter when working with Capistrano from one environment to another especially if Capistrano is configured to deploy on a password-less authentication.
#
# FIX for Capistrano's SSH error "Net::SSH::AuthenticationFailed error"
# This is a common error that you might encounter when working with Capistrano from one environment to another,
# especially if Capistrano is configured to deploy on a password-less authentication.
#
# The fix: specify the authentication eg. auth_methods
#
set :ssh_options, {:forward_agent => true, :auth_methods => 'publickey'}
@rixrix
rixrix / git-fetch-recursively.sh
Last active January 4, 2016 11:29
A dead simple, horribly easy mass Git repo updater. If you are not lazy, please move on - don't use this.
#!/bin/bash
# Checkout master, fetch origin and merge changes to master
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git checkout master && git fetch origin && git merge origin/master" \;
@rixrix
rixrix / iptables-open-webports-lazily.sh
Created January 28, 2014 20:44
A dead simple, horribly basic firewall (IPTables) rules to open various ports or web ports. If you're not lazy, move on and hit google.
#!/bin/bash
iptables --flush
# Open the following ports 80, 443, 8080 or add your own
iptables -A INPUT -p tcp -m tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 8080 -j ACCEPT
# Allow any outgoing requests
@rixrix
rixrix / dbus-fix.sh
Created February 3, 2014 00:26
Fix for D-Bus error when running Firefox in Xvfb. Make sure you have dbus package installed
#!/bin/bash
sudo dbus-uuidgen > /var/lib/dbus/machine-id
@rixrix
rixrix / selenium-firefox.txt
Created February 3, 2014 00:57
A horribly simple and working command line for launching Selenium + Firefox in Centos 6.4 . This command works for me as is
java -jar selenium-server-standalone-2.39.0.jar -htmlSuite "*firefox /usr/lib64/firefox/firefox-bin" "http://somedomain.com" "/path/to/TestSuite.html" "/path/to/test/results.html"
@rixrix
rixrix / install-alpine.sh
Created January 18, 2016 13:02
Install Alpine Linux inside xhyve
#!/bin/sh
KERNEL="vmlinuz-grsec"
INITRD="initramfs-grsec"
CMDLINE="alpine_dev=cdrom:iso9660 modules=loop,squashfs,sd-mod,usb-storage,sr-mod,earlyprintk=serial console=ttyS0"
MEM="-m 1G"
IMG_CD="-s 3,ahci-cd,alpine-3.2.3-x86_64.iso"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS