Skip to content

Instantly share code, notes, and snippets.

View allanlei's full-sized avatar
:shipit:
What's up?

Allan Lei allanlei

:shipit:
What's up?
View GitHub Profile
@nneonneo
nneonneo / GAME_MASTER_v0_1.protobuf
Last active April 17, 2024 17:18 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: [10, 100, 1000]
}
}
Items {
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@minhoryang
minhoryang / 1-twisted-https.py
Last active January 24, 2018 12:21
Using SSL Certificate, PrivateKey, CertChains with Python Flask/Twisted
from OpenSSL.crypto import load_privatekey, load_certificate, FILETYPE_PEM
#from OpenSSL.SSL import SSLv3_METHOD
from twisted.internet import reactor
from twisted.internet.ssl import CertificateOptions, DefaultOpenSSLContextFactory, DiffieHellmanParameters
from twisted.web import proxy, server
from twisted.python.filepath import FilePath
sample_site = server.Site(proxy.ReverseProxyResource('localhost', 80, '')) # ignore it.
# AES256-SHA
@rmcgibbo
rmcgibbo / Install Intel-CPU OpenCL on Ubuntu.md
Last active November 6, 2021 10:00
Installing Intel CPU OpenCL on Ubuntu 12.04

Open Computing Language (OpenCL) is a language and framework for writing computationally intensive kernels that run accross heterogenious platforms, including GPUs, CPUs, and perhaps other more esoteric devices.

Intel provides an OpenCL implementation for Intel CPUs, but there's not a lot of instructions on how to get it set up. Here's what I did.

Installing Intel CPU OpenCL on Ubuntu (12.04)

  1. Download the Intel® SDK for OpenCL* Applications XE 2013 from the Intel website, here http://software.intel.com/en-us/vcsource/tools/opencl-sdk-xe. The download is a tarball -- the one I got is called intel_sdk_for_ocl_applications_2013_xe_sdk_3.0.67279_x64.tgz
  2. Unpack the tarball and cd into the new directory
@zacharyvoase
zacharyvoase / README.md
Last active May 21, 2020 06:19
A li’l class for data URI manipulation in Python.

DataURI.py

Data URI manipulation made easy.

This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.

Parsing

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ruckus
ruckus / gist:2293434
Created April 3, 2012 16:36
Basic setup of WAL-E for continuous archiving and recovery

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
forwardMap = {
5500 : [ "192.168.110.32:5500", "10.0.1.1:5500" ],
5499 : [ "192.168.110.32:5499" ],
15501 : [ "localhost:5501" ]
}