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>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sidebar HTML Template</title>
<style type="text/css">
#nav {
@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 / Profile.ps1
Last active February 16, 2023 20:19
my crossplatform PowerShell Profile
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# src: https://gist.github.com/apfelchips/62a71500a0f044477698da71634ab87b
# New-Item $(Split-Path "$($PROFILE.CurrentUserCurrentHost)") -ItemType Directory -ea 0; Invoke-WebRequest -Uri "https://git.io/JYZTu" -OutFile "$($PROFILE.CurrentUserCurrentHost)"
# ref: https://devblogs.microsoft.com/powershell/optimizing-your-profile/#measure-script
# ref: Powershell $? https://stackoverflow.com/a/55362991
# ref: Write-* https://stackoverflow.com/a/38527767
# Write-Host wrapper for Write-Information -InformationAction Continue