Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / nm_scan.py
Created April 13, 2022 16:06
Ingest CSVs from Cisco Meraki, then filter by IP address, and scan the hosts from the filtered CSV
#!/usr/bin/env python3
import nmap
import pandas as pd
from icecream import ic
from pathlib import Path
# verbose icecream
# ic.configureOutput(includeContext=True)
@pythoninthegrass
pythoninthegrass / articles.json
Created April 17, 2022 02:39
Svelte REPL troubleshooting
{"1":{"title":"USFL 2022 season opener, New Jersey Generals at Birmingham Stallions: Live updates, score, TV, streaming info - CBS Sports","url":"https://www.cbssports.com/general/news/usfl-2022-season-opener-new-jersey-generals-at-birmingham-stallions-live-updates-score-tv-streaming-info/live/","source":"CBS Sports"},"2":{"title":"2022 NBA Playoffs - Betting Tips for Saturday's Game 1 matchups - ESPN","url":"https://www.espn.com/chalk/story/_/id/33746620/2022-nba-playoffs-betting-tips-saturday-game-1-matchups","source":"ESPN"},"3":{"title":"Here's what Biden, Harris and their spouses paid in 2021 taxes - CBS News","url":"https://www.cbsnews.com/news/heres-what-the-president-vice-president-and-their-spouses-earned-and-paid-in-taxes-in-2021/","source":"CBS News"},"4":{"title":"Judge rules Musk's tweets over taking Tesla private were false, investors say - Reuters","url":"https://www.reuters.com/business/autos-transportation/judge-rules-musks-tweets-over-taking-tesla-private-were-false-investors-say-2022-04-16/
@pythoninthegrass
pythoninthegrass / get-oauth2-token-meetup-api
Created May 4, 2022 07:03 — forked from valeriocos/get-oauth2-token-meetup-api
Get a bearer/OAuth2 token for Meetup application-only requests in Python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@pythoninthegrass
pythoninthegrass / clean_code.md
Created May 24, 2022 04:55 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@pythoninthegrass
pythoninthegrass / bootstrap.sh
Last active September 1, 2023 02:15
Working ubuntu cloud-config used with multipass
multipass launch -n testvm -mem --cpu 1 --disk 5G --memory 2G 22.04 --cloud-init ~/.config/cloud-init.yml -v
ip_addr=$(multipass info testvm | awk '/IPv4/ {print $NF}')
ssh "ubuntu@${ip_addr}"
@pythoninthegrass
pythoninthegrass / keychron_q1_custom.json
Created June 15, 2022 20:29
Keychron Q1 Via Config: Solid white backlight, F5 + F11 keys w/o Fn
{
"name": "Keychron Q1",
"vendorProductId": 875823367,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_BRID",
"KC_BRIU",
"USER00",
@pythoninthegrass
pythoninthegrass / config.yml
Last active July 1, 2022 19:30
lazydocker config
# ~/Library/Application Support/jesseduffield/lazydocker/config.yml
gui:
returnImmediately: true
customCommands:
services:
- name: docker-compose
command: docker-compose --env-file=.env up --remove-orphans -d
containers:
- name: bld-meetup
attach: false
@pythoninthegrass
pythoninthegrass / .bashrc
Last active March 9, 2026 21:14
Synology shell config
#/etc/profile: system-wide .profile file for ash.
# shellcheck disable=SC2155
umask 077
export PATH="/volume1/@appstore/git/bin:/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin"
export PGDATA=/var/services/pgsql
export TERMINFO=/usr/share/terminfo
@pythoninthegrass
pythoninthegrass / README.md
Last active April 19, 2025 23:17
sysctl.conf stand-in on macOS 10.15+

com.startup.sysctl.plist

As of at least macOS Catalina 10.15.3, /etc/sysctl.conf values are no longer respected and/or the file straight up doesn't exist (confirmed on macOS Monterey 12.4.)

Ran across a fio shm error: failed to setup shm segment while benchmarking SSDs. The fix was to set shmmni to 4096. The following has to happen:

  • Disable SIP
    • Disclaimer from Apple

      Warning

      Disable SIP only temporarily to perform necessary tasks, and reenable it as soon as possible. Failure to reenable SIP when you are done testing leaves your computer vulnerable to malicious code.

@pythoninthegrass
pythoninthegrass / quickemu_3.16-beta
Created August 1, 2022 02:07
Patched quickemu from @trollkarlen's macOS fork
#!/usr/bin/env bash
export LC_ALL=C
if ((BASH_VERSINFO[0] < 4)); then
echo "Sorry, you need bash 4.0 or newer to run this script."
exit 1
fi
# Check for gnu tools on MacOS
UNAME="uname"