apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
;; 1) first goto https://console.developers.google.com/start/api?id=gmail | |
;; -- to turn on gmail api for your account | |
;; 2) then create a oauth consent with app name | |
;; 3) then add oauth clientid and download to ./clientsecret.json | |
;; 4) boot run | |
;; -- when running first time a browser will open to accept authorizaton | |
(set-env! :dependencies '[[com.google.apis/google-api-services-gmail "v1-rev34-1.21.0"] | |
[com.google.api-client/google-api-client "1.20.0"] | |
[com.google.oauth-client/google-oauth-client-jetty "1.20.0"]]) |
#!/bin/bash | |
echo "172.217.7.228 www.miguelping.com" >> /etc/hosts |
var electron = require("electron") | |
var Nightmare = require("nightmare") | |
require('nightmare-inline-download')(Nightmare) | |
//$ node xxx.js USER PW | |
// ^ in some shells, that space prevents the cmd to be saved in shell history |
set -g default-terminal "screen-256color" | |
# use C-q for tmux | |
unbind-key C-b | |
set -g prefix 'C-q' | |
# ctrl+arrow up/down in emacs for history | |
set-window-option -g xterm-keys on | |
# Allows for faster key repetition |
# | |
# 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 |
# | |
# shared history: http://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows#3055135 | |
# | |
HISTCONTROL=ignoredups:erasedups # no duplicate entries | |
HISTSIZE=100000 # big big history | |
HISTFILESIZE=100000 # big big history | |
shopt -s histappend # append to history, don't overwrite it | |
#st should be a function to pass args | |
st(){ sublime-text $* |
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 |