Skip to content

Instantly share code, notes, and snippets.

View crittelmeyer's full-sized avatar

Chris Rittelmeyer crittelmeyer

  • Olive
  • Atlanta, GA
View GitHub Profile
@crittelmeyer
crittelmeyer / grep_cheatsheet.md
Last active May 22, 2020 07:50
grep cheatsheet

Differences between grep, pgrep, egrep, and fgrep (Linux):

grep

grep is an acronym that stands for "Global Regular Expressions Print". grep is a program which scans a specified file or files line by line, returning lines that contain a pattern. A pattern is an expression that specifies a set of strings by interpreting characters as meta-characters. For example the asterisk meta character (*) is interpreted as meaning "zero or more of the preceding element". This enables users to type a short series of characters and meta characters into a grep command to have the computer show us what lines in which files match.

The standard grep command looks like:

grep '' grep prints the search results to the screen (stdout) and returns the following exit values:

0 A match was found.

@crittelmeyer
crittelmeyer / linux_tools.md
Last active October 31, 2021 08:55
linux tools cheatsheet

Linux tools to know

Built-in Mac OS tools

  • ls - list directory contents
  • wc - word, line, character, and byte count
  • cp - copy files
  • mv - move files
  • rm - remove directory entries
  • chmod - change file modes or Access Control Lists
  • chown - change file owner and group
@crittelmeyer
crittelmeyer / xargs_cheatsheet.md
Created December 31, 2015 01:46
xargs cheatsheet

In general xargs is used like this

$ prog | xargs utility

where prog is expected to output one or more newline/space separated results. The trick is that xargs does not! nessarly call utility once for each result, instead it splits the result list into sublists and calls utility for every sublist. If you want to force xargs to call utility for every single result you will need to invoke it with xargs -L1.

Note that xargs promises you that the sublist sent to utility is shorter than ARG_MAX (this is how it avoids those dreaded Argument list to long errors). You can get the current value of ARG_MAX using getconf ARG_MAX

@crittelmeyer
crittelmeyer / rvm_cheatsheet.md
Last active May 13, 2016 16:08
rvm cheatsheet

RVM cheatsheet/shortcuts

As configured in my dotfiles

Shortcuts

  • rubies = list installed ruby versions
  • gemsets = list gemsets

Cheatsheet

  • rvm list known => lists available ruby versions
@crittelmeyer
crittelmeyer / git_cheatsheet.md
Last active May 13, 2016 15:59
git cheatsheet

Git Cheatsheet

As configured in my dotfiles

Shortcuts

  • g = git
  • gst = git status
  • ga = git add
  • gb = git branch
  • gcb = git checkout -b
@crittelmeyer
crittelmeyer / vim_cheatsheet.md
Last active January 25, 2024 20:15
vim cheatsheet

Rails shortcuts

As configured in my dotfiles

Shortcuts

  • devlog = show development log file

  • prodlog = show production log file

  • testlog = show test log file

  • RED = 'RAILS_ENV=development' => export RED

Jira shortcuts

As configured in my dotfiles

  • jira new ==> opens a new issue
  • jira dashboard ==> opens your JIRA dashboard
  • jira reported [username] ==> queries for issues reported by a user
  • jira assigned [username] ==> queries for issues assigned to a user
  • jira ABC-123 ==> opens an existing issue
  • jira ABC-123 m ==> opens an existing issue for adding a comment
@crittelmeyer
crittelmeyer / machine.js
Last active December 2, 2019 16:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions