Skip to content

Instantly share code, notes, and snippets.

View sudocurse's full-sized avatar
🌮
good screen ? bad screen

sudocurse sudocurse

🌮
good screen ? bad screen
View GitHub Profile
@sudocurse
sudocurse / macbook_pro_specs.csv
Created May 14, 2024 01:34
Macbook pro specs 2024-05-13
name model-id apple-model-no apple-order-no apple-subfamily introduction-date discontinued-date original-price-us est--current-retail details architecture efi-architecture processor processor-speed processor-type processor-upgrade turbo-boost custom-speeds processors cache-bus-speed fpu l1-cache l2l3-cache system-bus-speed ram-type ram-slots maximum-ram min--ram-speed motherboard-ram maximum-vram vram-type standard-ram standard-vram standard-storage storage-interface storage-dimensions std--storage-speed standard-disk built-in-display native-resolution 2nd-display-support 2nd-max--resolution video-card video-monitor battery-type battery-life dimensions avg--weight form-factor case-type power power-adapter security-lock usb usb-ports firewire firewire-ports ethernet standard-ethernet standard-bluetooth standard-airport modem standard-modem s-video-input s-video-output headphone microphone sound-in sound-out joystick-pc serial-standard serial-geoport scsi adb floppy-ext incl--input incl--keyboard expansion-bays
#!/bin/bash
#
# Outputs JSON paths.
#
# Based on https://news.ycombinator.com/item?id=20264654
#
# Usage:
# curl -s https://raw.githubusercontent.com/sitepoint-editors/json-examples/master/src/db.json | ./jsonpaths
jq -r --stream '
@sudocurse
sudocurse / proxydhcp.sh
Last active May 12, 2020 12:40
pxe + webproc without fucking up your local dhcp
#!/bin/bash
# Sets up a standalone proxyDHCP server, to PXE netboot, as a container made
# from https://github.com/jpillora/webproc to get a web ui on port 8080 to edit
# conf + monitor logs. You could probably swap out the container and the config
# and most of this script would still be good.
#
# The actual container used is https://hub.docker.com/r/jpillora/dnsmasq
# There's a screenshot on that page.
#
# Notes:
@sudocurse
sudocurse / fd.py
Last active October 22, 2019 06:58
macos default fd ulimit is 256. why do i see 252?
import tempfile
files = []
while True:
try:
file = tempfile.TemporaryFile()
print("Created file:", file, file.name)
files.append(file)
except OSError:
@sudocurse
sudocurse / jsEventOrder.html
Created March 4, 2019 21:00
javascript event order for an onclick
<html>
<body>
<div id="elem1">
<div id="elem2">
Hi
</div>
</div>
<script>
count = 0;
ha = function(obj){
@sudocurse
sudocurse / sorted
Last active November 22, 2018 22:57
monitor deals
Category Brand+Model Size Price Link
Ultrawide Dell U3417W 34" $645 https://www.amazon.com/Dell-FR3PK-34-Inch-Led-Lit-Monitor/dp/B01IOO4TIM/ref=cm_cr_arp_d_product_top?tag=slickdeals&ascsubtag=6c93cbdeeea411e8af96b213d4e1265c0INT&ie=UTF8
Gaming Asus ROG Swift PG279Q 27" $590 newegg refurb https://slickdeals.net/f/11322175-refurbished-asus-rog-pg279q-g-sync-1440p-gaming-monitor-ips-27-amp-quot-589-99-with-free-free-krazilla-power-bank-w-purchase?src=SiteSearchV2_SearchBarV2Algo1
Ultrawide Acer XR342CK bmijqphuzx 34" $551 https://slickdeals.net/f/11282031-acer-xr2-series-xr342ck-34-quot-ips-1ms-mprt-hdmi-widescreen-led-backlight-lcd-led-monitor-551?src=SiteSearchV2_SearchBarV2Algo1&fbclid=IwAR1U-2gLRMrWI5bwuyCbgr1HXURcRYmjfw2KsuBUVhqR-Tic780FDo2fLXg
4K BenQ PD3200U 32" $51
@sudocurse
sudocurse / enable_root.sh
Created June 26, 2018 17:58
sudo access on wheel-supported systems
# add user to the sudo users group
sudo usermod $1 -G wheel
# generate a 16 byte key and print it
key=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
echo $key
# set the users password to that key and expire it so they have to change it when they login
sudo sh -c "echo $key | passwd --stdin $1"
sudo passwd -e $1
@sudocurse
sudocurse / make_user.sh
Created June 26, 2018 17:52
make a user, give them key access
#!/bin/bash
# consume the first argument so we can deal with the key as one variable
username=$1
shift
sudo useradd $username
sudo -u $username mkdir /home/$username/.ssh/
sudo -u $username touch /home/$username/.ssh/authorized_keys
sudo chmod 640 /home/$username/.ssh/authorized_keys
@sudocurse
sudocurse / osx_syscall_probes.txt
Last active September 11, 2017 03:03
OSX DTrace Probes
# sudo dtrace -lvi "syscall:::" 2>&1 >/dev/null | grep syscall | tr -s " " | cut -d" " -f 4 | uniq > osx_syscall_probes.txt
syscall
exit
fork
read
write
open
close
wait4
#8