Skip to content

Instantly share code, notes, and snippets.

View tiernano's full-sized avatar

Tiernan OToole tiernano

View GitHub Profile
@tiernano
tiernano / gist:9c061ae8d1312190f152
Last active March 29, 2018 22:13
Hubic, Swift and CURL
Get Endpoint:
curl -H "Authorization: Bearer <AUTHCODE>" https://api.hubic.com/1.0/account/credentials
returns:
{"token":"<AUTHTOKEN>","endpoint":"https://lb1.hubic.ovh.net/v1/<AUTHURL>","expires":"2015-04-01T23:01:08+02:00"}
Get List of files:
# Inserting routes in the adsl1 table
ip route add 192.168.1.0/24 dev eth0 scope link table adsl1
ip route add default via 192.168.1.1 dev eth0 table adsl1
# Inserting routes in the adsl2 table
ip route add 192.168.2.0/24 dev eth0 scope link table adsl2
ip route add default via 192.168.2.1 dev eth0 table adsl2
# ip rule is the source routing magic. This will redirect
# packets coming from source "X" to table "adsl1", "adsl2" or "default".
@tiernano
tiernano / export.rb
Created May 7, 2015 18:59
export from Route53 to bind files
cli53 = '/usr/bin/cli53'
zones_on_aws = `#{cli53} list`.lines.select{|e| e =~ /Name/ }.map{|e| e.split(":").last.strip.sub(/\.$/, '') }
zones_on_aws.each do | zone |
puts "#{zone}..."
system("#{cli53} export #{zone} > #{zone}.bind")
end
@tiernano
tiernano / gist:86ab2e08ba4e588a343a
Created April 1, 2015 07:33
hubic config for duplicity
[hubic]
email = <hubicemailaddress>
password = <hubicpassword>
client_id = <hubicclientid>
client_secret = <hubicclientsecret>
redirect_uri = http://localhost/
@tiernano
tiernano / gist:3958472
Created October 26, 2012 12:20
Squid Upstream Proxy with WAN Proxy
cache_peer 127.0.0.1 parent 3300 0 no-query no-digest
never_direct allow all
---
- hosts: netdata
vars:
repo: https://github.com/firehol/netdata.git
tmpdir: /tmp/netdata
ndbin: /usr/local/sbin/netdata
ndinstaller: ./netdata-installer.sh --dont-wait
remote_user: root
tasks:
- name: install prereqs
iptables -t nat -A POSTROUTING -o eth0 -s <internalIP> -j SNAT --to-source <externalip>
iptables -t nat -A PREROUTING -i eth0 -d <externalip> -j DNAT --to-destination <internalip?
iptables -A FORWARD -s <externalip> -j ACCEPT
iptables -A FORWARD -d <internalip> -j ACCEPT
<?php
// Local server settings
// Local Database
define('DB_NAME', 'client');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');
// Overwrites the database to save keep edeting the DB
@tiernano
tiernano / gist:4655956
Created January 28, 2013 14:33
config required for Loggly NLog Target: https://github.com/tiernano/LogglyNLoggerTarget/
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="LogglyTarget"/>
</extensions>
<targets>
<target name="Loggly" xsi:type="Loggly" URL="<EnterYourLogglyURLHere>" bufferNumber="5" shouldBuffer="true"/>
</targets>
@tiernano
tiernano / disableVNC.sh
Created November 29, 2012 16:23
Disable VNC on OSX though Command Line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off