This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple bash script that unstalls a version of rails (this could break if you have other gems matching the exact version name) | |
# here we remove rails 4.0.0.rc1 | |
# v1, simple | |
#gem list | grep 4.0.0.rc1 | awk -F= 'BEGIN {FS = " "} ; {print $1}' | while read x ; do gem uninstall $x -v 4.0.0.rc1 ; done | |
# v2, even shorter, no need for awk | |
gem list | grep 4.0.0.rc1 | while read name _; do gem uninstall $name -v 4.0.0.rc1 ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {10..254}; do nc -v -n -z -w 1 192.168.36.$i 8000; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true ; do nc -l 8080 < index.html ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'guard' | |
require 'guard/plugin' | |
class Guard::Mygo < Guard::Plugin | |
def run_all | |
system 'go test ./...' | |
end | |
def run_on_changes(paths) | |
paths.each do |file| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"log" | |
) | |
type Reading struct { | |
RType string `xml:"r_type,attr"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this can be done anytime | |
heroku addons:add heroku-postgresql:standard-yanari --app nav-chronos; heroku pg:wait | |
# about 3m30s | |
heroku maintenance:on | |
heroku ps:scale worker=0 | |
heroku pgbackups:capture --expire | |
# less than 20 min |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat | ruby -e "STDIN.readlines.select{|l|l[/memory_total/]}.map{|l| l.split(/\s+/)}.map{|l| puts \"#{l[2][/T[\d+:]+/][1..-1]} #{l[9][/([\d.]+)MB/][0..-3]}\"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"gopkg.in/yaml.v1" | |
"time" | |
) | |
type timeUnMarsh struct { | |
time.Time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"os" | |
"strings" | |
) | |
//History of recent posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/gorilla/sessions" | |
"html/template" | |
"net/http" | |
"strconv" | |
) |