This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debootstrap --arch=i386 --include=rrdtool stable /tmp/rrdtool-i386 && | |
mount --bind /var /tmp/rrdtool-i386/var && | |
find /var -mount -type f -name \*.rrd | | |
while read rrd; do | |
td=$(mktemp -d) | |
linux32 chroot /tmp/rrdtool-i386 rrdtool dump "$rrd" > $td/xml && | |
rrdtool restore $td/xml $td/rrd && | |
cp $td/rrd "$rrd" | |
rm $td/{xml,rrd} | |
rmdir $td |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# https-ssh-switch.pl: Turn on https → ssh redirect for the source IP of | |
# an http request. Allows you to dodge some aggressive firewalls resp. | |
# paywalls. | |
# Sample sudo rule: www-data ALL=(root) NOEXEC:NOPASSWD: /sbin/iptables -t nat -I PREROUTING -i [[\:alnum\:]]* -s [[\:digit\:].]* -p tcp --dport 443 -j REDIRECT --to-ports 22 | |
# 2014-02-10 Daniel Albers <[email protected]>, released under GPL license | |
# TODO: IPv6 support | |
use strict; | |
use warnings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
uname -a | |
modprobe -o bond0 bonding | |
ip link set eth0 up | |
ip li set bond0 up | |
ifenslave bond0 eth0 | |
ip link add link bond0 name vlan0 type vlan id 123 | |
ip link set vlan0 up | |
for i in eth0 bond0 vlan0; do echo ${i}:; ethtool -k ${i} | grep checksum; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
final class zx | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pa_host=pahostname.local | |
while IFS=": " read key value; do | |
export PULSE_${key^^}=$value | |
echo PULSE_${key^^}=$value | |
done < <(ssh -TNfL 4713:127.1:4713 "$pa_host" 'DISPLAY=:0 pax11publish -d') | |
"$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inf = open('backup.ab', 'rb') | |
out = open('backup.tar', 'wb') | |
buf = inf.read(512) | |
while buf != '': | |
if buf[:8] == 'TWRP\x00\x00\x00\x00': | |
print "Skipping %r" % buf[:16] | |
buf = inf.read(512) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Amazon: Remove Sponsored Items | |
// @license BSD-3-Clause | |
// @namespace https://gist.github.com/AlD/cd505481d2972be02ce246e5368b08e8 | |
// @updateURL https://gist.github.com/AlD/cd505481d2972be02ce246e5368b08e8/raw/amazon-remove-sponsored-items.user.js | |
// @downloadURL https://gist.github.com/AlD/cd505481d2972be02ce246e5368b08e8/raw/amazon-remove-sponsored-items.user.js | |
// @version 0.9.4 | |
// @description Amazon: Remove sponsored items in search results | |
// @author Daniel Albers <[email protected]> | |
// @match https://*.amazon.de/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Amazon Smile Redirect | |
// @license BSD-3-Clause | |
// @namespace https://gist.github.com/AlD/e288d567bc581c97f4a3a4bc1bf5d447 | |
// @updateURL https://gist.github.com/AlD/e288d567bc581c97f4a3a4bc1bf5d447/raw/amazon-smile-redirect.user.js | |
// @downloadURL https://gist.github.com/AlD/e288d567bc581c97f4a3a4bc1bf5d447/raw/amazon-smile-redirect.user.js | |
// @version 0.3.0 | |
// @description Redirect from regular Amazon to Amazon Smile | |
// @author Daniel Albers <[email protected]> | |
// @match https://www.amazon.de/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stop quasselcore | |
select pg_get_indexdef('sender_sender_realname_avatarurl_uindex'::regclass); | |
alter table backlog alter constraint backlog_senderid_fkey deferrable; | |
set session_replication_role = replica; | |
begin; | |
create or replace temp view foo | |
as select min.senderid min_senderid, other.* | |
from | |
(select min(senderid) senderid, sender, realname, avatarurl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sleep_cfg=/etc/systemd/sleep.conf.d/hibernate-reboot.conf | |
cleanup_cfg=/usr/lib/systemd/system-sleep/hibernate-reboot.sh | |
sudo mkdir -p "$(dirname "$sleep_cfg")" "$(dirname "$cleanup_cfg")" | |
sudo tee "$sleep_cfg" << '' | |
[Sleep] | |
HibernateMode=reboot |