Skip to content

Instantly share code, notes, and snippets.

View brentfisher's full-sized avatar
🥂
Let's get to work!

brentfisher

🥂
Let's get to work!
View GitHub Profile
@dpiponi
dpiponi / example.cu
Created December 20, 2011 17:36
Minimal CUDA example (with helpful comments).
#include <stdio.h>
//
// Nearly minimal CUDA example.
// Compile with:
//
// nvcc -o example example.cu
//
#define N 1000
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 16, 2025 15:20
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 11, 2025 13:09
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@shawnburke
shawnburke / gist:3750709
Created September 19, 2012 16:46
Partial bash script for setting prompt to EC2 instance name. Add this to .bashrc
# these make the ec2 commands just work
export AWS_ACCESS_KEY=[AWS access key]
export AWS_SECRET_KEY=[AWS secret]
# fetch the instance id
export INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
#grep out the tag you're looking for, in this case "Name"
export APP_TAG=$(ec2-describe-tags | grep $INSTANCE_ID | grep -oE "Name\\W+(.+)$" | grep -oE "\\W.+$")
@othiym23
othiym23 / express-custom-middleware.js
Created October 30, 2013 06:00
Attempt at a repro case for newrelic/node-newrelic#73 (needs more detail).
'use strict';
var express = require('express');
var newrelic = require('newrelic');
function allowCrossDomain(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}
@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
var concurrency = 100;
var http = require('http');
http.globalAgent.maxSockets = concurrency;
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
for (var i = 0; i < concurrency; i++) {
s3.listBuckets(callback);
@mingfang
mingfang / convert id_rsa to pem
Last active December 12, 2024 12:13
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
anonymous
anonymous / gist:de6b81c556b5dc7cdc8b
Created February 20, 2015 01:42
Kernel panic in latest OS X in 10 lines of C
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
int
main (int argc, char * argv[])
{
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();