2018-02-15 cargo_culting

cargo cult programming Cargo cult programming is a style of computer programming characterized by the ritual inclusion of code or program structures that serve no real purpose Cargo_cult_programming Shotgun debugging: A process of making relatively un-directed changes to software in the hope that a bug will be perturbed out of existence. Shotgun_debugging

1 min · 52 words · Mike Fettis

2018-02-19 git_revert

git revert Yey more git. I am still not the greatest at git, therefore here is the step by step on how to revert a PR/merge from git. first checkout the master branch: Git checkout master then run a git log and get the id of the merge commit. git log then revert to that commit: git revert -m 1 <merge-commit> With ‘-m 1’ we tell git to revert to the first parent of the mergecommit on the master branch....

1 min · 176 words · Mike Fettis

2018-02-20 firefox_bs

Firefox Alright chrome has been using a ton of battery on my mac so I am going back to firefox. Supposedly firefox is much better on the battery than chrome. We will give this a try and see if it ends up working. Meaningless words here we are again trying to make the daily blogging work, lets see if it sticks better now. It is pretty tough to do now that there is a baby at home and I only have so much time for my own projects....

1 min · 110 words · Mike Fettis

2018-02-20 mp3_bitrate

Mp3 i wanted to find the bitrate on a file in the terminal and i found this bashrc function… echo `basename "$1"`: `file "$1" | sed 's/.*, \(.*\)kbps.*/\1/' | tr -d " " ` kbps }

1 min · 36 words · Mike Fettis

2018-02-26 git is hard

git i am bad at git, here is my attempt at rebase and cleaning up git rebase -i ; where the commit hash is the one before yours the reword all of hte commits except for your latest one, the latest one you pick then check the git log to make sure that you only have one commit finally on your feature branch to a git push --force which will force your local into the branch you are working on and hopefully everything will get squashed

1 min · 86 words · Mike Fettis

2018-02-27 shasum_markdown

shasum Getting a shasum on something… useful so lets do it with this shasum -a 256 <filename> mastering markdown n Now if only i could keep all of this in my head mastering-markdown

1 min · 33 words · Mike Fettis

2018-02-28 git gc

git gc git gc .. while useful can be pretty nasty. Make sure that you don’t do a git gc --prune=now unless you really want to clean out your repos. git gc Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and removing unreachable objects which may have been created from prior invocations of git add.

1 min · 69 words · Mike Fettis

2018-03-06 go-things

Writing go in vim It is pretty useful if you are writing go in vim to have this added to your vimrc au BufWritePost *.go !gofmt -w % It will auto format your go files to make sure they don’t suck. This is super important as I am crappy at formatting.

1 min · 51 words · Mike Fettis

2018-03-13 gitignore notes

gitignore notes there is a bunch of idfferent ways to ignore files in git.. gitignore

1 min · 15 words · Mike Fettis

2018-03-14 problems

Solve a problem by not working on it. It’s 3:30 am standing holding my daughter, my t-shirt has puke on it from the 7pm feeding. Daughter finally falls asleep I hand her off to my wife. And go to sleep. But can’t sleep. That thing that happened earlier the day before and all those other things the week before. They crept into my head and I’m wide awake 4:00, 4:30, 5:00, all roll by and I’m wallowing in it....

3 min · 464 words · Mike Fettis

ansible

ansible notes https://galaxy.ansible.com/ Galaxy is your hub for finding, reusing and sharing Ansible content https://github.com/wilmardo/ansible-role-plex repo for the plex install with ansible… something for later

1 min · 25 words · Mike Fettis

bagel sandwich the easy way

I love bagel and egg sandwiches and they are super easy to make with almost no cleanup. Bagel and egg sandwich the easy way(almost NO cleanup): as learned from watching a local bagel shop do it for a couple years. heat pan i think its a 12 or 16", melt butter/oil to coat even nonstick pan while pan is heating take bowl, crack two eggs and whip them together - add whatever spices you want, I usually add nothing once pan is sizzling (if you toss a drop of water in it it sizzles) pour in bowl of eggs toast bagel let cook until it is just about no longer runny, take a decently big spatula fold egg in half, and then fold into quarter, press down, cook one side until it is done enough for you then flip....

2 min · 224 words · Mike Fettis

certs

self signed certs Genning certs is always a pita, luckily I found a quick and easy way from the folks over at spiderlabs, to do it.. gen-self-signed-cert.sh #!/bin/bash openssl genrsa -out my.key 2048 openssl req -new -x509 -days 3650 -key my.key -out my.crt -subj "/"

1 min · 45 words · Mike Fettis

chef notes

chef notes $ kitchen list $ kitchen converge ;# creates the vagrant box from the kitchen.yml $ kitchen exec -c whoami ;#fire a command from insid ethe vagrant box $ kitchen verify ;# runs the tests that are configured $ kitchen login ; # logs into the box directly gives a shell

1 min · 52 words · Mike Fettis

cli

shasum Getting a shasum on something… useful so lets do it with this shasum -a 256 <filename>

1 min · 17 words · Mike Fettis

curl redirects

curl redirects Sometimes you want to be able to follow a redirect chain to see what is going on.you can do that pretty easily with curl. Toss in your url and hit enter then follow the breadcrumbs. curl -v -L http://google.com 2>&1 | egrep "^> (Host:|GET)" $ curl -v -L http://google.com 2>&1 | egrep "^> (Host:|GET)" > GET http://google.com/ HTTP/1.1 > Host: google.com > GET http://www.google.com/ HTTP/1.1 > Host: www.google.com

1 min · 70 words · Mike Fettis

dot file automation

dot file automation Sharpen and clean your tools to make them last longer. Hone your tools to make them more precise. The tools of a SRE start with the terminal. The terminal is honed sharp with dotfiles. Live your life long enough in a terminal and tweaks and customizations happen. Live longer and when those tweaks are lost from a catastrophe or when you switch machines, you will be hamstrung and saddened going back to nothing....

11 min · 2252 words · Mike Fettis

Git

git revert first checkout the master branch: Git checkout master then run a git log and get the id of the merge commit. git log then revert to that commit: git revert -m 1 <merge-commit> With ‘-m 1’ we tell git to revert to the first parent of the mergecommit on the master branch. -m 2 would specify to revert to the first parent on the develop branch where the merge came from initially....

2 min · 236 words · Mike Fettis

github one liner and powershell curl

Github releases There is a nice way to get the latest release from a github repo. as long as it gets tagged as release. I like to be able to pull down the latest version of a release for specific code in automated builds. This helps that. Use curl to get the JSON response for the latest release Use grep to find the line containing file URL Use cut and tr to extract the URL Use wget to download it...

1 min · 127 words · Mike Fettis

index

Wiki |-+-+-| |git | chef| ansible| |qmk | tmux| cli |

1 min · 11 words · Mike Fettis