Bash often gets ignored in today's cloud centric world but there is a lot of cool stuff you can do just with basic commands, the switches on those commands and piping things together.
To the command line!
So I'm going to start out with some of the more basic commands and some switches that people aren't familiar with and then rapidly get more advanced in both usage and stringing commands together.
Never done this on Twitter before so should be exciting!
Let's start with: ls
# show files in a single column
ls -1
# show files with detail
ls -l
# show files in reverse time order
ls -ltr
# show all hidden files
ls -a
# show files with human readable size and sorted by size
ls -lSh
Up next: cat
# dump all the contents of a file
cat file.txt
# dump with line numbers (useful later)
cat -n
Up next: head and tail
# get first 10 lines of file
head -10 a.txt
# last 10 lines
tail -10 a.txt
# first line of the last 10 lines
tail -10 a.txt | head -1
# keep tailing a file as it updates
tail -f a.txt
Up next: tr
# Switches our characters e.g. swap pipe for newline
tr "|" "\n"
# swap ASCII char \001 for \n, great for people in finance who work with FIX protocol
tr "\001" "\n"
# if there are multiple of char, replace with just one, useful for ps output
tr -s " "
Up next: grep
# find hello in a.txt
grep hello a.txt
# show 2 lines before and 3 lines after match
grep -B 2 -A 3 hello a.txt
# grep for strings in a file
grep -f account.txt a.txt
# just the names of file with match
grep -l hello *.txt
# names and match
grep -H hello *.txt
grep pt2
# recursively search through a dir tree
grep -r hello
# get only the FIRST match in a file
grep -m 1 hello *.txt
# grep and return true if found, false if not. Useful for && commands based on a grep
grep -q hello.txt
# grep output of another command
ls | grep hello
Up next: cut
# from a csv, get all values in the 2nd col
cat a.txt | cut -d"," -f2
Back to the story, so there are several very hard parts about coaching college paintball:
1. Paintball is a sport that rewards things that go against human nature 2. Very few people have played organized, well coached paintball prior to playing in college.
How to do a "make vs buy" decision when you have zero data.
aka "What running professional paintball tournaments at Disney World taught me".
A thread.
So back in the mid 2000's, I was the General Manager for a professional paintball league called Paintball Sports Promotions (PSP).
To give people a sense of scale, here is a picture of our biggest event in 2006, the World Cup:
Some other numbers:
- 10 fields
- 200 teams
- 3,000 players
- 200+ referees and part time staff
- Estimated 40,000 spectators over the course of a week
- The parking lot on the right was 1 of 3 of the available lots
- Total budget for the event was north of $600K
How to build an army of top quality people via Amazon Mechanical Turk. Yes, you read correctly, Mechanical Turk (henceforth referred to as MT).
A thread.
Most people think of MT as "that thing Amazon offers where you have a lot of work that you need humans to do where you pay per task and it works out to be below min wage".
Because they have that mental model they automatically equate MT to "low quality" which is wrong...
What most people don't know is that MT gives you the option to save and rank how the people (aka Turkers) performed when doing your tasks (aka HITs).
You can also offer up HITs to your saved Turker lists as well.
Given the above, I'm going to lay out how to build your army...
Back in the early 2000's, I worked for a firm that was responsible for investigating TV Smart Card hacking for a major satellite provider.
Here are some of the highlights of how we tracked and caught some of the hackers.
A thread.
So for those of you not familiar with how satellite TV worked back then here is some background.
- The provider would "beam" a stream of data (e.g. TV channels etc) from a ground station up to a geosynchronous satellite
- Geosynch was important as you target a country/region
- The satellite would then take that data & "beam" it back down to the area below it (b/c geosync)
- Individual subscribers would have both a dish & a decoder box (dbox) since the stream was encrypted
- The decoders would have a Smart Card(SC) that could decrypt the stream
Inspired by @patio11@RachelTobac@HydeNS33k@holman@sehurlburt here is a list "Quick Things Many People Find Too Obvious To Have Told You Already" aka "Things I wish someone had told me earlier"
I've often heard that #DevOps is all about #empathy and I agree.
As an operations person, the most helpful empathetic developers I ever saw were the ones that were told: "20% of your bonus depends on a rating of you from the Operations people"
I didn't believe this for a long time but you can 100% start a blog, write interesting posts and get people to pay you money to tell you more about what's in those blog posts.
Put another way: there are videos of people putting together Duplo on YouTube with MILLIONS of views.