Skip to content

Instantly share code, notes, and snippets.

View rfc1459's full-sized avatar
🏴‍☠️
ARRRRRRR

Matteo Panella rfc1459

🏴‍☠️
ARRRRRRR
View GitHub Profile
@rfc1459
rfc1459 / lspci.txt
Created April 16, 2013 10:06
lspci output for Dell XPS 13
$ lspci -tv
-[0000:00]-+-00.0 Intel Corporation Ivy Bridge DRAM Controller
+-02.0 Intel Corporation Ivy Bridge Graphics Controller
+-14.0 Intel Corporation Panther Point USB xHCI Host Controller
+-16.0 Intel Corporation Panther Point MEI Controller #1
+-1a.0 Intel Corporation Panther Point USB Enhanced Host Controller #2
+-1b.0 Intel Corporation Panther Point High Definition Audio Controller
+-1c.0-[01]----00.0 Intel Corporation Centrino Advanced-N 6235
+-1d.0 Intel Corporation Panther Point USB Enhanced Host Controller #1
+-1f.0 Intel Corporation Panther Point LPC Controller
package main
import (
"github.com/rfc1459/xmp"
"github.com/rfc1459/xmp/portal"
)
// Per-resonator attack
func perResAttack(p portal.Portal, x xmp.Xmp) (xmps int) {
orientation := portal.N
@rfc1459
rfc1459 / server.ex
Created March 23, 2013 21:47
Stacker server example rewritten using GenX
defmodule Stacker.Server do
import GenX.GenServer
use GenServer.Behaviour
def start_link(stack) do
:gen_server.start_link({:local, Stacker.Server}, __MODULE__, stack, [])
end
def init(stack) do
{ :ok, stack }
@rfc1459
rfc1459 / network_test.go
Last active December 12, 2015 05:28
Tests for Moebius network I/O loop
/*
* network_test.go - network I/O testing
* Copyright (C) 2013 Matteo Panella <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@rfc1459
rfc1459 / parse_test.go
Created February 3, 2013 10:21
gocheck sample
/*
* io/parse_test.go - Tests for Moebius parser
* Copyright (C) 2013 Matteo Panella <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@rfc1459
rfc1459 / 99-supersu.sh
Last active December 10, 2015 09:59
SuperSU (Pro) backup script for CM10.1
#!/sbin/sh
#
# /system/addon.d/99-supersu.sh
# During a CM10 upgrade, this script backs up SuperSU-related files,
# /system is formatted and reinstalled, then the files are restored.
#
. /tmp/backuptool.functions
list_files() {
@rfc1459
rfc1459 / resize.sh
Created July 29, 2012 16:14
Programmatically resize banners for MOCA app
#!/bin/bash
IMAGES=$@
resize() {
local DENSITY=$1
shift
local SIZE=$1
shift
local UNSHARP=$1
@rfc1459
rfc1459 / clock.c
Created April 4, 2012 15:46
FFFFFUUUUU
static void clk_disable_locked(struct clk *c)
{
if (c->refcnt == 0) {
WARN(1, "Attempting to disable clock %s with refcnt 0", c->name);
return;
}
if (c->refcnt == 1) {
if (c->ops && c->ops->disable) {
trace_clock_disable(c->name, 0, 0);
c->ops->disable(c);
@rfc1459
rfc1459 / to-flac.py
Created January 27, 2012 18:30
Damn iTunes Store...
#!/usr/bin/python -u
# Quick and dirty script to transcode to FLAC all AAC-LC files
# rooted into the current working directory (subdirs incl.)
import os
import sys
import subprocess
import magic
@rfc1459
rfc1459 / cloak.c
Created July 3, 2011 22:07
SHA1 - mixed C89/C99
/* CUT */
#define SHABUFLEN (SHA1_DIGEST_LENGTH * 2)
char *sha1_hash(const char *s, size_t size) {
static char shabuf[SHABUFLEN + 1];
unsigned char digestbuf[SHA1_DIGEST_LENGTH];
int i;