Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tim Meusel bastelfreak

🏠
Working from home
View GitHub Profile
View gist:8832262
#!/bin/bash
get_html_title (){
curl --silent "${1}" | awk -vRS="</title>" '/<title>/{gsub(/.*<title>|\n+/,"");print;exit}'
}
get_html_title $1
View gist:7dc16b618c9c9d0450a7
UPDATE
`media_movies`
SET
`media_movies`.`tmdb_id` = '86838' ,
`media_movies`.`release` = '2012-10-12' ,
`media_movies`.`average_vote` = '6.2' ,
`media_movies`.`original_title` = 'Seven Psychopaths' ,
`media_movies`.`poster_path` = 'http://image.tmdb.org/t/p/w500/3Zs6Ne6QAEOzQRz85VToH8ml6ab.jpg'
WHERE
`media_movies`.`title` = '7 Psychos';
View gist:4080578
host03 ~ # tail /var/log/archipel/archipel.log -n 1
WARNING ::2012-11-15 20:12:15::utils.py:68::TNArchipelHypervisor.connect_xmpp (admin@host03.bastelfreak.org/host03.bastelfreak.org)::Unable to connect to XMPP server. Waiting 5 seconds for reconnection
host03 ~ # grep xmpp_server /etc/archipel/archipel.conf
xmpp_server = host03.bastelfreak.org
xmpp_pubsub_server = pubsub.%(xmpp_server)s
archipel_root_admins = admin@%(xmpp_server)s
hypervisor_xmpp_jid = admin@%(xmpp_server)s
xmlrpc_host = %(xmpp_server)s
host03 ~ #
View gist:4080697
host03 ~ # /etc/init.d/archipel restart
* Stopping Archipel: [OK]
* Starting Archipel: [OK]
host03 ~ # tail /var/log/archipel/archipel.log -n 1
WARNING ::2012-11-15 20:32:18::utils.py:68::TNArchipelHypervisor.connect_xmpp (admin@host03.bastelfreak.org/host03.bastelfreak.org)::Unable to connect to XMPP server. Waiting 5 seconds for reconnection
host03 ~ # egrep "hypervisor_xmpp_jid|hypervisor_name" /etc/archipel/archipel.conf
hypervisor_xmpp_jid = admin@%(xmpp_server)s
hypervisor_name = bastel-test
host03 ~ #
View bad_foo_spec.rb
# This basically tests that Puppet works.
describe 'foo' do
let(:params) { :param => 'somevalue' }
it do
should contain_file('bar').with({
:ensure => present,
:owner => root,
:group => root,
:mode => 0644,
View gist:36a382ee66d262d8f2ca
LABEL archrescue
MENU LABEL Arch Linux Live Rescue
KERNEL http://10.30.7.40/archrescue/arch/boot/x86_64/vmlinuz
INITRD http://10.30.7.40/archrescue/arch/boot/x86_64/intel_ucode.img
INITRD http://10.30.7.40/archrescue/arch/boot/x86_64/archiso.img
APPEND archiso_http_srv=http://10.30.7.40/archrescue/ archisobasedir=arch checksum=y nomodeset quiet systemd.mask=systemd-machine-id-commit systemd.mask=systemd-tmpfiles-setup systemd.mask=ldconfig
SYSAPPEND 3
View gist:7563053
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 && cd $(basename "$1" .tar.bz2) ;;
*.tar.gz) tar xvzf $1 && cd $(basename "$1" .tar.gz) ;;
*.tar.xz) tar Jxvf $1 && cd $(basename "$1" .tar.xz) ;;
*.bz2) bunzip2 $1 && cd $(basename "$1" /bz2) ;;
*.rar) unrar x $1 && cd $(basename "$1" .rar) ;;
*.gz) gunzip $1 && cd $(basename "$1" .gz) ;;
*.tar) tar xvf $1 && cd $(basename "$1" .tar) ;;
View gist:7563089
<network>
<name>internet</name>
<uuid>37b888cc-510f-46f1-9246-346da96222ed</uuid>
<forward dev='enp5s0f0' mode='route'>
<interface dev='enp5s0f0'/>
</forward>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address='52:54:00:13:39:d5'/>
<ip family='ipv6' address='2a01:4f8:11a:b00::2' prefix='64'>
</ip>
View gist:7565304
16:37:49.594205 IP6 2a01:4f8:11a:b01::1 > 2a01:4f8:11a:b00::2: ICMP6, echo request, seq 1, length 64
16:37:49.594261 IP6 2a01:4f8:11a:b00::2 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2a01:4f8:11a:b00::2, length 32
16:37:50.590832 IP6 2a01:4f8:11a:b00::2 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2a01:4f8:11a:b00::2, length 32
16:37:51.590829 IP6 2a01:4f8:11a:b00::2 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2a01:4f8:11a:b00::2, length 32
16:37:54.605739 IP6 fe80::5054:ff:fe5a:d830 > 2a01:4f8:11a:b00::2: ICMP6, neighbor solicitation, who has 2a01:4f8:11a:b00::2, length 32
16:37:54.605774 IP6 2a01:4f8:11a:b00::2 > fe80::5054:ff:fe5a:d830: ICMP6, neighbor advertisement, tgt is 2a01:4f8:11a:b00::2, length 24
16:37:59.610834 IP6 fe80::5054:ff:fe13:39d5 > fe80::5054:ff:fe5a:d830: ICMP6, neighbor solicitation, who has fe80::5054:ff:fe5a:d830, length 32
16:37:59.611026 IP6 fe80::5054:ff:fe5a:d830 > fe80::5054:ff:fe13:39d5: ICMP6, neighbor advertisement, tgt is fe80::5054:ff:fe5
View gist:7565479
HOST:
fe80::5054:ff:fe90:7bfb dev virbr1 lladdr 52:54:00:90:7b:fb STALE
2a01:4f8:11a:b00::1 dev virbr1 FAILED
fe80::5054:ff:fe5a:d830 dev virbr1 lladdr 52:54:00:5a:d8:30 REACHABLE
2a01:4f8:11a:b00::1 dev enp5s0f0 lladdr 00:21:59:c1:53:d1 router REACHABLE
fe80::5054:ff:fe60:f7b1 dev virbr1 lladdr 52:54:00:60:f7:b1 STALE
fe80::5054:ff:fe62:6e2 dev virbr1 lladdr 52:54:00:62:06:e2 STALE
fe80::5054:ff:fe80:20f2 dev virbr1 lladdr 52:54:00:80:20:f2 STALE
2a01:4f8:11a:b01::1 dev virbr1 lladdr 52:54:00:5a:d8:30 STALE
fe80::5054:ff:fe8e:b13c dev virbr1 lladdr 52:54:00:8e:b1:3c STALE