Skip to content

Instantly share code, notes, and snippets.

View lolzballs's full-sized avatar

Benjamin Cheng lolzballs

View GitHub Profile
@lolzballs
lolzballs / iptables.rules
Last active June 8, 2019 00:42
iptables
*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
/*
* 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,
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):
/*
****************************************************************************
* 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 July 23, 2015 14:38
Very rough parser for Steam's appinfo.vdf
#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)

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 01:11
Uploads images from clipboard to imgur and put the link in your clipboard
#!/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 March 22, 2015 00:21
Hello World Enterprise Edition
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 September 15, 2013 18:03
Test plugin for minecart
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