Skip to content

Instantly share code, notes, and snippets.

View gjedeer's full-sized avatar
💭
Fucking kittens

GDR! gjedeer

💭
Fucking kittens
View GitHub Profile
@gjedeer
gjedeer / htc.kmap
Created May 2, 2019 21:18
Linux console keymap for HTC Vision / Desire Z
keymaps 0-15
keycode 1 = Escape Escape
alt keycode 1 = Meta_Escape
keycode 2 = one exclam
alt keycode 2 = Meta_one
control alt keycode 2 = 0x0085
keycode 3 = two at at
control keycode 3 = nul
shift control keycode 3 = nul
alt keycode 3 = Meta_two
@gjedeer
gjedeer / pgpKeySelection.java
Last active October 19, 2018 20:30
BouncyCastle OpenPGP proper key selection for encryption
/* Given an ASCII armored key, returns a subkey that's suitable for encryption and, possibly, non-expired */
private PGPPublicKey getPublicKey() throws PGPException {
final String pgpKey = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBE0UsbQBEADKSKYA6kdyEYWPuaES5VTV7jR/Eazz4UGCTTYBlDhY2qlu/WTW\njmQmSTCImERBb8rN2DijT3oZaOA+UTdKcWM13IB3Cgebk8p1kKrucqblDDZXz9Jc\n3RLrrH0NFTmT4ElgHIH4T08Vfk72Cz8G+xPo7HQ8V1UO0TQMjbmu0iyRPbnNuYN2\nYVC9mPss1ZLHp1hKOd1lKHWdqK3O9JhaFje30NGzBcvvbbBgFt09DbK4P2aFXJpb\nauOlgJJQW8Z8j6Z/Cq1lV3PtPQtGDHVAMZKMZjit8qkFMUBNPlAy94UcgjsDk4kt\nWKE9CxBSMbPYVHfO6X0ojyZQtaIx8zuI8qvLsIwLF+uVVwVN0xAm7/fexzKeoa3g\nWAxp86Oq2xD9GbNTRbPtIf1cEAkTx9TgEMfPBtXtxlHxpQs3nAnDulH/8TNBy0JY\ntzUDF+uVHbgp2wjDU96qb5h4jtrFaxReXBLfkwvc8qp9A+1xFIrdXVzIbx87e5Gk\nOPjwotHNJKx1gSUjpxJTi1LwRNoWrBAVgRmOaVryCNc9jtW3KlKaXFTC4oU/upsy\nm+qUXK3bs7QdQA7CxC/rQz0G7nEX3HKfjZ8mbfnT2J9lGy/Fe8SklyFvMX5LPFkC\nHGBR1Y4KBLncqQjBybR7ozYyPg8d0CGZxUmqPnh/YDplPkX82OeJWfjrrQARAQAB\ntBRHRFIhXyA8Z2RyQGdkci5uYW1lPokCOgQTAQIAJAIbAwIeAQIXgAIZAQUCWoVD\

Keybase proof

I hereby claim:

  • I am gjedeer on github.
  • I am gdr (https://keybase.io/gdr) on keybase.
  • I have a public key whose fingerprint is 11C1 B15A 5D5D D662 E469 928A EBDA 6B97 4ED3 D2B7

To claim this, I am signing this object:

@gjedeer
gjedeer / mibox-firewall.sh
Created September 8, 2017 17:38
Prevent Xiaomi MiBox Pro 3 from spying on you (and downloading doubtious updates). Obtained from a wireshark session with MiBox not playing anything. Yes: 76 IP addresses.
MIBOX_IP=192.168.1.91
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 103.235.47.89 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 104.16.228.14 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 104.16.230.14 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 111.206.200.12 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 111.206.200.2 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 111.206.37.190 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 114.54.23.26 -j REJECT
/usr/sbin/iptables -A wanout -s $MIBOX_IP -d 120.134.33.8 -j REJECT
@gjedeer
gjedeer / hosts
Created September 8, 2017 13:36
MiBox 3 pro call home block list
127.0.0.1 111.94.62.42.in-addr.arpa
127.0.0.1 12.200.206.111.in-addr.arpa
127.0.0.1 171.176.77.52.in-addr.arpa
127.0.0.1 196.170.220.52.in-addr.arpa
127.0.0.1 48.183.251.54.in-addr.arpa
127.0.0.1 57.94.62.42.in-addr.arpa
127.0.0.1 78.204.243.124.in-addr.arpa
127.0.0.1 8.33.134.120.in-addr.arpa
127.0.0.1 a.netcheck.gallery.pandora.xiaomi.com
127.0.0.1 api.ad.xiaomi.com
05-30 19:55:19.451 1247 1247 W : debuggerd: handling request: pid=5904 uid=10079 gid=10079 tid=5904
05-30 19:55:19.509 5947 5947 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-30 19:55:19.509 5947 5947 F DEBUG : Build fingerprint: 'google/sdk_google_phone_x86/generic_x86:7.0/NYC/3761695:userdebug/dev-keys'
05-30 19:55:19.509 5947 5947 F DEBUG : Revision: '0'
05-30 19:55:19.509 5947 5947 F DEBUG : ABI: 'x86'
05-30 19:55:19.509 5947 5947 F DEBUG : pid: 5904, tid: 5904, name: nkyg.funkytunes >>> com.github.funkyg.funkytunes <<<
05-30 19:55:19.509 5947 5947 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
05-30 19:55:19.510 5947 5947 F DEBUG : Abort message: 'art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0x34'
05-30 19:55:19.510 5947 5947 F DEBUG : eax 00000000 ebx 00001710 ecx 00001710 edx 00000006
05-30 19:55:19.510 5947 5947 F D
/*
* test process event connector - cn_proc.c
*
* cc $(shell pkg-config --cflags glib-2.0) \
* $(shell pkg-config --libs glib-2.0) \
* -o cn_proc cn_proc.c
*
* Listens for process events (fork, exec, change uid/gid/..., and exit)
* received through a kernel connector and prints them.
*
#!/usr/bin/python
import os
import os.path
import ovh
import pprint
import shutil
client = ovh.Client()
@gjedeer
gjedeer / eps2png
Created January 20, 2016 12:05 — forked from anonymous/eps2png
Mass convert EPS to PNG files
for i in *.eps; do gs -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dUseCIEColor -r300x300 "-sOUTPUTFILE=$i.png" "$i"; done
@gjedeer
gjedeer / boto_sns.py
Created June 24, 2015 22:01
How to send a push notification directly to device using Python, Boto and SNS
import boto
import boto.exception
import boto.sns
import pprint
import re
def send_push(device_id, body):
region = [r for r in boto.sns.regions() if r.name==u'eu-west-1'][0]
sns = boto.sns.SNSConnection(