Skip to content

Instantly share code, notes, and snippets.

@yusufhm
yusufhm / git-config-multiple-remotes
Created November 7, 2014 07:20
Add 'all' origin in git for pushing to multiple remotes
[remote "all"]
url = first@git.url
fetch = +refs/heads/*:refs/remotes/all/*
url = second@git.url
@yusufhm
yusufhm / .gitignore
Created November 7, 2014 07:24
Global .gitignore
.sass-cache
.idea
.elasticbeanstalk
yusuf-local
node_modules
# Compiled source #
###################
*.com
*.class
@yusufhm
yusufhm / syncthing.conf
Last active August 29, 2015 14:10
Ubuntu upstart script for syncthing
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 December 2, 2014 08:39
Windows VirtualBox AutoStart (Headless?)
"C:\Program Files\Oracle\VirtualBox\VBoxHeadless" -startvm "ubuntu-webserver-11.04-64" -p 3340
@yusufhm
yusufhm / nginx-rutorrent.enabled
Last active August 29, 2015 14:10
rutorrent nginx server
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 / php5-mods-available-custom.ini
Last active August 29, 2015 14:11
php custom config
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 / etc-init-rtorrent.conf
Created December 9, 2014 00:14
Ubuntu upstart script for rtorrent
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 December 9, 2014 00:48
Ubuntu upstart script for btsync
# btsync - Bittorent Sync
description "btsync - Keep Bittorent Sync running"
start on filesystem
stop on shutdown
respawn
expect fork
@yusufhm
yusufhm / iptables-firewall.sh
Last active August 29, 2015 14:11
Sample script for iptables firewall rules
#!/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 / drupal-fix-file-permissions.sh
Created January 15, 2015 23:45
Fix Drupal files permissions (credits to James Wilmot)
#!/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