Skip to content

Instantly share code, notes, and snippets.

@markstinson
markstinson / mkgitrepo.sh
Last active August 22, 2022 16:01
Personal ssh+git repository -- no gitolite3, gitea, gogs, gitlab -- just the minimal
#!/usr/bin/env bash
# I call this script ~/bin/mkgitrepo.sh
# You could make a git:git if desired -- gitolite3 without management.
# Make sure your SSH Keys are set as necessary.
# If you want a differnt set of keys just for git, make sure the
# pub keys are added/removed from your ~/.ssh/authorized_keys
my_new_repo="${1}"

How to install Homebrew package manager on Steam Deck

You can install Homebrew (a package manager for macOS and Linux) without disabling the read-only partition with sudo steamos-readonly disable.
The package manager can be used alongside Flatpaks. Some software is only available on Flathub, and some software is only available on Homebrew.

  1. Switch to desktop mode (hold power button until a menu appears, then select "Switch to desktop mode")
  2. Click the logo at the bottom left, go to System, then go to Konsole
  3. Set a password (needed for sudo access):
    passwd
@markstinson
markstinson / raspi-config.txt
Last active August 20, 2022 16:55 — forked from damoclark/raspi-config.txt
Simple Raspbian Configuration Tool. Add file to boot partition of SD Card and run single command after booting Raspbian.
#/bin/sh
#
# Don't change the following lines unless you know what you are doing
# They execute the config options starting with 'do_' below
grep -E -v -e '^\s*#' -e '^\s*$' <<END | \
sed -e 's/$//' -e 's/^\s*/\/usr\/bin\/raspi-config nonint /' | bash -x -
#
############# INSTRUCTIONS ###########
#
# Change following options starting with 'do_' to suit your configuration
@markstinson
markstinson / web-servers.md
Created February 18, 2019 23:10 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@markstinson
markstinson / FB-ad-exclude-for-GA.txt
Last active February 16, 2019 16:34 — forked from mweber-ak/README.txt
Facebook Ad Approval Bot Exclusion for Google Analytics
Enter this text as a filter for your views.
This will stop the massive spikes of fake traffic that occur from Facebook's bots when you create new Facebook Ads.
Go to Admin > Filters > Set a New Custom Filter > Exclude > IP Address
In the Filter Pattern enter:
^173\.252\.96\.([0-9]|1[0-9])$|^173\.252\.88\.([0-9]|1[0-9]|2[0-1])$|^173\.252\.64\.([0-9]|1[0-9])$
NOTE: Test on a different view first to ensure data lossage will not occur. I'm not responsible if it does.
@markstinson
markstinson / adblock
Created July 1, 2018 02:12 — forked from someon/adblock
adblock for OpenWrt
#!/bin/sh /etc/rc.common
START=90
H1='http://www.malwaredomainlist.com/hostslist/hosts.txt'
H2='http://winhelp2002.mvps.org/hosts.txt'
H3='http://sysctl.org/cameleon/hosts.win'
H4='http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext'
@markstinson
markstinson / HowToOTG.md
Created April 23, 2018 04:24 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@markstinson
markstinson / myusbgadget
Created April 12, 2018 03:14 — forked from geekman/myusbgadget
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@markstinson
markstinson / README.md
Created March 17, 2018 20:18 — forked from Gadgetoid/README.md
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.