Skip to content

Instantly share code, notes, and snippets.

View peteonrails's full-sized avatar

Peter Jackson peteonrails

View GitHub Profile
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@peteonrails
peteonrails / gist:9202498
Created February 25, 2014 04:04
A rose by any other name: Classes are just variables
irb(main):001:0> Function = Proc
=> Proc
irb(main):002:0> Function
=> Proc
irb(main):003:0> f = Function.new { puts "I am a function " }
#<Proc:0x007f14ab5d13c8@(irb):11>
irb(main):004:0> f.call
I am a function
=> nil
@peteonrails
peteonrails / startx.output
Created June 11, 2013 21:45
Output of startx after installing to chroot, then installing gnome-shell
pete@localhost:~$ startx
xauth: (stdin):2: unknown command "<snip>"
X.Org X Server 1.13.3
Release Date: 2013-03-07
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
Current Operating System: Linux localhost 3.4.0 #1 SMP Fri May 17 15:04:08 PDT 2013 x86_64
Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2097152 verity payload=2dd1bb63-06e2-c24a-8518-32163f764b5d+1 hashtree=2dd1bb63-06e2-c24a-8518-32163f764b5d+1 hashstart=2097152 alg=sha1 root_hexdigest=409a3fc5fa7198433cfdd21377b640f61429f171 salt=de27d4324dc3f5550adf5ce1a2b1960295d8a25989fb3e6ec050b4cbe2912a06" noinitrd vt.global_cursor_default=0 kern_guid=2dd1bb63-06e2-c24a-8518-32163f764b5d add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic gpt
@peteonrails
peteonrails / 20-chromebook-pixel.conf
Last active February 8, 2016 13:57
Config file for building the kernel in Arch linux mainline AUR
# /etc/X11/xorg.conf.d/20-chromebook-pixel.conf
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
# Contributor: Mikolaj Pastuszko <deluminathor@gmail.com>
# Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>
# Contributor: Peter Jackson <pete@peteonrails.com>
license=('GPL' 'custom:Brother')
arch=('i686' 'x86_64')
pkgname=brscan3
pkgver=0.2.11_5
pkgrel=1
pkgdesc="SANE drivers from Brother for brscan3 compatibile models"
depends=('sane' 'sed')
@peteonrails
peteonrails / v1
Created March 13, 2012 17:48 — forked from adambair/v1
-------------------------------------------------------------
iIIIIIIIIIIIIIIi,
II 'IIi. Intridea, Inc
II 'Ii www.intridea.com
II iii II
II 'ii II Document Title Here
II II 12/05/2011 - 12/06/2011
II iii II
II. iii .II Adam Bair, Partner
@peteonrails
peteonrails / QGIS cmake in homebrew
Created January 31, 2012 18:33 — forked from cspanring/QGIS cmake in homebrew
homebrew formula cmake arguments and output for QGIS.
cmake -DCMAKE_INSTALL_PREFIX=~/Applications -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=MinSizeRel -DWITH_INTERNAL_SPATIALITE=TRUE -DGEOS_INCLUDE_DIR=/usr/local/Cellar/geos/3.2.2/include -DGEOS_LIBRARY=/usr/local/Cellar/geos/3.2.2/lib/libgeos_c.dylib -DGDAL_INCLUDE_DIR=/usr/local/Cellar/gdal/1.7.3/include -DGDAL_LIBRARY=/usr/local/Cellar/gdal/1.7.3/lib/libgdal.dylib -DPYTHON_EXECUTABLE=/usr/local/Cellar/python/2.7.1/bin/python -DSIP_BINARY_PATH=/usr/local/bin/sip -DSIP_INCLUDE_DIR=/usr/local/include -DSIP_FOUND=true -DQWT_INCLUDE_DIR=/usr/local/Cellar/qwt/6.0.1/lib/qwt.framework/Versions/Current/Headers
-- Quantum GIS version: 1.9.90 Alpha (10990)
-- Could not find GRASS
-- Found Iconv: /usr/lib/libiconv.dylib
-- Found Proj: /usr/local/lib/libproj.dylib
-- Found GEOS: /usr/local/Cellar/geos/3.2.2/lib/libgeos_c.dylib
-- Found GDAL: /usr/local/Cellar/gdal/1.7.3/lib/libgdal.dylib
-- Found Expat: /usr/lib/libexpat.dylib
-- Found Qwt: /usr/local/lib/qwt.framework (6.0.1)
-- Found PostgreSQL: /usr/local/Cellar/po
@peteonrails
peteonrails / production
Created January 14, 2012 20:23
Cap deploy for Studyhall
Pete@Templar /Volumes/Templar SATA/workspace/web/studyhall (master) ⚡
→ cap production deploy
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
triggering before callbacks for `deploy'
* executing `deploy:setup_ssh'
Enter passphrase for /Users/Pete/.ssh/id_rsa:
Identity added: /Users/Pete/.ssh/id_rsa (/Users/Pete/.ssh/id_rsa)
@peteonrails
peteonrails / rev.c
Created January 10, 2012 15:47
Reverse an Integer in C
// I am not sure why I get asked to do this so frequently,
// but here is how I do it.
#include <stdio.h>
int main () {
int backwards = 0;
int value = 12345678;
int orig = value;
do
backwards = (backwards * 10) + (value % 10) ;
@peteonrails
peteonrails / geos
Created November 10, 2011 22:34
Updating the Homebrew formula for geos, when Mac OS X Lion complains about LLVM / gcc-4.2
require 'formula'
class Geos < Formula
url 'http://download.osgeo.org/geos/geos-3.3.1.tar.bz2'
homepage 'http://trac.osgeo.org/geos/'
md5 'b1ceefe205c9ee520b99f2b072c345f7'
def skip_clean? path
path.extname == '.la'
end