Skip to content

Instantly share code, notes, and snippets.

View fud's full-sized avatar

Brenton Bills fud

  • Paypa Plane
  • Brisbane, Australia.
  • 18:13 (UTC +10:00)
View GitHub Profile
@fud
fud / replace.sed
Created August 8, 2016 01:00
replace spaces with sed
billsb@Brentons-MacBook-Pro ~ $ more brent.js
function test():
this;
is;
a test;
billsb@Brentons-MacBook-Pro ~ $ sed 's/[[:space:]]\{4,\}/ /g' brent.js
function test():
this;
is;
a test;
@fud
fud / subnets.txt
Created August 4, 2016 01:25
Subnets using jq.
#echo $subnets | jq '.Subnets | .[] | .AvailabilityZone + ":" + (.Tags[]|select(.Key=="Name")|.Value |tostring) + ":" + .SubnetId'
#echo $subnets | jq -r '.Subnets | .[] | "[\"" + .AvailabilityZone + "\"]=" + .SubnetId'
@fud
fud / iptables.txt
Created August 2, 2016 23:25
docker iptables
ubuntu@dm1a:/etc/network/interfaces.d$ sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DOCKER all -- anywhere anywhere ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
@fud
fud / docker-compose.el
Last active July 23, 2016 07:56
Docker compose in a ansi-term
(defun open-project-docker-compose ()
(interactive)
(let ((current-ansi-window (get-buffer-window "*ansi-term*")))
(select-window current-ansi-window)
(split-window)
(ansi-term "/bin/zsh" "docker-compose")
(comint-send-string "*docker-compose*" "cd /Users/billsb/code/keymaker\n")
(comint-send-string "*docker-compose*" "docker-compose exec keymaker /bin/sh\n")
(message "Split window %s" current-ansi-window)))
@fud
fud / gist:ecafd564060d962c944190a2dbbff8e6
Created July 16, 2016 05:21
Route a particular address over vpn
sudo /sbin/route add -host xxx.xxx.com -interface ppp0
@fud
fud / restart.txt
Created July 16, 2016 05:11
synology restart dnsmasq
sudo restart pkgctl-dnsmasq
@fud
fud / config.md
Created July 14, 2016 00:04
alias to set email for a github project

Set a global alias like a bash alias that can set an email address for a project.

alias.homeprofile=config user.email "x.x@gmail.com"

Then @ work when I want to commit something to my home github project.

cd ~/git-project
git homeprofile
@fud
fud / nzbdrone.conf
Created June 24, 2016 06:15
Sonar Upstart Script for Synology DSM 6.0. Put it in /etc/init. Then execute start nzbdrone as root
description "NZB Drone"
author "Brenton Bills"
start on syno.share.ready
stop on runlevel [06]
setuid nzbdrone
env PATH=${MONO_PATH}:${PATH}
@fud
fud / fix.sh
Last active June 7, 2016 01:18
Script to update docker-machine config paths which are hardcoded. Needs jq installed which can be installed with home brew.
#!/usr/bin/env bash
for config in ~/.docker/machine/machines/*/config.json; do
echo Fixing $config to refer to your user.
echo Backup at $config.orig
cp $config $config.orig
jq --arg user $USER -f users.jq $config > $config.fixed
mv $config.fixed $config
echo "Done"
done
geoposition_from_site = indexes.BooleanField()
./code/apncore/notices/search_indexes.py
has_photo_gallery = indexes.BooleanField(model_attr='has_photo_gallery', indexed=False)
hide_place_address = indexes.BooleanField(model_attr='hide_place_address', indexed=False)
owned = indexes.BooleanField(model_attr='owned', indexed=False)
./code/bd/listing/search_indexes.py
for_sale_valid = indexes.BooleanField(model_attr='for_sale_valid')
./code/finda/media/search_indexes.py
ad_show_on_map = indexes.BooleanField(model_attr='show_on_map')
featured = indexes.BooleanField(model_attr='featured', indexed=True, default=None)