Skip to content

Instantly share code, notes, and snippets.

View sfxworks's full-sized avatar
🎯
Focusing

Samuel Walker sfxworks

🎯
Focusing
View GitHub Profile
@xandout
xandout / README.md
Last active March 9, 2024 17:42
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

import time
print "..."
time.sleep(1)
print "..."
print "..."
print "..."
print "..."
time.sleep(1)
print "..."
@yellowcrescent
yellowcrescent / k8s-coreos-setup.md
Last active December 17, 2018 21:32
CoreOS Kubernetes cluster setup at Digitalocean

Notes on setting up a Kubernetes cluster on CoreOS (stable) with DigitalOcean's platform.

Partially stolen from this guide by kevashcraft

Spin up VMs

  • Spin up 4 VMs with CoreOS Stable. One will be the master, the other 3 will be workers
  • Tag them with k8s:master and k8s:worker respectively, along with a tag for the cluster
  • Droplets can be created via your DO control panel, or by using doctl. Just change the CLUSTER_NAME, CLUSTER_DOMAIN, and SSHKEY_ID values below to match your own, then save the file to cluster_create.sh, chmod +x cluster_create.sh, then run it ./cluster_create.sh. If you don't already have doctl setup, it will probably be easier to just do this from the DO control panel if you only need to do a one-time setup for development.
@StephenSorriaux
StephenSorriaux / install-kubernetes-archlinux.md
Created October 25, 2018 18:47
Install Kubernetes on bare-metal ArchLinux host

Installing Kubernetes on ArchLinux

Packages

pacman -S curl docker ebtables ethtool wget unzip

Also cfssl is needed but available on AUR, using pacaur

pacaur -S cfssl
@cheethoe
cheethoe / gist:49d9c1d0003e44423e54a060e0b3fbf1
Last active April 14, 2022 21:01
Rook v0.8.0 device/osd removal
# This will use osd.5 as an example
# ceph commands are expected to be run in the rook-toolbox
1) disk fails
2) remove disk from node
3) mark out osd. `ceph osd out osd.5`
4) remove from crush map. `ceph osd crush remove osd.5`
5) delete caps. `ceph auth del osd.5`
6) remove osd. `ceph osd rm osd.5`
7) delete the deployment `kubectl delete deployment -n rook-ceph rook-ceph-osd-id-5`
8) delete osd data dir on node `rm -rf /var/lib/rook/osd5`
@tanaikech
tanaikech / submit.md
Last active April 17, 2024 11:55
Downloading Shared Files on Google Drive Using Curl

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&amp;id=${fileid}"
@harshavardhana
harshavardhana / nginx-minio-static.md
Last active April 19, 2024 09:33 — forked from koolhead17/gist:4b8dd8d95ec86368634693cf9ad9391c
How to configure static website using Nginx with MinIO ?

How to configure static website using Nginx with MinIO ?

1. Install nginx

2. Install minio

3. Install mc client

4. Create a bucket:

$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.
@low-ghost
low-ghost / client.py
Last active September 8, 2021 11:41
Simple Python to Javascript 2 way unix socket
"""Creates a python socket client that will interact with javascript."""
import socket
socket_path = '/tmp/node-python-sock'
# connect to the unix local socket with a stream type
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client.connect(socket_path)
# send an initial message (as bytes)
client.send(b'python connected')
# start a loop
#!/bin/bash
# This is meant to be executed from packer
if [ -z "$PACKER_BUILD_NAME" ] && [ -z "$PACKER_BUILDER_TYPE" ]; then
echo "Do not run by hand, this is run by packer"
exit 1
fi
export DEBIAN_FRONTEND=noninteractive