Skip to content

Instantly share code, notes, and snippets.

View blip-lorist's full-sized avatar
💭
curious

Loraine Kanervisto blip-lorist

💭
curious
  • Honolulu - Seattle
View GitHub Profile

Exploring permutations and a mystery with BSD and GNU split filenames

Published on: 2018-01-22 05:36:09 at lorainekv.com

vimdiff screenshot showing different filename permutations

Recently, I was playing around with the split command-line tool on Mac OS X, and I decided to chop a 4000-line file into 4000 separate single-line files. However, when I attempted to run split -l1, I ran into a funny error:

split: too many files
@blip-lorist
blip-lorist / database_linkwalk.md
Last active September 17, 2017 02:46
database linkwalk
@blip-lorist
blip-lorist / breakpoint_checker_before_git_push
Last active March 16, 2017 16:47
Breakpoint check before git push
# Add to your .bash_profile or .bash_aliases
alias gp='if grep -r --exclude-dir={.git,tmp,log,coverage,public} -Hn binding.pry .; then echo Please remove breakpoints in the above files; else git push; fi'
@blip-lorist
blip-lorist / Awk and pattern match counts
Created December 20, 2016 19:47
Awk - Print line and match count if matches more than once
cat input.csv | awk '{print $0,gsub(/PATTERN/,"")}'| awk ' $NF > 1 {print $0}' > output.txt
@blip-lorist
blip-lorist / url-status-checker.txt
Last active January 7, 2017 20:13
URL status checker
Input:
A text file with a URL on each line. Example url-list.txt:
http://blah.com
http://blah2.com
Run:
while read url; do curl -I $url 2> /dev/null | head -n1 | awk -v url=$url '{print $2, url}'; done < url-list.txt > link-statuses.txt
Output:
link-statuses.txt
@blip-lorist
blip-lorist / tmux_setup.md
Last active January 26, 2017 17:43
Getting started with tmux

Tmux Setup Guide

Why even?

  • Workflow management: Tired of opening the same directories / windows / panes when working on a project? You can save it all to a session and return at any time.
  • Terminal window and pane management (handy when using vim)
  • Session management: run time-consuming terminal processes in one session, and go do other stuff in other sessions

Installation (OS X)

brew install tmux