Skip to content

Instantly share code, notes, and snippets.

View flexd's full-sized avatar

Kristoffer Berdal flexd

View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
# Redis
%w{6379}.each do |port|
God.watch do |w|
w.name = "redis"
w.interval = 30.seconds
w.start = "/etc/init.d/redis start"
w.stop = "/etc/init.d/redis stop"
w.restart = "/etc/init.d/redis restart"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
kristian@luke:~$ cat /usr/lib/nagios/plugins/check_mount.sh
#!/bin/bash
# CHEF
gawk '
$3 ~ "(ext[0-9]|btrfs)" {
if ($4 !~ "^rw") {
ret=2
ret_status+= " $1 ($2) not mounted RW"
}
@JamesHarrison
JamesHarrison / twitterstats.rb
Created August 12, 2011 09:18
Twitter streaming API to Graphite bridge. Pushes pure volume stats and some other things. Just playing around.
require "rubygems"
require "bundler/setup"
require "tweetstream"
require "simple-graphite"
class TwitterStats
def initialize
@client = TweetStream::Client.new('username', 'password').on_limit do |disc_count|
puts "WARNING: Got limited, lost #{disc_count.to_s}"
end.on_error do |message|
puts "ERROR: #{message}"
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active June 16, 2024 09:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
@agnoster
agnoster / README.md
Last active July 13, 2024 19:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@tracker1
tracker1 / CardReader.js
Created November 29, 2012 18:14
Wrapping an external service...
var EventEmitter = require("events").EventEmitter;
var util = require("util");
module.exports = CardReader;
//the export is essentially a self-healing wrapper around the external interface...
function CardReader() {
var that = this, someProc = null;
loadProc();
function loadProc() {
@drewolson
drewolson / reflection.go
Last active November 20, 2023 09:39
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`