Skip to content

Instantly share code, notes, and snippets.

View neilmock's full-sized avatar

Neil Mock neilmock

View GitHub Profile
#!/bin/bash
sudo su -
#
# Audio: fix ubuntu 9.04 broken sound
#
apt-get install build-essential xmlto libncurses5-dev
export ALSA="1.0.20"
@neilmock
neilmock / hack
Created August 7, 2010 23:07 — forked from ymendel/hack
#!/bin/sh
BRANCHES=`git branch`
if [ $? != 0 ]; then
exit
fi
GIT_SVN=0
git branch -r | grep 'git-svn' > /dev/null
if [ $? = 0 ]; then
GIT_SVN=1
require "stateful"
class Folder < ActiveRecord::Base
include Stateful
# ...
stateful do
state :active
state :inactive
@neilmock
neilmock / .gitignore
Created June 22, 2012 12:03 — forked from karmi/.gitignore
Bootstrap, install and configure ElasticSearch with Chef Solo
.DS_Store
node.json
tmp/
@neilmock
neilmock / backup.sh
Created June 27, 2012 13:48 — forked from nherment/backup.sh
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@neilmock
neilmock / PhantomTypeReasonML.md
Created December 21, 2017 17:33 — forked from busypeoples/PhantomTypeReasonML.md
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@neilmock
neilmock / sshd.go
Created July 23, 2019 21:33 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@neilmock
neilmock / qemu-networking.md
Created December 30, 2019 20:10 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@neilmock
neilmock / gruvbox_blink_sh.js
Created March 25, 2022 20:46 — forked from jearbear/gruvbox_blink_sh.js
Gruvbox blink.sh theme
@neilmock
neilmock / colorize-emacs.bashsource
Created April 12, 2022 09:44 — forked from algal/colorize-emacs.bashsource
Setting up truecolor (24 bit color) in emacs in the terminal, under iTerm2, blink.sh, and others.
# sourcing this file will define a bash functions that
# tries to run subsequent calls to emacs with 24 bit color.
#
# It sets TERM=xterm-emacs-leg if
# - we've created a user-local terminfo record for xterm-emacs-leg, and
# - we're using iTerm2 or something has set COLORTERM=truecolor
#
# This will cause emacs to use 24 bit color only when it will work,
# inside or outside of tmux. I haven't found a way to auto-detect Blink.sh yet.
#