Skip to content

Instantly share code, notes, and snippets.

@yusufhm
yusufhm / .gitignore
Created Nov 7, 2014
Global .gitignore
View .gitignore
.sass-cache
.idea
.elasticbeanstalk
yusuf-local
node_modules
# Compiled source #
###################
*.com
*.class
@yusufhm
yusufhm / git-config-multiple-remotes
Created Nov 7, 2014
Add 'all' origin in git for pushing to multiple remotes
View git-config-multiple-remotes
[remote "all"]
url = first@git.url
fetch = +refs/heads/*:refs/remotes/all/*
url = second@git.url
@yusufhm
yusufhm / syncthing.conf
Last active Aug 29, 2015
Ubuntu upstart script for syncthing
View syncthing.conf
description "Syncthing P2P sync service"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
env STNORESTART=yes
env HOME=/home/demouser
setuid "demouser"
setgid "demouser"
@yusufhm
yusufhm / vmstart-webserver.bat
Created Dec 2, 2014
Windows VirtualBox AutoStart (Headless?)
View vmstart-webserver.bat
"C:\Program Files\Oracle\VirtualBox\VBoxHeadless" -startvm "ubuntu-webserver-11.04-64" -p 3340
@yusufhm
yusufhm / nginx-rutorrent.enabled
Last active Aug 29, 2015
rutorrent nginx server
View nginx-rutorrent.enabled
server {
listen 80;
server_name some.server.name;
root /home/ubuntu/websites/rutorrent;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
allow 10.9.0.0/24;
@yusufhm
yusufhm / iptables-firewall.sh
Last active Aug 29, 2015
Sample script for iptables firewall rules
View iptables-firewall.sh
#!/bin/bash
#Bridge config
#for f in /proc/sys/net/bridge/bridge-nf-*; do echo 0 > $f; done
#Flush all before applying new rules
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
@yusufhm
yusufhm / etc-init-rtorrent.conf
Created Dec 9, 2014
Ubuntu upstart script for rtorrent
View etc-init-rtorrent.conf
description "Run a persistent rtorrent within screen"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
env LANG=en_US.utf8
env HOME=/home/ubuntu
setuid ubuntu
setgid ubuntu
@yusufhm
yusufhm / etc-init-btsync.conf
Created Dec 9, 2014
Ubuntu upstart script for btsync
View etc-init-btsync.conf
# btsync - Bittorent Sync
description "btsync - Keep Bittorent Sync running"
start on filesystem
stop on shutdown
respawn
expect fork
View php5-mods-available-custom.ini
cgi.fix_pathinfo = 0;
realpath_cache_size = 256k;
realpath_cache_ttl = 300;
max_execution_time = 120;
max_input_time = 120;
memory_limit = 192M;
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
post_max_size = 30M
upload_max_filesize = 30M
date.timezone = Australia/Sydney
@yusufhm
yusufhm / drupal-fix-file-permissions.sh
Created Jan 15, 2015
Fix Drupal files permissions (credits to James Wilmot)
View drupal-fix-file-permissions.sh
#!/bin/bash
#
# A script to fix file permissions in the given
# files directory for drupal
#
# Usage:
# - set files directory variable to point at the files
# drupal installation files directory
# - run script