Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am catherinetcai on github.
  • I am catherinetcai (https://keybase.io/catherinetcai) on keybase.
  • I have a public key ASCISE-o6wYlqDLyiO7BwtPA9vs08mREXdR2_E2yxgnuUwo

To claim this, I am signing this object:

@catherinetcai
catherinetcai / qemu_osx_rpi_raspbian_jessie.sh
Created January 24, 2018 21:11 — forked from hfreire/qemu_osx_rpi_raspbian_jessie.sh
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@catherinetcai
catherinetcai / a-new-mac-setup.md
Created April 22, 2017 03:39 — forked from maxfenton/a-new-mac-setup.md
System setup stuff for a new mac

New computer setup

  • a/o 2016-05-21 *

--

Format the drive

  1. Restart with Cmd-R or Cmd-D
  2. Erase drive / 3x if second-hand
  3. Reinstall MacOS
@catherinetcai
catherinetcai / extend.sh
Created April 14, 2017 17:47 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@catherinetcai
catherinetcai / kibana.init.d
Created February 3, 2017 02:21
Kibana Init Script
#! /bin/bash
set -e
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop kibana
@catherinetcai
catherinetcai / STDOUT
Last active February 1, 2017 23:31
Slurping rsyslog 7.4.4
{
"hostname" => "collect-1: message repeated 33",
"@timestamp" => 2017-02-01T23:27:21.168Z,
"port" => 51601,
"host" => "127.0.0.1",
"syslog_lvl" => "13",
"program" => "times",
"message" => "[ COLLECT SIDE]",
"type" => "syslog",
"tags" => [
@catherinetcai
catherinetcai / credentials.Jenkinsfile
Last active February 13, 2017 23:14
Jenkinsfile Helpers
// ** DUMP CREDENTIALS INTO AN ENV VAR **
node {
def cert="cert-id"
withCredentials([[$class: 'FileBinding', credentialsId: "${cert}", variable: 'REG_CERT']]) {
sh 'cat ${env.REG_CERT}' // Maybe don't actually cat it, but there ya go
}
}