apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
| def deleteImageWithTagAndHash(registryHost, imageName, tag, hash) | |
| puts "Deleting..." | |
| res = `curl -X DELETE -I http://#{registryHost}/v2/#{imageName}/manifests/#{hash}` | |
| puts "curl -X DELETE -I http://#{registryHost}/v2/#{imageName}/manifests/#{hash}" | |
| puts "Deleted image with tag #{tag}" | |
| end | |
| def getDigestForImageAndTag(registryHost, imageName, tag) | |
| puts 'Processing...' | |
| digestHash = `curl -s -I -X HEAD -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' http://#{registryHost}/v2/#{imageName}/manifests/#{tag} | sed -n 's/Docker-Content-Digest://p'` |
| # outbound, actually all | |
| sudo tcpflow -C -i any -e all port 80 |
| // drop all non-system colls | |
| db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); }) | |
| // clear old profiles | |
| db.setProfilingLevel(0); db.system.profile.drop(); db.setProfilingLevel(1, 100) | |
| // view top profile queries | |
| db.getCollection('system.profile').find({}, {ns: 1, query:1, millis:1, command: 1}).sort({millis:-1}) | |
| //slow queries starting from a given date |
| (ns skynet.main | |
| (:require | |
| [co.paralleluniverse.pulsar | |
| [core :refer :all] | |
| [actors :refer :all]]) | |
| (:refer-clojure :exclude [promise await]) | |
| (:gen-class)) | |
| (declare skynet) |
| (def ^:dynamic *indent* 0) | |
| (alter-var-root | |
| #'clojure.core/load | |
| (fn [orig] | |
| (fn [& paths] | |
| (let [t (System/nanoTime) | |
| r (binding [*indent* (inc *indent*)] | |
| (apply orig paths))] | |
| (binding [*out* *err*] | |
| (println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime) t) 1000000.0) paths) |
| (defproject jetty-async "0.1.0-SNAPSHOT" | |
| :description "FIXME: write description" | |
| :url "http://example.com/FIXME" | |
| :license {:name "Eclipse Public License" | |
| :url "http://www.eclipse.org/legal/epl-v10.html"} | |
| :dependencies [[org.clojure/clojure "1.7.0"] | |
| [com.ninjudd/ring-async "0.2.0"]]) |
| # | |
| # https://gist.github.com/mping/29e779669071baa88c4c | |
| # make a url like this, for PRs: | |
| # https://github.com/Company/repo/compare/master...BRANCH?expand=1 | |
| # https://repo.gitlab.com/Company/repomerge_requests/new?utf8=%E2%9C%93&merge_request%5Bsource_project_id%5D=25&merge_request%5Bsource_branch%5D=BRANCh&merge_request%5Btarget_project_id%5D=25&merge_request%5Btarget_branch%5D=master | |
| # | |
| # > makepr master | |
| # will generate the url for a PR from the current branch to master |
| // Nice trick when you don't know where a change comes from | |
| // rewrites a property, and sets a debugger when the property changes | |
| console = console || {}; // just in case | |
| console.watch = function(oObj, sProp) { | |
| var sPrivateProp = "$_"+sProp+"_$"; // to minimize the name clash risk | |
| oObj[sPrivateProp] = oObj[sProp]; | |
| // overwrite with accessor |