Skip to content

Instantly share code, notes, and snippets.

View andreif's full-sized avatar
👾
invading spaces

Andrei Fokau andreif

👾
invading spaces
View GitHub Profile
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
export GO_BASE=/usr/local/etc/go
mkdir -p $GO_BASE; cd $GO_BASE
export GO_VERSION=1.2.1
export GO_TAR=go($GO_VERSION).src.tar.gz
wget https://go.googlecode.com/files/$GO_TAR
sha1sum $GO_TAR
@andreif
andreif / lfs.sh
Last active August 29, 2015 13:59
alias vg=vagrant
# Step 1. setup Ubuntu 12.04
vg init hashicorp/precise32
vg up
# GuestAdditions 4.3.10 fix for vboxsf not available
vg ssh -c "sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions"
vg reload

Installing QEMU on OS X

Source: https://github.com/psema4/pine/wiki/Installing-QEMU-on-OS-X

To emulate the Raspberry Pi on OS X, you need a version of QEMU that supports the ARM 1176 instruction set (QEMU version 1.1.0 exactly).

  • Install and upgrade Xcode to 4.3 or above.
  • Install the Xcode Command Line Tools (you can do this from within Xcode's "Downloads" preference pane).
  • Install the latest version of Homebrew. Older versions of Homebrew have an old version of QEMU that does not support the RPi's 1176 instruction set.
  • IMPORTANT: At the time of this writing, the latest version of QEMU in Homebrew hangs indefinitely at startup. You need version 1.1.0, NOT version 1.1.0-1. QEMU 1.1.0 was added in 2b7b4b3. Simply make sure you have the latest Homebrew, and do this:
@andreif
andreif / arm.sh
Last active August 29, 2015 14:00
#!/usr/bin/env bash
# based on https://github.com/dwelch67/build_gcc/blob/master/build_arm
set -e
# run me as: sudo bash arm.sh
# running without sudo results in errors, e.g.:
# ../../binutils-2.24/bfd/archive.c:2249:7: error: use of undeclared identifier 'PACKAGE'
# ../../binutils-2.24/bfd/sysdep.h:143:14: error: expected parameter declarator
# ../../binutils-2.24/binutils/nm.c:1698:28: error: 'sbrk' is deprecated [-Werror,-Wdeprecated-declarations]
Source: http://macgpg.sourceforge.net/docs/howto-build-gpg-osx.txt.asc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
HOWTO: Build GnuPG on OS X
by Gordon Worley <redbird@mac.com>
updated by Alexander Nouak <macgpg@zeitform.de>
# coding=utf-8
import ctypes
import ctypes.util
import sys
from coreaudio import (
AudioObjectPropertyAddress,
kAudioHardwarePropertyDefaultInputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyScopeInput,
# coding=utf-8
# https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (watch out - only int format)
# http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
import sys
import struct
with file('out', 'rb') as f:
pcm = f.read()
# smb://myuser@myserver/myshare
alias kp_mount="mount -t smbfs //myuser@myserver/myshare mymount"
alias kp_umount="umount mymount"
alias kp="kp_mount 2>/dev/null; python kp.py"
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.makeKeyAndVisible()
let controller = TapController(nibName: nil, bundle: nil)
let nav_controller = UINavigationController(rootViewController: controller)