This file contains hidden or 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
| #!/usr/bin/env python | |
| import boto | |
| import gcs_oauth2_boto_plugin | |
| import os, sys, glob | |
| # URI scheme for Google Cloud Storage. | |
| GOOGLE_STORAGE = 'gs' | |
| # URI scheme for accessing local files. | |
| LOCAL_FILE = 'file' |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import boto | |
| import gcs_oauth2_boto_plugin | |
| import os, sys, glob | |
| # URI scheme for Google Cloud Storage. | |
| GOOGLE_STORAGE = 'gs' | |
| # URI scheme for accessing local files. | |
| LOCAL_FILE = 'file' |
This file contains hidden or 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" | |
| "time" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) |
This file contains hidden or 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 ( | |
| "syscall" | |
| "os" | |
| "fmt" | |
| "math" | |
| ) | |
| func main() { |
This file contains hidden or 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" | |
| func main() { | |
| messages := make(chan string) | |
| signals := make(chan bool) | |
| select { | |
| case msg := <-messages: |
This file contains hidden or 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
| // from gobyexample.com | |
| package main | |
| import "fmt" | |
| // This function `intSeq` returns another function, which | |
| // we define anonymously in the body of `intSeq`. The | |
| // returned function _closes over_ the variable `i` to | |
| // form a closure. |
This file contains hidden or 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
| # sample rack_app.rb | |
| require 'rack' | |
| app = Proc.new do |env| | |
| ['200', {'Content-Type' => 'text/html'}, ['A barebones rack app.']] | |
| end | |
| Rack::Handler::WEBrick.run app, :Port => 7777 |
This file contains hidden or 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
| # query jenkins CLI to get the status of most recent build for all jobs | |
| for job in `java -jar ~/Downloads/jenkins-cli.jar -s http://localhost:8080/ list-jobs 2> /dev/null`; do echo "Project: '$job' recent build status:"; java -jar ~/Downloads/jenkins-cli.jar -s http://localhost:8080/ console $job -f -n 1 2> /dev/null; done | |
| Example run :- | |
| unix> ... | |
| Project: 'copy-dev-dir-to-nas' recent build status: | |
| Finished: SUCCESS | |
| Project: 'disk-space-usage-fox-script' recent build status: | |
| Finished: SUCCESS |
This file contains hidden or 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
| abhishek@bjlinux068 ~> java -jar ~/Downloads/jenkins-cli.jar -s http://localhost:8080/ list-jobs 2> /dev/null | |
| copy-dev-dir-to-nas | |
| disk-space-usage-fox-script | |
| disk-space-usage-fox-tractor-host | |
| disk-space-usage-lic-tractor-host | |
| inventory-db-backup | |
| render-space-usage-fox | |
| tactic-db-backup | |
| upload-inventory-db-dump-to-goog-nearline | |
| upload-inventory-db-dump-to-s3 |
This file contains hidden or 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
| # Add a static route to a server on a separate lan | |
| # duplicate | |
| route add -net 172.17.0.0 netmask 255.255.255.0 gw 172.16.15.246 | |
| route | |
| netstat -rn | |
| # setup a virtual network interfece here | |
| ifconfig eth0:0 123.123.22.22 |