Navigation Menu

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 / ..setup.sh
Last active January 20, 2020 18:26
dotfiles!
#!/bin/bash
#..setup.sh . double dots because gist, gets auto sorted (ugh)
# Hi im a penguin
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ]
then
# this is handled is submodoules
#git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
#create symlinks
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
// Need to connec to the wifi somehow, set it up here
WiFiClient wifiClient;
String esid = "yournetwork";
String epass = "password";
// splunk settings and http collector token
String collectorToken = "8A5020D5-xxxx-xxxx-875A-E881ED0C6ABB";
@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.

- name: "Set up authorized_keys for the root user"
hosts: pi
user: pi
tasks:
- name: Create new ssh key-pair
local_action: command ssh-keygen -t rsa -N "" -q -f ~/test/id_rsa
@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
#
@ridingintraffic
ridingintraffic / install pihole
Last active March 7, 2019 13:46
recipe for pihole
PI install (scroll down for docker)
1. install raspbian lite
2. setup ssh
3. change hostname
4. set static ip on router, see why you changed the hostname now ;)
5. $ curl -sSL https://install.pi-hole.net | bash
6. follow the prompts and get everything turned on.
- set upstream DNS, google 8.8.8.8 or cloudflare 1.1.1.1
- use ipv4, ipv6 comes later
- enable the webinterface, we can script later
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