Skip to content

Instantly share code, notes, and snippets.

@gbaman
gbaman / HowToOTGFast.md
Last active April 16, 2024 06:29
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

#!/usr/bin/python
'''
A tidier version of this can be found here https://github.com/rwky/Compare-git-branches
Copyright (c) 2012 Rowan Wookey <admin@rwky.net>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@rwky
rwky / com.rwky.dont_reopen_windows_at_login.plist
Created October 6, 2011 01:36
Don't reopen windows at login plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
Put this file as /Library/LaunchDaemons/com.rwky.dont_reopen_windows_at_login.plist
then run sudo chown root:wheel /Library/LaunchDaemons/com.rwky.dont_reopen_windows_at_login.plist
When you reboot, regardless of if the reopen windows at login is ticket they won't reopen
-->
<dict>
<key>Label</key>
@rwky
rwky / toggle_saved_states.sh
Created October 5, 2011 20:28
Enables/disables application saved states on OSX Lion the right way
#!/bin/bash
#Copyright 2011 Rowan Wookey https://github.com/rwky
#Released under the MIT License http://www.opensource.org/licenses/MIT
#enabled/disables application saved states in osx lion
#most tools with guis seem to lock the "Saved State" folder in
#~/Library/Saved Application State/ however not all apps
#save states there (Preview for example doesn't)
#this script uses the apple preferences to disable it which
#works on any app. To use it simply execute the script in Terminal
#with the path the the application as the first argument