Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub Profile
@relaxdiego
relaxdiego / raw-k8s-spec.sh
Created July 25, 2020 11:18
Tried the raw-k8s-spec feature flag. Did not work 😿
# Set up system. There's a problem with Juju 2.8.1 and microk8s 1.18
# So we trick Juju 2.8.1 into thinking it's just connecting to a
# regular kubernetes cluster
sudo snap remove microk8s
sudo snap refresh --channel=2.8/stable juju --classic
sudo snap install --channel=1.18/stable microk8s --classic
sudo snap install --channel=1.18/stable kubectl --classic
sudo microk8s.config > ~/.kube/config
juju add-k8s k8s-1.18 --storage=hostpath
@relaxdiego
relaxdiego / k0s
Last active July 9, 2020 03:12
k0s! It's k1s minus the colors 😿
#!/bin/bash -e
resource=${1:-"pods"}; namespace=${2:-"default"}
watch -c "echo ' _ ___'; echo '| | __/ _ \ ___'; echo '| |/ / | | / __| Namespace: ${namespace}'; echo '| <| |_| \__ \ Resources: ${resource}'; echo '|_|\_\\\\\___/|___/'; echo; kubectl get -n "$namespace" "$resource" ${@:3}
$ microk8s.start
Started.
Enabling pod scheduling
node/dev-18-04-2 already uncordoned
$ microk8s.status | grep istio
istio: disabled
$ cd /tmp
$ curl -L https://istio.io/downloadIstio | sh -

Keybase proof

I hereby claim:

  • I am relaxdiego on github.
  • I am relaxdiego (https://keybase.io/relaxdiego) on keybase.
  • I have a public key whose fingerprint is 9582 71AF 8CA4 BEE9 81DB 8FF5 ABF4 51BF 3048 294B

To claim this, I am signing this object:

@relaxdiego
relaxdiego / gist:be7b87cae8c2d51d5ee4
Last active June 12, 2020 09:44 — forked from dayyan/gist:e62bddc65ce1af735f0f
Setting up git send-email in OS X
  1. Configure Gmail in you gitconfig:
[sendemail]
  smtpserver = smtp.gmail.com
  smtpserverport = 587
  smtpencryption = tls
  smtpuser = <gmail email address>
  from = <email address for From: field>
[2020-02-19T12:31:23.704] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2020-02-19T12:31:23.707] [info] [daemon] dev needs starting. Starting now...
[2020-02-19T12:31:23.717] [info] [dev] process program '/Library/Application Support/com.canonical.multipass/bin/hyperkit'
[2020-02-19T12:31:23.717] [info] [dev] process arguments '-c, 4, -m, 8192M, -u, -A, -H, -U, e77989ed-2175-3e78-b31b-20e477fc5582, -s, 0:0,hostbridge, -s, 2:0,virtio-net, -s, 5,virtio-rnd, -s, 31,lpc, -l, com1,autopty=/var/root/Library/Application Support/multipassd/vault/instances/dev/pty,log=/Library/Logs/Multipass/dev-hyperkit.log, -s, 1:0,ahci-hd,file:///var/root/Library/Application Support/multipassd/vault/instances/dev/ubuntu-18.04-server-cloudimg-amd64.img?sync=os&buffered=1,format=qcow,qcow-config=discard=true;compact_after_unmaps=262144;keep_erased=262144;runtime_asserts=false, -s, 1:1,ahci-cd,/var/root/Library/Application Support/multipassd/vault/instances/dev/cloud-init-config.iso, -f, kexec,/var/root/Librar
[2020-02-18T17:32:13.786] [info] [sshfs-mounts] mounting /Users/mark/src => src in dev
[2020-02-18T17:32:13.786] [info] [sshfs-mounts] process program '/Library/Application Support/com.canonical.multipass/bin/sshfs_server'
[2020-02-18T17:32:13.786] [info] [sshfs-mounts] process arguments '192.168.64.2, 22, ubuntu, /Users/mark/src, src, 501:-1,, 20:-1,'
[2020-02-18T18:38:59.941] [info] [dev] hyperkit: [INFO] Allocator: 149631 used; 0 junk; 0 erased; 255 available; 0 copies; 0 roots; 0 Copying; 0 Copied; 0 Flushed; 0 Referenced; max_cluster = 150458
[2020-02-18T18:38:59.941] [info] [dev] hyperkit: [INFO] Allocator: file contains cluster 0 .. 150713 will enlarge file to 0 .. 151225
[2020-02-18T18:38:59.941] [info] [dev] hyperkit: [INFO] resize: adding available clusters (Node ((x 150714) (y 151225) (l Empty) (r Empty) (h 1) (cardinal 512)))
[2020-02-19T00:32:40.767] [info] [dev] hyperkit: [INFO] Allocator: 150143 used; 0 junk; 0 erased; 255 available; 0 copies; 0 roots; 0 Copying; 0 Copied; 0 Flushed; 0 Referenc
[2020-02-04T01:47:28.257] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2020-02-04T01:47:28.267] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/releases/streams/v1/index.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.273] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.587] [info] [update] Failed to fetch update info: failed to download from 'https://multipass.run/static/latest-release.json': Host multipass.run not found
[2020-02-04T01:47:28.691] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/daily/streams/v1/index.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.692] [warning] [url downloader] Cannot
#
# setup ssh-agent
#
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
@relaxdiego
relaxdiego / golang-tls.md
Last active January 8, 2020 06:46 — forked from denji/golang-tls.md
OpenSSL TLS

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)