Skip to content

Instantly share code, notes, and snippets.

View shireeshj's full-sized avatar
🏠
Working from home

Shireesh Jayashetty shireeshj

🏠
Working from home
View GitHub Profile
@shireeshj
shireeshj / colossal-cue-adventure.py
Created November 12, 2021 08:17 — forked from builtinnya/colossal-cue-adventure.py
A trivial code for solving the Colossal Cue Adventure.
# A trivial code for solving the Colossal Cue Adventure
# URL: http://adventure.cueup.com/
# Level 1: The VAX's MTH$RANDOM % 36 Roulette
def vax_rng_next(x):
"""Generate the next pseudo-random number."""
a, c, m = 69069, 1, 2**32
return (a * x + c) % m
@shireeshj
shireeshj / git-tophat
Created March 31, 2021 07:57 — forked from thegedge/git-tophat
A git subcommand to "tophat" (build/run/test) a PR from a fork
#!/bin/zsh
function main {
if [[ ! "$1" =~ ".*:.*" ]]; then
echo "Empty username or branch name: \`$1\` should be of the form \`user:branch\`"
exit 1
fi
local username="${1%:*}"
local branch="${1#*:}"
@shireeshj
shireeshj / devops_training.txt
Created July 27, 2018 08:45 — forked from ssmythe/devops_training.txt
Training materials for DevOps
======
Videos
======
DevOps
What is DevOps? by Rackspace - Really great introduction to DevOps
https://www.youtube.com/watch?v=_I94-tJlovg
Sanjeev Sharma series on DevOps (great repetition to really get the DevOps concept)
I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer.
I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc).
# Install rvm (no sudo!)
# ------------------------------------------------------
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
source ~/.rvm/scripts/rvm
rvm install ree-1.8.7-2010.02
@shireeshj
shireeshj / app.js
Created November 3, 2017 10:53 — forked from khash/app.js
Cloud 66 Status Page Source Code
Handlebars.registerHelper('equal', function(lvalue, rvalue, options) {
if (arguments.length < 3)
throw new Error("Handlebars Helper equal needs 2 parameters");
if( lvalue!=rvalue ) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
@shireeshj
shireeshj / ml-ruby.md
Created May 5, 2016 14:45 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@shireeshj
shireeshj / GIF-Screencast-OSX.md
Created September 26, 2015 04:44 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

#!/bin/bash
### BEGIN INIT INFO
# Provides: sidekiq beta
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: sidekiq beta - asynchronous rails
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
#
# where TYPE is one of {data,var,file,page}, described below
#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db