- Docker on Vagrant
- minikube for Kubernetes cluster
- Vagrantfile
- Memory: more than 2048 RAM
- Docker - Provisioning | Vagrant by HashiCorp to install Docker
# Usage: gq query.txt | |
gq() { | |
if [ ! -f $1 ]; then | |
echo "ERROR: No such file $1" | |
return | |
fi | |
local query=$(cat $1) | |
bash -xc "$(printf "gh api graphql -f query='%s'" "$query")" | |
} |
lcut() { | |
local input | |
if [ -p /dev/stdin ]; then | |
input=$(cat -) | |
else | |
input=$(cat $1) | |
shift | |
fi | |
echo $input | perl -slane '@pairs = /(\w+=?(?:"[^"]*"|[^\s]*))/g; | |
@keys = split /\s+/, $args; |
❯ ruby -v | |
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21] | |
❯ irb -v | |
irb 1.4.1 (2021-12-25) | |
❯ echo n=1 | irb | cat | |
Switch to inspect mode. | |
n=1 | |
/Users/kyanny/.rbenv/versions/3.1.2/lib/ruby/3.1.0/irb/input-method.rb:43:in `winsize': Inappropriate ioctl for device (Errno::ENOTTY) |
#!/bin/bash | |
UUID=$(uuidgen) | |
WORKDIR="$HOME/Desktop/$UUID" | |
mkdir -p "$WORKDIR" | |
osascript -e 'activate application "Slack"' | |
sleep 0.5 | |
i=0 |
#!/bin/bash | |
curl -sLO https://github.com/mike-engel/jwt-cli/releases/latest/download/jwt-linux.tar.gz | |
tar xzf jwt-linux.tar.gz | |
curl -sLO https://github.com/stedolan/jq/releases/latest/download/jq-linux64 | |
mv jq-linux64 jq | |
chmod +x jq | |
app_id=157615 | |
private_key_file=my-tiny-github-app.2021-12-09.private-key.pem |
#!/bin/bash | |
host=$1 | |
if [[ -z $host ]]; then | |
echo "Usage: bash $0 HOSTNAME" | |
exit 1 | |
fi | |
echo | openssl s_client -servername $host -connect $host:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.crt |
#!/bin/bash | |
# Usage: bash graphql.sh < query.txt | |
query=$(cat - | sed -e 's/"/\\"/g' | tr -d '\n') | |
cat <<EOM> query.json | |
{"query":"$query"} | |
EOM | |
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/graphql -d @query.json |
#!/usr/bin/env deno run --allow-net | |
// https://deno.land/manual/examples/http_server | |
// Start listening on port 8080 of localhost. | |
const server = Deno.listen({ port: 8080 }); | |
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`); | |
// Connections to the server will be yielded up as an async iterable. | |
for await (const conn of server) { |
import urllib.request | |
import os | |
import json | |
token = os.getenv('GITHUB_TOKEN') | |
data = { | |
'text': '**hello** __world__', | |
} | |
headers = { | |
'Content-Type': 'application/json', |