Skip to content

Instantly share code, notes, and snippets.

View Kaezon's full-sized avatar

Brett Costabile Kaezon

View GitHub Profile
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@nathanverrilli
nathanverrilli / InstallConsoleFont.ps1
Last active January 26, 2024 15:43
Add a font to the list of permissible console fonts for windows powershell terminal // painlessly edit the relevant registry key
param (
[string]$FontName,
[string]$FontFile,
[switch]$Help
);
function isAdminMode() {
return ([Security.Principal.WindowsPrincipal] `
[Security.Principal.WindowsIdentity]::GetCurrent() `
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@shollingsworth
shollingsworth / find_unsigned_modules.sh
Last active March 31, 2022 16:11
find unsigned modules for current kernel and sign them see https://askubuntu.com/a/988829
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
key="/root/custom_mok.priv"
der="/root/custom_mok.der"
if [[ $(whoami) != "root" ]]; then
echo "This script must be run as root"
exit 1
@shollingsworth
shollingsworth / aws_ssm_ssh_less_connection.md
Created May 12, 2022 16:59
general guide to get a basion no ssh host running on an EC2 instance

~/.ssh/config

Host aws-sshless-basion
    Hostname i-xxxxxxxxxxxx
    IdentityFile ~/.ssh/ssh_key
    ProxyCommand sh -c "aws ssm start-session --profile aws-profile --region us-east-2 --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"

Required Software