Skip to content

Instantly share code, notes, and snippets.

View christianchristensen's full-sized avatar

Chris Christensen christianchristensen

View GitHub Profile
@skeeto
skeeto / Makefile
Created October 21, 2014 03:51
C Object Oriented Programming Example
CFLAGS = -std=c99 -Wall
main : main.o
.PHONY : test clean
test : main
./$^ "*regex*" "*vtable*" < main.c
clean :
#!/usr/bin/python
import socket, ssl, select, time, re
from thread import start_new_thread
from struct import pack
TYPE_ENUM = 0
TYPE_STRING = 2
TYPE_BYTES = TYPE_STRING
def clean(s):
@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@fredhsu
fredhsu / eAPI-example-vlans.py
Created February 13, 2014 06:36
Quick example of JSON-RPC for Arista eAPI
import json
from jsonrpclib import Server
switches = ["172.22.28.156", "172.22.28.157", "172.22.28.158"]
username = "admin"
password = "admin"
# Going through all the switch IP addresses listed above
for switch in switches:
urlString = "https://{}:{}@{}/command-api".format(username, password, switch)
@jloutsenhizer
jloutsenhizer / ChromecastAppList.json
Created February 7, 2014 00:22
List of Chromecast Receiver Apps as of 2/6/2014 7:00PM GMT-5:00
[
{
"use_channel":true,
"allow_empty_post_data":true,
"app_id":"edaded98-5119-4c8a-afc1-de722da03562",
"url":"http://chromecast.redbull.tv/receiver.php",
"dial_enabled":true
},
{
"use_channel":true,
@smerchek
smerchek / codemash_2014.md
Created January 15, 2014 16:49
CodeMash 2014 Highlights/Notes

Putting the D&D in TDD (FULL DAY)

Guy Royse; George Walters

I used Ruby and Minitest with my Blink(1) to TDD through this very big Kata. It was fun and a great learning experience. It did a good job of going slowly at first to get the basics and then ramping up. There is much left that I could do here for further practice.

Sweet Elixir! A Gentle Introduction to Erlang’s cute younger brother Elixir (FULL DAY)

Ryan Cromwell; Chris McCord

@jmervine
jmervine / goinst.sh
Last active July 31, 2016 02:36
Installing GoLang - Ubuntu 12.04.3 LTS \n \l
#!/usr/bin/env bash
#
# Example usage:
#
# $ VERSION=1.3 sudo ./goinst.sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@jars
jars / hacker-radiio
Last active December 29, 2022 16:25
Music For Hackers
Music For Hackers
==
To a hacker, there's something distracting about booting up a GUI to listen to your tunes. You live your life in the terminal, you treat the mouse like a high voltage tap.
So give these commands a run in the terminal, and toss on your headphones.
sudo apt-get install mplayer
echo "alias defcon-start='nohup mplayer http://sfstream1.somafm.com:6200 > /dev/null 1>&2 &'" >> ~/.bashrc
echo "alias defcon-stop='killall -9 mplayer'" >> ~/.bashrc
@chojayr
chojayr / dashing_zabbix_trigger.md
Last active November 28, 2023 16:39
Dashboard(Dashing) Zabbix Triggers

Dashing dashboard for zabbix trigger

zabbix trigger zabbix trigger

This will provide the total number of alerts on triggers status

  • flash when there's an alert/triggers (color based on the zabbix trigger color format)
  • trigger = Warning, Average, High & Disaster
  • unacknowledge triggers
@adamwiggins
adamwiggins / roku-curl.txt
Created November 9, 2013 22:26
Roku API query example
$ curl http://192.168.1.110:8060/query/apps
<apps>
<app id="12" version="3.1.6014">Netflix</app>
<app id="13" version="4.10.13">Amazon Instant Video</app>
<app id="2016" version="3.2.7">Crackle</app>
<app id="2285" version="2.7.6">Hulu Plus</app>
<app id="13842" version="1.3.2">VUDU</app>
<app id="28" version="3.1.7">Pandora</app>
</apps>