Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# NOTE: This script uses tabs for indentation
errcho() {
echo "$@" >&2
}
USAGE="Usage: $0 [keyboard[:keymap[:target]]]"
# Check preconditions
@ridingintraffic
ridingintraffic / ASS.md
Created September 23, 2019 15:47 — forked from klaaspieter/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@ridingintraffic
ridingintraffic / allfacebook
Last active March 14, 2019 02:11
distractions
############################################
# To Completely Block Facebook
# Add these entries below to your hosts file
#
# Your hosts file Location:
# Linux, Unix and Mac OS X -> /etc/hosts
# Windows XP, Vista, Windows 7, 8.0, 8.1, 10 -> C:\WINDOWS\system32\drivers\etc\hosts
# Windows 2000 -> C:\WINNT\system32\drivers\etc\hosts
# Windows 98/ME -> C:\WINDOWS\hosts
#
Python:
import os
print(os.environ['USERNAME'])
print(os.environ['PASSWORD'])
Docker:
docker run --env USERNAME=$USERNAME --env PASSWORD=$PASSWORD -- name docker-nginx -p 8080:80 -d nginx
ap42:secrets user$ cat test
USERNAME=zerocool
PASSWORD=crash_override
ap42:secrets user$ ./secret.sh test
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:
ap42:secrets user$ ls
secret.sh test.enc
@ridingintraffic
ridingintraffic / 01 - hidden.ovpn
Last active January 13, 2019 02:55
openvpn as a systemd service with PS1 alerting
.....
.....
auth-user-pass /home/linuxuser/pass.txt
<begin python script>
# test.py
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
all_ids = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
chunked_list_ids=chunks(all_ids,5)
@ridingintraffic
ridingintraffic / python set
Created January 8, 2019 02:51
quick and dirty one line to dedup a list
>>> all_ids = [1,2,3,4,5,1,2,7,8,3,4,5]
>>> print all_ids
[1, 2, 3, 4, 5, 1, 2, 7, 8, 3, 4, 5]
## create a set passing in the list and then returning a list
>>> deduped_ids = list(set(all_ids))
>>> print deduped_ids
[1, 2, 3, 4, 5, 7, 8]
`:mic_drop:`
@ridingintraffic
ridingintraffic / FIRE
Created December 23, 2018 03:50
in case of fire
function FIRE()
{
find ~/git/github/$(whoami) -maxdepth 1 -mindepth 1 -type d -exec cd {} \; -exec git pull {} \; -exec git add --all {} \; -exec git commit -a -m "firesale" {} \; -exec git push origin `git rev-parse --abbrev-ref HEAD` {} \;
}