Git

Pull changes in from master that have happened since making changes on feature branch git checkout feature git rebase master Merge feature branch into master To merge a feature into master, first commit changes to your feature branch, then: git checkout master git pull origin master git merge feature git push origin master See history git log to see all. Include file if you only want to see history for that file: git log [filename]

March 22, 2022 · 1 min · Me

bash

At the moment, this is just a dumping ground for useful tidbits I find / need in my daily work. At some point I will get around to organizing and formalizing. Parameter Expansion Bash reference manual Slice a string a="teleport" b=${a:4:7} echo $b > port Replace a portion of a string The pattern is ${parameter/pattern/string} to replace the first occurence of pattern with string or ${parameter//pattern/string} to replace all occurrences....

March 10, 2022 · 1 min · Me

vim

At the moment, this is just a dumping ground for useful tidbits I find / need in my daily work. At some point I will get around to organizing and formalizing. File formats (carriage returns) If you ever diff two files that look identical, but they display as completely different, you may be dealing with a file format issue. This may happen if you are sharing files between different OS. To display the file format of your current file type this:...

March 10, 2022 · 2 min · Me

awk

Basic syntax awk [ options ] script filename Where script is either a single awk command or file of awk commands. Awk commands look like this: TODO and filename can be omitted if you’re piping in standard input. Commands Options Examples Length of the longest line in a file awk '{ if (length($0) > max) max = length($0) }; END { print max }' file Selecting, filtering, and basic arithmetic Sum a field, specify delimiter awk -F '\t' '{print sum+=$1;} END {print sum}' file....

February 7, 2022 · 1 min · Me

Sed

This is an ongoing work in progress, please let me know if you have any suggestions/feedback. Basic syntax sed [ options ] script filename Where script is either a single sed command or file of sed commands (must use with -f option). Sed commands look like this: action/pattern/replacement/flag Filename can be omitted if you’re piping in standard input. Actions p: print s: substitute s accepts the following flags which are appended to the end of the command (e....

January 30, 2022 · 2 min · Me