Flatten out a directory

find /dir1 -mindepth 2 -type f -exec mv -i ‘{}’ /dir1 ‘;’

take everything scattered throughout subdirectories and put them somewhere else in one big directory

sometimes you need this.

How to populate a ruby/erubis/erb template from a command line

Template test.erb:


account      = “<%= account %>”

ownerorg     = “<%= org %>”

application  = “<%= application %>”

region       = “<%= region %>”

environment  = “<%= environment %>”

service      = “<%= service %>”

node_name_id = “<%= taxonomy %>”

version   = “<%= version %>”

# Populate with values:

erb key=value key=value template.erb >> output.file

erb account=12 org=23 application=34 region=45 environment=56 service=67 taxonomy=89 version=fred test.erb >> myfile.out


account      = “12”

ownerorg     = “23”

application  = “34”

region       = “45”

environment  = “56”

service      = “67”

node_name_id = “89”

version   = “fred”

Cloud Engineer Resume

This may or may not sum up the resume’s we get nowadays:

Flobert Unpronouncable

“Computer engineer with a general-wide focus on cloud computing technologies; specifically, on virtualization, networking, storage, security, automation,

infrastructure as code, private and public cloud offerings. Directly and indirectly involved on the design, implementation, and support of virtual infrastructure

platforms for internal, external and virtual clients, aimed generally at different entities accounting for high-availability, disaster recovery, and scalability. Currently

working on a variety of internal/external/virtual learning and development initiatives by planning and supporting diverse training events for new and existing cloud

engineering practitioners on areas of interest like networking, security, cloud migration, virtualization, containerization, automation, and public cloud


  • buzzword

  • fragment

  • Place I worked at for a week in the 80’s

  • recipe for salsa

  • buzzword

  • incomplete senten

  • tuned carb on ’67 Impala

  • Atention to detial!

  • Punctuation( ,optional( @misused]}

  • Place I was fired from the day I started

  • Angular!

  • Buzzword buzzword

  • Something that happened within 30 feet of me and I’m claiming credit

  • 22 Years experience with AWS!

  • Windows 9 Experience

  • Buzzword buzzword buzzword buzzword

  • Lenox certiffied

Splitting big mp3’s into smaller pieces:

Splitting big mp3’s into smaller pieces:

mp3splt -a -t 15.1 -o Saint\ Death\ -\ Mark\ Dawson-@n -d Saint\ Death\ -\ Mark\ Dawson Saint\ Death\ -\ Mark\ Dawson.mp3

mp3splt -a -t 5.10 -o Lesson_01-@n -d Lesson_01 Lesson_01.mp3

The -a tells mp3splt to auto-adjust the split point with silence detection.

The -t 5.10 tells it to make the files 5 minutes and 10 seconds long since the file is a little over 30 minutes long. (This length may vary a bit due to the -a option).

The -o Lesson_01-@n tells it to name the files as Lesson_01 followed by a track number.

The -d Lesson_01 tells it to put the files in a directory called Lesson_01.

last is input file.mp3

So: mp3splt -a -t 5.10 -o outputfilename-@n -d OutputDirectory InputFilename.mp3

Plot lines no longer allowed:

  • Car won’t start
  • “You don’t understand!”
  • Just play along.
  • “Hide your wrongdoing, no one will ever find out, just keep spinning bigger and bigger lies!” Said every Disney live action kids show ever.
  • Stupid adults
  • Are we done here?/Can I go now?/Can I go home? (just admit that you’re guilty right now)
  • Cops/Military/Doctors that don’t listen to anything ever ever ever
  • Exploding cars/every car accident = fireball of doom
  • Showering at midnight at abandoned campground/mental facility/dorm, you know, like ya do.
  • Maniacal laughing. Constantly. For No. Reason. At. All. Somebody just shoot the fucker.
  • Girls that can’t wink should not try.
  • No one blows kisses, do not try.
  • No eating apples on screen, please. It’s not medieval, and it’s not fun to listen to.
  • Close-miking of anyone eating anything. Do not.
  • “No, no, really, it’s nothing…” from people that should damn well be reporting this shit asap.
  • Professional __________ that know shit about ___________
  • Outright dismissal of clear evidence, and just moving on like no one is going to notice.
  • Stupid dads that can’t change a diaper or wipe a nose or anything beyond grunt
  • Stupid dads that can’t fix anything ever
  • Water does not shoot straight up from a drain. Ever.
  • Don’t check if he’s dead, just assume everything goes as planned.
  • Super-Ultra eyeballs that can see a bulge in a pocket from across town, or spot someone in a crowd from 5 blocks away
  • Super-Ultra hearing so that one guy on the opposite end of a crowded stadium can speak normally, yet address thousands of people. In 1200 B.C.
  • “Look! There he is!” 300 yards away in a crowd. Seriously?
  • Snipers with handguns shooting things miles away
  • Snipers shooting with the barrel hanging out the window
  • Anyone with a handgun hitting anything beyond 50 feet while running
  • Security footage with obvious moves/pans/scans/zooms
  • Asking questions and getting no answers at all or utterly random responses like everyone is crazy
  • Zoom! Enhance!!
  • Ook Ook! Pretty nurse!! Grunt. Grunt. No answer question. Zog rather die. Ok, stepped on nail. With dick. Light bulb in ass cuz I fell on it.
  • For the love of God, WATCH THE ROAD!!! Especially through the intersection with the trucks!
  • Doctors being risky and edgy and almost losing their license every single day
  • Next of kin being in the room during surgery micro-managing the surgeon

bash tip: collapse or parse a big text doc into individual sorted words from columns

Start with list.txt like:

server7858   server7858   server7858   server7858   server7861   server7860   server8310   server8310   server7863   server8311

server7859   server7859   server7859   server7859   server8781   server8676   server8677   server8677   server8679   server8782

Which has duplicates and long lines and crap. Run this:

rm list2.txt

rm list3.txt

for word in `cat list.txt`; do echo $word ; done |sort |uniq >> list2.txt

sed -ibak -e ‘s/ //g’ list2.txt

cat list2.txt |sort|uniq > list3.txt

vi list3.txt

ta da!

if you need word counts and such, pipe it through wc before running uniq

If you need to collapse multi line (multi-line multiline) data like this:


packages.MQSeriesServer.installdate: 1439579830


packages.MQSeriesServer.installdate: 1486575523


Continue reading “bash tip: collapse or parse a big text doc into individual sorted words from columns”

Add user and password to NGINX proxy

Go to:


In the left box (#1) enter a username and password that you want to use like:

willb179   MonkeyBiscuits123

In the right box (#2) click Generate htpasswd content

It will generate a line like this:


Send this encrypted line via Slack or email (the “willb179:$apr1$l9.OI9au$uZaO8fsnfhrNHI7V.Tr52.”)

Remember the password you used!

generate passwords automagically, so users can submit encrypted passwords themselves

vi /etc/nginx/htpasswd

service nginx restart

**** MAKE SURE THE USER ISN’T ALREADY IN THERE!! you will get a constant string of 401 Unauthorized because it picks the FIRST one in the list!

NGINX Config for password protected reverse proxy:

Continue reading “Add user and password to NGINX proxy”

Run ssh commands remotely for one or many or a list of servers


ssh -o “StrictHostKeyChecking no” -t ${server} ‘sudo sed -ibak -e ‘s#https://oldchef.server.com/#https://newchef.server.com/#g’ /etc/chef/client.rb’


for server in server001 server002 server007; do echo ${server} & ssh -o “StrictHostKeyChecking no” -t ${server} ‘sudo sed -ibak -e ‘s#https://oldchef.server.com/#https://newchef.server.com/#g’ /etc/chef/client.rb’ ; done


Continue reading “Run ssh commands remotely for one or many or a list of servers”

Bash case switches

if [[ ${TAG_VALUE}XXX == "XXX" ]]; then

  echo "TAG_VALUE was blank, exiting!"



case @option.Command@ in


    echo 'I am the first box'



    echo 'I am the second box'



    echo 'I am the third box'



    echo 'I am the fourth box'



    echo 'I am the fifth box'



    echo 'I am another box higher than 5'



Making iTerm 2 highlight errors all the time

This helps when you have to chase down stupid stuff all day, every day:

Launch iTerm2

Go to iTerm2 – Preferences – Profiles – Advanced – Triggers – Edit

Click +

In the Regex, type:   (error|ERROR|Error)

Action: Highlight Text

Pick a color, Pick a background color that stand out for you

Check the Instant box

Close back out

I have: