Skip to content

Instantly share code, notes, and snippets.

View davegallant's full-sized avatar
🐧
coding

Dave Gallant davegallant

🐧
coding
View GitHub Profile
@gmurdocca
gmurdocca / socat_caesar_dpi.md
Last active January 22, 2024 05:08
Circumventing Deep Packet Inspection with Socat and rot13

Circumventing Deep Packet Inspection with Socat and rot13

I have a Linux virtual machine inside a customer's private network. For security, this VM is reachable only via VPN + Citrix + Windows + a Windows SSH client (eg PuTTY). I am tasked to ensure this Citrix design is secure, and users can not access their Linux VM's or other resources on the internal private network in any way outside of using Citrix.

The VM can access the internet. This task should be easy. The VM's internet gateway allows it to connect anywhere on the internet to TCP ports 80, 443, and 8090 only. Connecting to an internet bastion box on one of these ports works and I can send and receive clear text data using netcat. I plan to use good old SSH, listening on tcp/8090 on the bastion, with a reverse port forward configured to expose sshd on the VM to the public, to show their Citrix gateway can be circumvented.

Rejected by Deep Packet Inspection

I hit an immediate snag. The moment I try to establish an SSH or SSL connection over o

@wlonkly
wlonkly / debugging.md
Last active July 8, 2021 15:13
Steps I took to troubleshoot a full disk

I wrote this down after I responded to a page today (a holiday) because it would've been a decent pairing opportunity for a couple of new people on my team. Second best is that people can read what I did afterwards and ask me any questions. And then I realized that there's nothing PagerDuty-specific or confidential in here, so I may as well share it wider. It's hardly an epic incident, but it's a good example of "doing the work", I think. I borrowed the "write down what you learned" approach from Julia "b0rk" Evans. It's a fantastic practice.

The PagerDuty incident: "Disk will be full in 12 hours. device:/dev/nvme0n1p1, host:stg-nomadusw2-client-..."

(Note for non-PD readers: We run Nomad where others might run Kubernetes.)

Here's the process I went through.

  • Noticed that the usual docker system prune -a -f didn't resolve it
  • Tried docker system prune -a -f and it cleared up 0B
@triangletodd
triangletodd / README.md
Last active April 23, 2024 00:51
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@Xenthys
Xenthys / pct-enter.sh
Last active January 1, 2024 22:10
A helper for Proxmox's "pct enter" to use containers' hostnames and enter them from any cluster node.
#!/bin/bash
id=$(grep "$1" /etc/pve/.rrd | cut -d'/' -f 2 | cut -d':' -f 1)
[[ "$id" == '' ]] && echo "The specified LXC does not exist." && exit 1
node=$(grep "^\"$id\":" /etc/pve/.vmlist | cut -d'"' -f 6)
[[ $(hostname) != "$node" ]] && pre="ssh -t $node "
echo "Entering LXC $id on node $node..."
${pre}pct enter $id
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active January 24, 2024 18:35
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.

@brettcannon
brettcannon / steps.yml
Created January 24, 2020 22:56
GitHub Actions steps to cache VS Code stable when running extension tests
- name: Get VS Code versions
run: curl --output vscode-stable-versions.json https://update.code.visualstudio.com/api/releases/stable
- uses: actions/cache@v1
with:
path: .vscode-test/
key: ${{ runner.os }}-vscode-test-${{ hashFiles('vscode-stable-versions.json') }}
restore-keys: |
${{ runner.os }}-vscode-test-
@ryo-ARAKI
ryo-ARAKI / starship.toml
Last active April 28, 2024 23:14
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = ""
[[battery.display]]
threshold = 30
style = "bold red"
@kamek-pf
kamek-pf / alacritty.yml
Last active February 21, 2024 12:20
Gruvbox Material Dark Medium - Alacritty
# Colors (Gruvbox Material Dark Medium)
colors:
primary:
background: '0x282828'
foreground: '0xdfbf8e'
normal:
black: '0x665c54'
red: '0xea6962'
green: '0xa9b665'
@AlainODea
AlainODea / main.tf
Last active February 24, 2024 05:08
Terraform: Latest Amazon Linux 2 encrypted AMI (Terraform v0.11.3, aws provider v1.60.0)
resource "aws_ami_copy" "amazon-linux-2-encrypted" {
name = "${data.aws_ami.amazon-linux-2.name}-encrypted"
description = "${data.aws_ami.amazon-linux-2.description} (encrypted)"
source_ami_id = "${data.aws_ami.amazon-linux-2.id}"
source_ami_region = "${var.region}"
encrypted = true
tags {
ImageType = "encrypted-amzn2-linux"
}
#!/usr/bin/env python3
import asyncio
import time
import aiohttp
START = time.monotonic()