Skip to content

Instantly share code, notes, and snippets.

View rubenerd's full-sized avatar

Ruben Schade rubenerd

View GitHub Profile
@rubenerd
rubenerd / vyos-for-vyatta.sh
Created October 24, 2014 07:02
Install VyOS repo on Vyatta
#!/bin/vbash
## Script to install VyOS community repos on Vyatta
source /opt/vyatta/etc/functions/script-template
delete system package repository community
set system package repository community components 'main'
set system package repository community distribution 'hydrogen'
set system package repository community url 'http://mirror.vyos-users.jp/vyos'
commit
@rubenerd
rubenerd / wget-symlink.sh
Last active August 29, 2015 14:08
Protect oneself from wget's symlink attack
@rubenerd
rubenerd / qcow2-hvm.cfg
Created November 3, 2014 07:16
Using qcow2 images in Xen 4.1 on Debian
disk = ['tap:qcow2:/path/disk.qcow2,xvda,w']
@rubenerd
rubenerd / intstring.py
Created November 8, 2014 23:51
Basic Python string to int, and back
#!/usr/bin/env python
spam = 42
eggs = "24"
## "Casting" form ints and strings
ingredients = spam + int(eggs)
menu = str(spam) + eggs
## Alternative using str method
@rubenerd
rubenerd / debian-fah.sh
Last active August 29, 2015 14:09
Basic Debian FAH cloud instance
#!/bin/sh
## Build a basic headless Debian Folding@Home 7.4.4 cloud instance
## F*** Bitcoin, this is more important
SOURCE="https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb"
## Install and update basics
apt-get update
apt-get dist-upgrade
@rubenerd
rubenerd / replace-folder-terms.sh
Created November 17, 2014 03:14
Find and replace terms in folder of files
## BSD
find ./ -type -f -exec sed -i -e '' 's/something/else' {} \;
## GNU
find ./ -type -f -exec sed -i -e 's/something/else' {} \;
@rubenerd
rubenerd / packer-debian.sh
Created November 20, 2014 23:35
Install binary Packer on Debian
#!/bin/sh
destination="/usr/local/packer"
latest="0.7.2"
mkdir -P ${destination}
cd ${destination}
curl -OL "https://dl.bintray.com/mitchellh/packer/packer_${latest}_linux_amd64.zip"
unzip packer_${latest}_linux_amd64.zip
rm $packer_${latest}_linux_amd64.zip
@rubenerd
rubenerd / rtorrent
Last active January 17, 2016 09:45 — forked from Grogdor/rtorrent
#!/bin/sh
#
# $FreeBSD$
#
# Runs as unprivileged user "rtorrent"
# Lives in "tmux" (like "screen") because rtorrent can't daemonize itself
# To access rtorrent client that's in the tmux: su - rtorrent && tmux attach
# To detach the tmux and leave rtorrent running: Ctrl-B then D
# nice'd default +10 step to make it go easy on the machine
# Don't forget to put rtorrent_enable="YES" in your /etc/rc.conf
@rubenerd
rubenerd / memtest86-usb.sh
Last active January 2, 2018 10:10
Quick USB bootable MemTest86
#!/bin/sh
## No need for horrible GUI bootable USB key generators
## Haven't seen if there's a memtest86+ equiv
key="/dev/sdb" ## TRIPLE CHECK this drive location first
curl -OL "http://www.memtest86.com/downloads/memtest86-usb.tar.gz"
tar xzvf memtest86-usb.tar.gz
@rubenerd
rubenerd / ubuntu-xen-44.sh
Created November 27, 2014 23:36
Bootstrap Ubuntu Xen 4.4 Dom0
#!/bin/sh
## Bootstrap simple Xen Dom0 with:
## - Bridged networking, LAN DHCP
## - SSH tunneled VNC access for DomUs
## - Using Ubuntu instead of Debian for Xen 4.4
## Elevate and update
sudo -s
apt-get update