This document is still a scratch
You’ll want a directory to do this in so that you don’t screw up your machine.
#!/bin/sh | |
# http://d.hatena.ne.jp/jeneshicc/20110215/1297778049 | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.tar.xz) tar xvJf $1 ;; | |
*.bz2) bunzip2 $1 ;; |
#!/bin/sh | |
# Enable and disable HDMI output on the Raspberry Pi | |
is_off () | |
{ | |
tvservice -s | grep "TV is off" >/dev/null | |
} | |
case $1 in |
#compdef msfconsole | |
# ------------------------------------------------------------------------------ | |
# Copyright (c) 2014 Spencer McIntyre | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# * Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above copyright |
# Extract archives - use: extract <file> | |
# Based on http://dotfiles.org/~pseup/.bashrc | |
function extract() { | |
if [ -f "$1" ] ; then | |
local filename=$(basename "$1") | |
local foldername="${filename%%.*}" | |
local fullpath=`perl -e 'use Cwd "abs_path";print abs_path(shift)' "$1"` | |
local didfolderexist=false | |
if [ -d "$foldername" ]; then | |
didfolderexist=true |
#!/bin/sh | |
# | |
# Import all SSH keys from LP | |
# | |
PREFIX=~ | |
SSH_ASKPASS=$PREFIX/bin/lp-askpass.sh | |
export SSH_ASKPASS | |
# This is needed to force ssh-add to honor our SSH_ASKPASS. | |
DISPLAY=foo | |
export DISPLAY |
#!/bin/sh | |
# | |
# This script is used on a QNAP TS-269 PRO. https://www.en0ch.se/qnap-and-rsync/ | |
# | |
# You have to change: | |
# 1. $SHAREUSR | |
# 2. $EXCLUDES (if you want o change the name of the file servername.excludes) | |
# 3. $SOURCE & $DESTINATION | |
# 4. [email protected] for the mysqldump | |
# 5. --password=SUPERSECRET |
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
function prompt_wikimatze_precmd { | |
git-info | |
} | |
function prompt_wikimatze_setup { | |
setopt LOCAL_OPTIONS | |
unsetopt XTRACE KSH_ARRAYS | |
prompt_opts=(cr percent subst) | |
# Load required functions. |
#!/bin/sh | |
### | |
### Example usage of common commands | |
### | |
# pwd | |
# ls # it's empty | |
# cd /var/log # there are some files | |
### |