View uuid-v1-epoch.js
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
uuid = require('uuid'); | |
options = { | |
clockseq : 0, | |
msecs : 0, | |
nsecs : 0, | |
random : 0 | |
} | |
console.log(uuid.v1(options)) |
View gen-hie-yaml.sh
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
#!/usr/bin/env bash | |
# requirements: yq, awk, stack | |
set -euo pipefail | |
echo "cradle:" | |
echo " stack:" | |
for pkg in `stack ide targets --stdout`; do | |
dir=$(echo $pkg | awk -F: '{print $1}') |
View TypedWatch.hs
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
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module TypedWatch where | |
import Control.Exception.Safe | |
import Data.Aeson | |
import Data.Function ((&)) | |
import Data.Text (Text) | |
import Kubernetes.Client.Watch | |
import Kubernetes.OpenAPI |
View tmux-score.sh
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
curl -s https://cricketapi-icc.pulselive.com/fixtures/8199/scoring | jq -r '(["SA: ", .innings[0].scorecard.runs, "/", .innings[0].scorecard.wkts, " (", .innings[0].overProgress, ") - ", "IND: ", .innings[1].scorecard.runs, "/", .innings[1].scorecard.wkts, " (", .innings[1].overProgress, ")"] | join(""))' |
View privileged-daemonset.yaml
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
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: privileged-ds | |
spec: | |
selector: | |
matchLabels: | |
app: privileged | |
template: | |
metadata: |
View merge-repo.sh
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
git checkout git@github.com:akshaymankar/repo-1 | |
cd repo-1 | |
git remote add repo-2 git@github.com:akshaymankar/repo-2 | |
git fetch repo-2 | |
git merge repo-2/master --allow-unrelated-histories | |
git push origin master |
View alias-kubectl-on-master.sh
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
token=$(cat /var/vcap/jobs/kube-apiserver/config/tokens.csv | grep admin | awk -F, '{print $1}' | xargs echo) | |
alias kubectl="/var/vcap/packages/kubernetes/bin/kubectl -s https://master.cfcr.internal:8443 --token $token --insecure-skip-tls-verify=true" |
View sneakyPrint.hs
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
sneakyPrint :: Show a => a -> a | |
sneakyPrint a = unsafePerformIO $ do | |
print a | |
return a | |
View flyjack.sh
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
#!/bin/bash | |
set -eu | |
print_usage() { | |
echo "Usage: $(basename "$0") <job-url>" | |
} | |
invalid_job_url() { | |
echo "Argument [\"$1\"] isn't a valid job url." |
View lxc-centos
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
#!/bin/bash | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |
NewerOlder