Skip to content

Instantly share code, notes, and snippets.

View dschep's full-sized avatar

Daniel Schep dschep

View GitHub Profile
@Kilian
Kilian / annoying.js
Created January 6, 2011 15:04
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@rsvp
rsvp / netspeed.sh
Last active May 13, 2020 15:08
netspeed.sh : check download speed rate via command line | Linux bash script
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
@Angles
Angles / some iOS browser URI launching JS snippets.js
Last active October 8, 2023 18:57
"Open In" Bookmarklets for iOS
/* WITH MODS TO ORIG -- iOS Browser Bookmarklets to launch other apps and stuff */
/* ver 2014-04-14a */
/* backing up my "Open In" bookmarks */
// note iOS6 requires some changes to these
// BEGIN TESTING STUFF -- IN PROFRESS LIKELY NOT WORKING
// SOME WORK, MOST tests are not WORK --
// PINNER APP TEST STUFF (as a private one)
// the page title as the title and your selected text as the description.
Copied from http://www.programmierecke.net/howto/gpg-ssh.html
Saved here for posterity.
Tested with Yubikey NEO in 0x82 mode.
with smartcard (openpgp)
Some Links
Using Smartcard with Windows (Putty): Pageant for Putty with smartcard support
step by step
@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@shovon
shovon / increase_swap.sh
Created April 10, 2015 15:18
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@gene1wood
gene1wood / example_aws_lambda_cloudformation_context.md
Last active January 4, 2023 06:41
Details on the AWS Lambda Python LambdaContext context object when instantiated from a CloudFormation stack

LambdaContext

Here is the raw output from examining the Python LambdaContext context object in a AWS Lambda function when called from a CloudFormation stack. More information on the context object can be found here : http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

LambdaContext object : print(context)

<__main__.LambdaContext object at 0x7fd706780710>

LambdaContext vars : vars(context)

@dschep
dschep / fix-apple-kbd.sh
Created November 25, 2015 15:23
Swap Alt & Meta and default to Fkeys not media keys
#!/bin/bash
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
@gbaman
gbaman / HowToOTG.md
Last active May 2, 2024 01:27
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

@dschep
dschep / bootlocal.sh
Last active March 4, 2016 21:41
Workaround bug in Linux boot2docker hosts not mounting home dirs (boot2docker/boot2docker#1085)
#!/bin/sh
# Work around for boot2docker/boot2docker#1085
# Extracted from boot2docker/boot2docker#1086
mkdir -p /hosthome
mount | grep -q /hosthome || mount -t vboxsf hosthome /hosthome \
-o defaults,uid=$(id -u docker),gid=$(id -g docker)
ls -1 /hosthome | while read d
do