Skip to content

Instantly share code, notes, and snippets.

View pungoyal's full-sized avatar

Puneet Goyal pungoyal

View GitHub Profile
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@jobliz
jobliz / RedisPythonPubSub1.py
Created May 4, 2012 17:58
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
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
@MarcDiethelm
MarcDiethelm / strongloop-heroku.md
Last active July 17, 2019 05:59
How to install a Node.js app using Strongloop on Heroku

How to install a Node.js app using Strongloop on Heroku

with different environments like staging and production no less! new: now with multiple account administration!

  1. Create a Node.js app as you would normally, managing your dependencies with npm in package.json.
  2. Your app should be set up to listen on process.env.STRONGLOOP_PORT || [your usual local port].
  3. Download and install the Heroku toolbelt. This install includes git.

➽ If you need to handle multiple accounts, install the accounts plugin.

@Gowiem
Gowiem / rack_stats.rb
Created February 16, 2016 18:03
Rack Middleware for collecting Rails stats on Controller, Action, and Global response times and response code
# Heavily inspired by:
# scout_statsd_rack -- https://github.com/scoutapp/scout_statsd_rack/blob/master/lib/scout_statsd_rack.rb
# trashed -- https://github.com/basecamp/trashed
# Add to Rails App: `config.middleware.use RackStats`
class RackStats
attr_accessor :app
def initialize(app)
@app = app
end
@irfn
irfn / chef-to-hosts.sh
Last active July 31, 2017 10:56
pull ec2 hosts to dnsmasq
#!/usr/bin/env bash
cd $CHEF_INFRA_HOME/infrastructure;knife search node -a ipaddress "name:*p-* and chef_environment:production" | sed -e ':a' -e 'N' -e '$!ba' -e "s/:\n ipaddress:/ /g" | sed -e '/^\s*$/d' | awk '{print $2" "$1}'> /usr/local/etc/chef_hosts
cat /usr/local/etc/chef_hosts | awk '{print "host "$2"\n hostname " $1 "\n user ubuntu\n port 22\n IdentityFile ~/.ssh/id_rsa\n"}' > /usr/local/etc/ssh_config/chef