Skip to content

Instantly share code, notes, and snippets.

View benharri's full-sized avatar
💭
why is this a thing

Ben Harris benharri

💭
why is this a thing
View GitHub Profile
<Query Kind="Program">
<Namespace>System.Security.Cryptography</Namespace>
<Namespace>LINQPad.Controls</Namespace>
<AutoDumpHeading>true</AutoDumpHeading>
</Query>
DumpContainer results = new();
DumpContainer notice = new();
DumpContainer byteCount = new();
StringBuilder sb = new();

hoot

honk!

@benharri
benharri / Program.cs
Last active April 4, 2022 17:13
ircpuzzles 2021 08
namespace morse;
public enum Morse
{
Dot,
Dash,
Space,
WordSeparator,
None
}
### Keybase proof
I hereby claim:
* I am benharri on github.
* I am bharris (https://keybase.io/bharris) on keybase.
* I have a public key ASC-5TnEOCQ1QLf9A9p_sH4_G2VPj20VjXuLQCx4Y9uhwwo
To claim this, I am signing this object:
#!/bin/bash
rsync -aHxv --numeric-ids \
--exclude=/etc/fstab \
--exclude=/etc/network/* \
--exclude=/proc/* \
--exclude=/tmp/* \
--exclude=/sys/* \
--exclude=/dev/* \
--exclude=/mnt/* \
#!/usr/bin/env bash
ssh tilde.team -- unshadow /etc/passwd /etc/shadow \
| awk -F : '{printf("%s:%s:%s:%s::0:0:%s:%s:%s\n", $1,$2,$3,$4,$5,$6,$7); }' > new_passwd
last_user=$(tail -n1 /etc/passwd | cut -f1 -d:)
sed -i "" "1,/^${last_user}/d" new_passwd
if [[ $(wc -l < new_passwd) -lt 1 ]]; then
echo no new users
# on tilde.team as root
unshadow /etc/passwd /etc/shadow > linux_passwd
cat linux_passwd | awk -F : '{printf("%s:%s:%s:%s::0:0:%s:%s:%s\n", $1,$2,$3,$4,$5,$6,$7); }' > new_passwd
# edit new_passwd to include only new users
# now on bsd box, switch to root shell
scp tilde.team:/root/new_passwd .
cat new_passwd >> /etc/master.passwd
pwd_mkdb -p /etc/master.passwd
#!/bin/bash
ssh tilde.team "awk -F: '($3>=500) && ($3!=65534)' /etc/passwd" > /tmp/passwd.new
ssh tilde.team "awk -F: '($3==100) && ($3!=65534)' /etc/group" > /tmp/group.new
ssh tilde.team "awk -F: '($3>=500) && ($3!=65534)' /etc/passwd | grep -f - /etc/shadow" > /tmp/shadow.new
cat /tmp/passwd.new | awk -F : '{printf("%s:%s:%s:%s::0:0:%s:%s:%s\n", $1,$2,$3,$4,$5,$6,$7); }' > /tmp/masterpasswd.new
cat /tmp/passwd.new >> /etc/passwd && sort -u /etc/passwd > /etc/passwd
cat /tmp/group.new >> /etc/group && sort -u /etc/group > /etc/group
cat /tmp/shadow.new >> /etc/shadow && sort -u /etc/shadow > /etc/shadow
function scr
set -l filename ~/Pictures/scr_(date +%s).png
maim -s $filename
scp $filename thor:pub/screenies/. >/dev/null
echo -n "https://bhh.sh/pub/screenies/"(basename $filename) | xclip -selection clipboard
xclip -selection clipboard -o
end
[Unit]
Description=The Lounge IRC client
After=thelounge.service
[Service]
Type=simple
ExecStart=/home/ben/workspace/thelounge/index.js start
User=ben
Group=ben
Restart=always