Skip to content

Instantly share code, notes, and snippets.

@gbaman
gbaman / HowToOTG.md
Last active October 3, 2025 07:37
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

@windows98SE
windows98SE / api.py.patch
Created May 23, 2015 15:18
[fix] LINE API function login ( api.py ) / new examples
@@ -55,7 +55,21 @@
After login, make `client` and `client_in` instance
to communicate with LINE server
"""
- raise Exception("Code is removed because of the request of LINE corporation")
+
+ self.transport = THttpClient.THttpClient(self.LINE_HTTP_URL)
+ self.transport_in = THttpClient.THttpClient(self.LINE_HTTP_IN_URL)
+
+ self.transport.setCustomHeaders(self._headers)
#!/bin/bash
# Slightly modified version from https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh
# Run with sudo ./openvpn-install.sh and not sudo sh ./openvpn-install.sh as read command has issues with external triggering of scripts
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and
# universal as possible.
@worawit
worawit / cve-2015-0240_samba_exploit.py
Created April 10, 2015 14:48
Exploit for Samba vulnerabilty (CVE-2015-0240)
#!/usr/bin/python
"""
Exploit for Samba vulnerabilty (CVE-2015-0240) by sleepya
The exploit only targets vulnerable x86 smbd <3.6.24 which 'creds' is controlled by
ReferentID field of PrimaryName (ServerName). That means '_talloc_zero()'
in libtalloc does not write a value on 'creds' address.
Reference:
- https://securityblog.redhat.com/2015/02/23/samba-vulnerability-cve-2015-0240/
@nazt
nazt / makefile
Last active August 29, 2015 14:15
pcmmakerclub.blinky.c
PROJECT_NAME := blinky_blank_pcmmakerclub
export OUTPUT_FILENAME
#MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
MAKEFILE_NAME := $(MAKEFILE_LIST)
MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
TEMPLATE_PATH = ../../../../../../components/toolchain/gcc
ifeq ($(OS),Windows_NT)
@nazt
nazt / fix-ft232.sh
Last active August 29, 2015 14:15
fix-ft232.sh
#!/bin/bash
sudo apt-get install -y make gcc libftdi-dev
cd;
if [[ ! -d ft232r_prog-1.24 ]]; then
wget -q http://cmmakerclub.com/lab/files/ft232r_prog-1.24.tar.gz -O- | tar xvz;
fi
pushd ft232*
make
@llun
llun / .profile
Last active August 29, 2015 14:04
Shell alias for Docker
docker_get_name_from_image() {
echo $@ | sed "s/\//./"
}
docker_remove_exists_name() {
local name=`docker_get_name_from_image $2`
local exists=`sudo docker ps -a | grep $name | awk '{ print $1 }'`
if [ -n "$exists" ]; then
sudo docker rm $name > /dev/null 2>&1
fi
@laurenorsini
laurenorsini / server.conf
Last active June 2, 2023 15:45
OpenVPN configuration for /etc/openvpn/server.conf
local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto udp #Some people prefer to use tcp. Don't change it if you don't know.
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!
server 10.8.0.0 255.255.255.0
# server and remote endpoints
@jkent
jkent / rm04-tool.html
Created June 10, 2013 12:02
Another backdoor for the rm04, need I say any more?
<html>
<head>
<title>HLK-RM04 Tool</title>
<style>
form {
display: inline;
}
</style>
</head>
@lukmdo
lukmdo / siteUptimeMonitor.js
Created July 29, 2012 12:09
google apps script=js
var ONE_S = 1000,
ONE_M = 60*ONE_S,
ONE_H = 60*ONE_M,
RUN_EVERY = 5*ONE_M,
SLEEP_TIME = 30*ONE_M,
CHECK_URL = 'http://www.SITE.com',
NOTIFY_MAIL = 'EMAIL@EMAIL.com',
NOTIFY_CALENDAR = 'ID_OF_YOUR_GOOGLE_CALENDAR@group.calendar.google.com';