Skip to content

Instantly share code, notes, and snippets.

View quarnster's full-sized avatar

Fredrik Ehnbom quarnster

  • Stockholm, Sweden
View GitHub Profile
@quarnster
quarnster / steps.txt
Last active December 20, 2015 08:28
Boxee xbmc build stuff
Go to https://github.com/quarnster/boxeebox-xbmc instead.
@quarnster
quarnster / flash.go
Last active December 21, 2015 06:19
Go code for dumping the raw nandflash data from Boxeebox's /dev/spectra
// GOOS=linux GOARCH=386 go build flash.go && ftp -u boxeebox:/tmp/flash flash
package main
import (
"fmt"
"log"
"os"
"syscall"
"unsafe"
)
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <signal.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
Entering '3rdparty/bundles/GoSublime'
diff --git a/something_borrowed/src/gosublime.org/gocode/package.go b/something_borrowed/src/gosublime.org/gocode/package.go
index 9ac11dd..3d2b01f 100644
--- a/something_borrowed/src/gosublime.org/gocode/package.go
+++ b/something_borrowed/src/gosublime.org/gocode/package.go
@@ -3,13 +3,13 @@ package gocode
import (
"bytes"
"errors"
- "strings"
import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
ApplicationWindow {
id: window
property var lyrics: gocode.project.lyrics
width: 800
height: 600
property int scale: 1
@quarnster
quarnster / regs.py
Created April 5, 2014 13:47
small lldb script to print out details when sigaction is called
# lldb -o "script lldb.target" -o "command script import ./regs.py" -o "r" -o "c" python -- -c "print 'hello'"
# lldb -o "script lldb.target" -o "command script import ./regs.py" -o "r" -o "c" java Hello
import lldb
import re
r = re.compile("#define\s+(SIG[^_\s]+)\s+(\d+)")
f = open("/usr/include/sys/signal.h", "r")
sigs = dict(map(lambda a: (int(a.group(2),10), a.group(1)), map(r.search, filter(r.match, f.readlines()))))
f.close()
first = True
def breakpoint_callback(frame, bp_loc, dict):
// GOOS=linux GOARCH=386 go build verify.go && ftp -u boxeebox:/tmp/ verify
//
// This tool verifies the boxeebox boot block, based on
// findings from running the "bootblockverifier" tool found
// in the boxeebox rma image (see http://www.boxeeboxwiki.org/rma).
//
// ##################### WARNING!!!! ######################
// # Whether it's possible to use this information to #
// # actually replace the current bootloader with a #
// # custom version is at the moment unknown. Use at #
// Download http://downloads.tatoeba.org/exports/sentences.tar.bz2 and http://downloads.tatoeba.org/exports/links.tar.bz2
// to this directory.
//
// Then run "go run tatoeba.go".
//
// Tweak "havestring" to change the 汉字 learned.
package main
import (