Skip to content

Instantly share code, notes, and snippets.

View jetpks's full-sized avatar

eric jacobs jetpks

View GitHub Profile
@jetpks
jetpks / coprime.rb
Created June 20, 2012 05:20
Find the a number coprime to the input
#!/usr/bin/env ruby
## Initialization and parameter checking:
def usage
puts "Usage: ./coprime.rb integer\n"
Process.exit(1)
end
@jetpks
jetpks / switcher.js
Created July 1, 2012 04:29
A node.js based gnome desktop background interval switcher.
#!/usr/local/bin/node
(function() {
"use strict";
// The purpose of this script is to switch the gnome background every x
// minutes.
var exec = require('child_process').exec
, fs = require('fs')
, interval = 0
@jetpks
jetpks / get2io.rb
Created December 13, 2012 10:44
Find all available 2 letter .io domain names.
#!/usr/bin/env ruby
require 'whois'
c = Whois::Client.new
('a'..'z').to_a.shuffle!.each do |starter|
('a'..'z').to_a.shuffle!.each do |ender|
#puts "Trying #{starter}#{ender}.io"
if c.query("#{starter}#{ender}.io").available?
puts "FOUND AVAILABLE!! AWESOME! : #{starter}#{ender}.io"
@jetpks
jetpks / get3io.rb
Created December 13, 2012 10:47
Find available three letter .io domains from list of any sized words in a file called ./wordlist.
#!/usr/bin/env ruby
require 'whois'
def load_words
three_letter_words = []
File.open('./wordlist', 'r') do |infile|
while (line = infile.gets)
next if (line == nil or line.chomp.length > 3)
three_letter_words.push(line.chomp)
end
@jetpks
jetpks / ppv
Created June 27, 2014 03:37
Validate your puppet manifests and erb templates.
#!/bin/bash
# Colors first, because they're important
green="\e[0;32m"
yellow="\e[1;33m"
red="\e[0;31m"
norm="\e[0m"
if [ ! -e $1 ]; then
printf "${yellow}404 NOTFOUND${norm}\t %s\n" $1;
exit 404;
@jetpks
jetpks / osx-for-hackers.sh
Created January 13, 2015 19:44
osx-for-hackers.sh # revised edition
#!/bin/sh
# ejacobs: removed all of those annoying prompts. Some of this doesn't work.
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
@jetpks
jetpks / native-bonds.patch
Created March 12, 2015 18:36
Let fuel use native bonds.
diff --git a/deployment/puppet/l23network/lib/puppet/parser/functions/generate_network_config.rb b/deployment/puppet/l23network/lib/puppet/parser/functions/generate_network_config.rb
index f80e466..6504c4a 100644
--- a/deployment/puppet/l23network/lib/puppet/parser/functions/generate_network_config.rb
+++ b/deployment/puppet/l23network/lib/puppet/parser/functions/generate_network_config.rb
@@ -4,6 +4,7 @@ require 'puppet/parser'
require 'puppet/parser/templatewrapper'
require 'puppet/resource/type_collection_helper'
require 'puppet/util/methodhelper'
+require 'json'
@jetpks
jetpks / ringtonize.rb
Created May 21, 2015 22:38
Find m4a files, and make them m4r files.
#!/usr/bin/env ruby
require 'FileUtils'
def main
config = parse_args
files = find_m4a(config[:src])
mangled = mangle_names(files, config[:dst])
move_files(mangled)
end
@jetpks
jetpks / README.md
Last active August 29, 2015 14:25 — forked from nickbudi/README.md
Budi's Counter-Strike: Global Offensive config

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config.

Put the files autoexec.cfg and video.txt in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

Launch Options

-novid -high -threads 4 -freq 144 -refresh 144 -tickrate 128 -nojoy -nod3d9ex +exec autoexec.cfg
@jetpks
jetpks / mos-websso.rst
Created February 8, 2016 20:38 — forked from bretonium/mos-websso.rst
How to configure Mirantis OpenStack for WebSSO via Okta
  • To use openstack cli you need to switch it to using v3 API. Do this:
    1. cp openrc openrc.v3
    2. edit openrc.v3 and
      • add there this line: export OS_IDENTITY_API_VERSION=3
      • change OS_AUTH_URL to point to v3.
  • Create an identity provider

    openstack identity provider create idp_1 # idp_1 is an id. Use any you like. I like idp_1