Skip to content

Instantly share code, notes, and snippets.

mike fettis ridingintraffic

Block or report user

Report or block ridingintraffic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ridingintraffic
ridingintraffic / ASS.md
Created Sep 23, 2019 — forked from klaaspieter/ASS.md
Acronyms Seriously Suck - Elon Musk
View ASS.md

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.

View ansible-lab
- 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
View allfacebook
############################################
# 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
#
View install 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
View env_python_docker
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
View a_secret_demo
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 Jan 13, 2019
openvpn as a systemd service with PS1 alerting
View 01 - hidden.ovpn
.....
.....
auth-user-pass /home/linuxuser/pass.txt
View list batching
<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 Jan 8, 2019
quick and dirty one line to dedup a list
View python set
>>> 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 Dec 23, 2018
in case of fire
View 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` {} \;
}
You can’t perform that action at this time.