Skip to content

Instantly share code, notes, and snippets.

@gmhawash
gmhawash / pather
Created December 10, 2013 16:39
pather code.
#!/usr/bin/env ruby
class Pather
def initialize(input)
@input = input.split("\n")
end
def output
x1 = nil
@input.each do |line|
#!/usr/bin/env ruby
if __FILE__ == $0
puts "Run with: watchr #{__FILE__}. \n\nRequired gems: watchr rev"
exit 1
end
class Specs
class << self
def run(cmd)
sleep(2)
@gmhawash
gmhawash / install_vim_files
Created March 5, 2013 22:41
Script to install vim plugins
#!/bin/bash
echo "Installing ctags"
sudo apt-get install exuberant-ctags
DOTVIM="$HOME/.vim"
JQUERY=12276
if [ ! -e `which git` ]
then
@gmhawash
gmhawash / chef_solo_setup.sh
Last active December 14, 2015 09:59
Chef Solo Setup
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlibc zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@gmhawash
gmhawash / switch.rb
Created February 12, 2013 21:29 — forked from jbr/switch.rb
# In response to:
# http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html
# Ruby 1.9.2 has some neat stuff that lets us make a readable
# alternative case statement that calls each method in turn.
# 1.9.2 features used:
# * hashes are ordered in 1.9.2
# * cool JSON-style hash syntax
# * concise lambda syntax
@gmhawash
gmhawash / gist:4043232
Created November 9, 2012 01:54
Reset jenkins password
0. SSH to server
1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml
2. set userSecurity to false: <userSecurity>false</userSecurity>
3. delete
<authorizationStrategy> and <securityRealm>
4. /etc/init.d/bitnami restart