Skip to content

Instantly share code, notes, and snippets.

@HarryCutts
HarryCutts / minijail-policy-dup-checker.elv
Last active January 16, 2021 00:35
Minijail policy file duplicate checker (https://crrev.com/c/2633956)
fn list-syscalls [file]{
cat $file | eawk [f syscall @rest]{ if (str:has-suffix $syscall ':') { put $syscall[:-1] } }
}
fn find-dups [list]{
map = [&]
for item $list {
if (has-key $map $item) {
put $item
}
@HarryCutts
HarryCutts / ABOUT.md
Created November 17, 2018 00:04 — forked from laobubu/ABOUT.md
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a fork of [laobubu's Pico HTTP server][laobubu-gist]. The only change is a fix to the POST payload reading code.

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@HarryCutts
HarryCutts / worksheet.md
Created July 9, 2013 18:48
Smallpeice worksheet

Python in Action

In Python: A Whirlwind Tour, you learnt to use Python in quite an abstract environment. In this worksheet, we'll build on that knowledge in an applied setting: that of programming a robot. For now, this robot will be in a simulator, but the code you will write for it will be very similar to the code for your real robot.

Using the simulator

On your desktop on the lab machine, you should find a folder named 'robot-sim', with another folder and a couple of Python programs inside. This is the simulator directory. When you place programs in the folder and follow the steps below, your program will be run in the simulator.

@HarryCutts
HarryCutts / run.sh
Last active December 19, 2015 10:29
Python file runner bash script
#!/bin/bash
echo "Choose the program to run:"
cd robot-sim
select FILENAME in *.py;
do
echo "Running $FILENAME ($REPLY):"
echo "---"
echo
@HarryCutts
HarryCutts / keybase.md
Created May 26, 2015 19:32
keybase.md

Keybase proof

I hereby claim:

  • I am harrycutts on github.
  • I am hc (https://keybase.io/hc) on keybase.
  • I have a public key whose fingerprint is 14C4 E347 399F 4D1F 9668 9CF6 4E44 A55E 80BB 7ECE

To claim this, I am signing this object: