Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Cheng lolzballs

View GitHub Profile
View iptables.rules
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp --dport 5353 -j ACCEPT
View chess-without-pawn.js
/*
* Copyright (c) 2017, Jeff Hlywa (jhlywa@gmail.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
View uncertainty.py
from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt
class measurement:
def __init__(self, val, err):
self.val = val
self.err = err
def __repr__(self):
View bno055_support.c
/*
****************************************************************************
* Copyright (C) 2015 - 2016 Bosch Sensortec GmbH
*
* bno055_support.c
* Date: 2016/03/14
* Revision: 1.0.4 $
*
* Usage: Sensor Driver support file for BNO055 sensor
*
@lolzballs
lolzballs / appinfoparser.cpp
Created Jul 23, 2015
Very rough parser for Steam's appinfo.vdf
View appinfoparser.cpp
#include <cstdint>
#include <boost/any.hpp>
#include <string>
#include <unordered_map>
#include <fstream>
#include <iostream>
#define MAGIC_VALUE 0x07564426
uint32_t read32_le(std::istream& stream)
View keybase.md

Keybase proof

I hereby claim:

  • I am lolzballs on github.
  • I am lolzballs (https://keybase.io/lolzballs) on keybase.
  • I have a public key whose fingerprint is 355B F314 F9FF B3D9 80CC A4BA 4FE2 2E75 28E9 7BD8

To claim this, I am signing this object:

@lolzballs
lolzballs / Python Imgur Uploader
Created May 30, 2015
Uploads images from clipboard to imgur and put the link in your clipboard
View Python Imgur Uploader
#!/usr/bin/python
import pygtk
pygtk.require('2.0')
import gtk
import sys, os
import cStringIO
import base64
import json
@lolzballs
lolzballs / HelloWorld.java
Created Mar 22, 2015
Hello World Enterprise Edition
View HelloWorld.java
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@lolzballs
lolzballs / Test.java
Created Sep 15, 2013
Test plugin for minecart
View Test.java
package tk.teamfield3.test;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class Test extends JavaPlugin implements Listener {
@Override