Skip to content

Instantly share code, notes, and snippets.

View rbarraud's full-sized avatar

Roger Barraud rbarraud

  • Robar Systems (New Zealand)
  • Up a Mountain, of course - just like all good Guru's should be ;-) - Wellington, New Zealand
View GitHub Profile
@rbarraud
rbarraud / json-parser.scm
Created December 28, 2022 06:42 — forked from joeltg/json-parser.scm
MIT Scheme JSON parser
(load-option '*parser)
(define (json-vector-list v)
(vector (vector->list v)))
(define json-object-pair
(*parser
(transform
(lambda (v)
(vector (cons (string->symbol (vector-ref v 0)) (vector-ref v 1))))
@rbarraud
rbarraud / x86-assembly-notes.md
Created September 27, 2022 11:46 — forked from mikesmullin/x86-assembly-notes.md
Notes on x86-64 Assembly and Machine Code

Mike's x86-64 Assembly (ASM) Notes

Assembling Binary Machine Code

Operating Modes:

These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.

Modern operating systems, booted inside Real mode,

@rbarraud
rbarraud / fooo
Created September 26, 2018 08:03
Serial numbers from camctrl...
[root@latka ~]# for i in /dev/ad* ; do echo $i ; camcontrol identify $i | grep serial - ; done
/dev/ada0
serial number Z4Z7F9F6
/dev/ada1
serial number Z504BXPN
/dev/ada2
serial number Z4Z65FTZ
/dev/ada3
serial number Z4Z5G4Z9
/dev/ada4
@rbarraud
rbarraud / camcontrol_ada8_B0rk.txt
Created September 26, 2018 07:55
camcontrol_ada8_B0rk.txt
<ST2000DM006-2DM164 CC26> at scbus3 target 0 lun 0 (ada0,pass0)
<ST2000DM006-2DM164 CC26> at scbus4 target 0 lun 0 (ada1,pass1)
<Marvell Console 1.01> at scbus8 target 0 lun 0 (pass2)
<ST2000DM006-2DM164 CC26> at scbus9 target 0 lun 0 (ada2,pass3)
<ST2000DM001-1ER164 CC26> at scbus10 target 0 lun 0 (ada3,pass4)
<ST3160023AS 3.05> at scbus11 target 0 lun 0 (ada4,pass5)
<ST3160023AS 3.18> at scbus12 target 0 lun 0 (ada5,pass6)
<ST2000DM001-1ER164 CC26> at scbus13 target 0 lun 0 (ada6,pass7)
<ST2000DM001-1ER164 CC26> at scbus14 target 0 lun 0 (ada7,pass8)
<ST2000DM001-1ER164 CC26> at scbus15 target 0 lun 0 (ada8,pass9)
@rbarraud
rbarraud / ada8_b0rk.txt
Created September 26, 2018 07:46
smartctl output...
smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-RELEASE-p10 amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST2000DM001-1ER164
Serial Number: Z8E04VGV
LU WWN Device Id: 5 000c50 0911aaa7e
Firmware Version: CC26
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
@rbarraud
rbarraud / opendiff.txt
Created September 8, 2018 07:06 — forked from kristofferh/opendiff.txt
Open FileMerge from command line
Open FileMerge from command line
opendiff
If the command-line doesn't work, and you have no /Developer directory anymore, you probably need to:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
@rbarraud
rbarraud / howto-filemerge-git-osx.md
Created September 8, 2018 06:56 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

;; Compiling form (DEFMETHOD DECOMPRESS ((OUTPUT STREAM) (STATE DECOMPRESSION-STATE) (INPUT STREAM) ...) ...).
Unable to REQUIRE module PNG-READ.
Available restarts:
20800043F000 80F8B942 SYSTEM.INTERNALS::BACKTRACE
20800043F090 80F84AEC (LAMBDA :IN SYSTEM.INTERNALS::ENTER-DEBUGGER)
20800043F560 8016CDD1 SYSTEM.INTERNALS::%WITH-STANDARD-IO-SYNTAX
20800043F820 80F8AC74 SYSTEM.INTERNALS::ENTER-DEBUGGER
20800043F840 80F7E54D INVOKE-DEBUGGER
20800043F8B0 80F7A430 ERROR
20800043F990 801F29DD REQUIRE
@rbarraud
rbarraud / colortest.py
Created June 19, 2017 04:38 — forked from justinabrahms/colortest.py
Small utility to test terminal support for 256-color output.
#!/usr/bin/env python
# Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349
print "Color indexes should be drawn in bold text of the same color."
print
colored = [0] + [0x5f + 40 * n for n in range(0, 5)]
colored_palette = [
"%02x/%02x/%02x" % (r, g, b)
for r in colored
@rbarraud
rbarraud / 20160101_freebsd_build_upgrade_via_source.md
Created May 7, 2017 10:06 — forked from dch/20160101_freebsd_build_upgrade_via_source.md
freebsd upgrade using git or svn source & making a low-fat bootable image aka memstick

overview

FreeBSD OS upgrades are done in 3 phases:

  • install new kernel
  • install new userland
  • upgrade all packages

Around these 3 stages, we use zfs snapshot and a git snapshot of /etc to make rollback and diffing any releases easier. freebsd-version -ku has been used