Skip to content

Instantly share code, notes, and snippets.

View hamsolodev's full-sized avatar

mch hamsolodev

  • Melbourne, Australia
View GitHub Profile
Copyright (c) 1992-2011 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011
root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Celeron(R) CPU 420 @ 1.60GHz (1596.01-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x10661 Family = 6 Model = 16 Stepping = 1
Features=0xafebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE>
@hamsolodev
hamsolodev / .zshrc
Created August 27, 2011 08:08
stupidly simple starting & stopping of Pomodoro from commandline
# use AppleScript to communicate with the Pomodoro application on OSX
function pom {
case $1 in
start)
osascript -e "tell app \"Pomodoro\" to start \"${*}\" duration 25 break 5"
;;
stop)
osascript -e "tell app \"Pomodoro\" to reset"
;;
pause)
@hamsolodev
hamsolodev / .zshrc
Created August 28, 2011 03:02
zsh function to control OSX Pomodoro app from shell
# use AppleScript to communicate with the Pomodoro application
function pom {
case $1 in
start)
# if it weren't for the use of arg ranges here then this function would work in straight sh
TASK=$*[2,-1]
DURATION=25
BREAK=5
osascript -e "tell app \"Pomodoro\" to start \"${TASK}\" duration ${DURATION} break ${BREAK}"
@hamsolodev
hamsolodev / ds18b20.py
Created April 12, 2012 06:26
convert two bytes from DS18B20 temperature reading register into usable temperature
def ds18b20_convert(lsb, msb):
"""
Converts the 16-bit sign-extended two’s complement number, stored
in the DS18B20's temperature register, into a temperature.
"""
reading = lsb + (msb << 8)
inv = reading & 0x8000
if inv: # two's compliment
reading = (reading ^ 0xffff) + 1
val = reading / 16.0
;; use OSX's Quick Look to browse file:/// URLs
(defun osx-qlook (url &optional some-stuff)
(message "Launching Quick Look preview...")
(start-process
"qlmanage"
(get-buffer-create "*qlmanage*")
"/usr/bin/qlmanage"
"-p"
;; strip “file://” from URL
;; Toggle between split windows and a single window
(defun toggle-windows-split()
"Switch back and forth between one window and whatever split of
windows we might have in the frame. The idea is to maximize the
current buffer, while being able to go back to the previous split
of windows in the frame simply by calling this command again."
(interactive)
(if (not (window-minibuffer-p (selected-window)))
(progn
(defadvice deft-new-file (after deft-markdown-title
activate compile)
"After Deft creates a new file, make the supplied text a Markdown header"
(if (string-equal deft-text-mode "markdown-mode")
(progn
(goto-char (point-min))
(insert "# ")
(goto-char (point-max)))))

Arch Linux install notes

Notes on installing Arch Linux from scratch, using LVM partitions.

There's no installer as such; instead, there's a series of tasks carried out on the commandline to partition the disk and bootstrap base packages &c.

Followed the Installation Guide, with forays into other wiki pages to gather configuration options as required.

Boot installation media

@hamsolodev
hamsolodev / err
Created February 10, 2013 02:25
FreeBSD 9.1 error installing avr-binutils port
===> Compressing manual pages for avr-binutils-2.20.1_1
===> Registering installation for avr-binutils-2.20.1_1
Installing avr-binutils-2.20.1_1...pkg: avr-binutils-2.20.1_1 conflicts with binutils-2.23.1 (installs files into the same place). Problematic file: /usr/local/share/locale/da/LC_MESSAGES/bfd.mo
*** [fake-pkg] Error code 70
Stop in /usr/ports/devel/avr-binutils.

Puppet Camp Melbourne

  • check out Puppet Forge
  • upgrade to Puppet 3.0 ASAP
    • big performance and memory handling improvements over 2.7
    • Hiera used internally

Puppet for sysadmins

  • Puppet can write puppet