Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- documentation: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa753582(v=vs.85)# -->
<!-- firefox extra html attributes: https://github.com/Chocobo1/slim_bookmarks/blob/gh-pages/js/slim_bookmarks.js -->
<!-- firefox place: URI https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Places_query_URIs -->
<!-- completely overrides firefox bookmarks -->
<!-- check for dead links: wget --no-config --spider --no-verbose --no-recursive --force-html -i $XDG_CONFIG_HOME/firefox/bookmarks.html -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>Bookmarks</title>
@apfelchips
apfelchips / sync-down-ftp.ps1
Last active May 11, 2021 08:10
lftp script, but it's actually crossplatform
#!/usr/bin/env pwsh -noLogo -noProfile
# get lftp for windows here: https://nwgat.ninja/lftp-for-windows/
# doc: https://manpages.debian.org/lftp/lftp.1.en.html
$USER=''
$PASS=''
$REMOTEHOSTNAME=''
$LOCALDIR='./homedir-subfolder'
$REMOTEDIR='/var/www/'
@apfelchips
apfelchips / ngrok.service
Last active August 2, 2021 14:38
autostart ngrok with systemd - put binary and ngrok.yml into /opt/ngrok/
# put me in: /etc/systemd/system/
# ngrok binary: https://ngrok.com/download
# sudo chmod +x /opt/ngrok/ngrok
[Unit]
Description=ngrok
After=network.target
[Service]
ExecStart=/opt/ngrok/ngrok start --all --config /opt/ngrok/ngrok.yml
ExecReload=/bin/kill -HUP $MAINPID
@apfelchips
apfelchips / nginx.conf
Last active August 17, 2021 08:36
generic nginx.conf template
# src: https://git.io/J3aWK
# doc: https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/
# example: https://www.nginx.com/resources/wiki/start/topics/examples/full/#nginx-conf
# example: https://gist.github.com/terrywang/9612069
user user staff; ## Default: nobody
worker_processes auto; ## Default: 1
#error_log logs/error.log;
#error_log logs/error.log notice;
@apfelchips
apfelchips / add-ssh-keys.yml
Created March 29, 2022 21:04 — forked from EntropyWorks/add-ssh-keys.yml
Add all the hosts from your ansible inventory to your .ssh/known_hosts and also use ssh-copy-id to add keys to the hosts
---
# Original idea found at http://stackoverflow.com/a/39083724
#
# ansible -i inventory.ini add-ssh-keys.yml
#
- name: Store known hosts of 'all' the hosts in the inventory file
hosts: localhost
connection: local
vars:
ssh_known_hosts_command: "ssh-keyscan -T 10"
@apfelchips
apfelchips / serv.py
Last active December 15, 2022 16:11 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python3
"""
inspiration:
https://gist.github.com/phrawzty/62540f146ee5e74ea1ab?permalink_comment_id=2358615
https://gist.github.com/nitaku/10d0662536f37a087e1b#file-server-py
example:
curl -s -H "X-Something: yeah" localhost:8080
curl --data "{\"this\":\"is a test\"}" localhost:8080
# docs: https://github.com/fsquillace/junest#installation
# git clone https://github.com/fsquillace/junest.git ~/.local/share/junest
if [ $BASH_VERSION ] && [ $JUNEST_ENV ]; then
export debian_chroot="junest"
fi
if [ ! $JUNEST_ENV ] && [ -d "$HOME/.local/share/junest/bin" ]; then
export PATH="$HOME/.local/share/junest/bin:$PATH"
fi
@apfelchips
apfelchips / Brewfile.rb
Last active August 16, 2023 15:34
homebrew bundle file ~/Brewfile
# src: https://gist.github.com/apfelchips/2c42af4b1c10318e5f4d89826324723b
# doc: https://github.com/Homebrew/homebrew-bundle
# to install execute: brew bundle
# to check validity: brew bundle check
# examples:
# https://github.com/ahmetb/dotfiles/blob/master/.Brewfile
# https://github.com/SHxKM/macos-setup/blob/master/Brewfile
@apfelchips
apfelchips / ghidra_processor_docs_downloader.py
Last active October 16, 2023 15:06 — forked from ckuethe/ghidra_processor_docs_downloader.py
Ghidra Processor Documentation Downloader
#!/usr/bin/env python3
# vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab:
import os
import sys
import requests
docs = {
'68000': {
'M68000PRM.pdf': 'https://www.nxp.com/files-static/archives/doc/ref_manual/M68000PRM.pdf',
@apfelchips
apfelchips / cdm_fio.sh
Last active February 5, 2024 23:48 — forked from snizovtsev/cdm_fio.sh
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/usr/bin/env bash
## This script is based on https://unix.stackexchange.com/revisions/480191/9 and https://gist.github.com/snizovtsev/1e57da4bf1cdae16599d59619600ee07
LOOPS=1 #How many times to run each test
SIZE=32 #Size of each test, multiples of 32 recommended for Q32 tests to give the most accurate results.
WRITEZERO=0 #Set whether to write zeroes or randoms to testfile (random is the default for both fio and crystaldiskmark); dd benchmarks typically only write zeroes which is why there can be a speed difference.
QSIZE=$(($SIZE / 32)) #Size of Q32Seq tests
SIZE+=m