Skip to content

Instantly share code, notes, and snippets.

View gumblex's full-sized avatar

Dingyuan Wang gumblex

View GitHub Profile
@gumblex
gumblex / 65-source-sans-fonts.conf
Created August 18, 2014 08:28
Fontconfig file for Source Sans Pro and Source Han Sans series.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>Source Sans</string>
</test>
<edit name="family" mode="assign">
<string>Source Sans Pro</string>
</edit>

Keybase proof

I hereby claim:

  • I am gumblex on github.
  • I am gumblex (https://keybase.io/gumblex) on keybase.
  • I have a public key whose fingerprint is 8C4E 0F2D B084 A9FB E50B 4AE3 B3E4 D83E 3F3E 5FDC

To claim this, I am signing this object:

@gumblex
gumblex / coffeescript.txt
Created January 13, 2016 02:08
CoffeeScript Grammar
/* converted on Wed Jan 13, 2016, 10:06 (UTC+08) by jison-to-w3c v0.35.1152 which is Copyright (c) 2011-2015 by Gunther Rademacher <grd@gmx.net> */
Root ::= Body?
Body ::= Line ( TERMINATOR Line | TERMINATOR )*
Line ::= Expression
| Statement
Statement
::= Return
| Comment
| STATEMENT
@gumblex
gumblex / findbadlines.py
Last active January 19, 2016 03:00
Find lines with encoding errors.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This script tries to find encoding errors in stdin and prints out the bad lines.
Usage:
python3 findbadlines.py [encoding]
The default encoding is utf-8.
@gumblex
gumblex / imgfill.py
Last active March 6, 2016 14:48
Fill a canvas with a given image of different sizes.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import random
from PIL import Image
'''
Copyright (c) 2016 gumblex
@gumblex
gumblex / screenshot.py
Created April 24, 2016 01:26
Volatility 'screenshot' plugin SVG version
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
# Copyright (C) 2009 Brendan Dolan-Gavitt
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@gumblex
gumblex / WWStarClone.py
Last active May 4, 2016 14:59
Clone of WWStar, an ancient Classical Chinese translator.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
'''
Clone of WWStar, an ancient Classical Chinese translator.
usage: python3 WWStarClone.py [dir]
@gumblex
gumblex / rezip.sh
Created May 15, 2016 08:32
Re-zip hacg's encrypted rars
#!/bin/bash
cd "$1"
find . -name "*.rar" -type f -print0 | while IFS= read -r -d $'\0' filename; do
basefn=$(basename "$filename")
basefncut="${basefn%.*}"
unar -p 扶她奶茶 -o /tmp -d "$filename"
7za a -tzip -mx=9 "${filename%.*}".zip /tmp/"$basefncut"/*
rm -rf /tmp/"$basefncut"/
done
@gumblex
gumblex / ssl.py
Created July 23, 2016 05:32
Patched ssl.py for PyPy3.3 with modern OpenSSL
# Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
@gumblex
gumblex / urlrename.py
Created February 16, 2017 07:32
Simple script to get rid of url escaped filenames.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import urllib.parse
for f in sys.argv[1:]:
os.rename(f, urllib.parse.unquote_plus(f))