Skip to content

Instantly share code, notes, and snippets.

View tiernano's full-sized avatar

Tiernan OToole tiernano

View GitHub Profile
; <<>> DiG 9.10.6 <<>> 1.67.186.185.in-addr.arpa PTR
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42465
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;1.67.186.185.in-addr.arpa. IN PTR
#!/bin/sh
USER=<serverusername>
PASS=<serverpassword>
HOST=<serverip>
COOKIE=`curl -k --data "WEBVAR_USERNAME=$USER&WEBVAR_PASSWORD=$PASS" https://$HOST/rpc/WEBSES/create.asp 2> /dev/null | grep SESSION_COOKIE | cut -d\' -f 4`
curl -k --cookie Cookie=SessionCookie=$COOKIE https://$HOST/Java/jviewer.jnlp -o $HOST.jviewer.jnlp
javaws $HOST.jviewer.jnlp
---
- 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
# 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".

Keybase proof

I hereby claim:

  • I am tiernano on github.
  • I am tiernano (https://keybase.io/tiernano) on keybase.
  • I have a public key whose fingerprint is BAAE 36B5 95BA F1FE 68A6 DE86 DDB1 22F7 277D 9175

To claim this, I am signing this object:

tiernano@godboxv2-1 ~/Downloads $ dd if=/dev/zero of=slack bs=1024000 count=10240
10240+0 records in
10240+0 records out
10485760000 bytes (10 GB) copied, 17.0886 s, 614 MB/s
tiernano@godboxv2-1 ~/Downloads $ dd if=slack of=/dev/null bs=1024000
10240+0 records in
10240+0 records out
10485760000 bytes (10 GB) copied, 1.97896 s, 5.3 GB/s
@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: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: