Last active
February 12, 2018 15:19
-
-
Save radavis/eb19ec95d62a864e1af1 to your computer and use it in GitHub Desktop.
Revisions
-
radavis revised this gist
Feb 12, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -238,6 +238,11 @@ scp ~/install.sh user@ip_address:/Users/rd/install.sh scp user@ip_address:/Users/rd/Downloads/raspbian.img ~ ``` ## Watch a Remote Log ``` ssh [email protected] tail -f /home/ubuntu/shared/logs/production.log ``` ## Change your computer's hostname ``` -
radavis revised this gist
Jun 22, 2017 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -192,6 +192,13 @@ $ find ~ -iname "time.rb" $ find . -type f -name "test.log" ``` ## Find Files Modified between two Dates ``` $ find . -type f -newermt 2017-06-21 ! -newermt 2017-06-22 ``` [source](https://stackoverflow.com/a/158235/2675670) ## Clean up logfiles in your home directory ``` $ find ~ -iname "*.log" -exec rm {} \; -
radavis revised this gist
Oct 1, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -188,13 +188,13 @@ $ ag "HTTP POST" --markdown ## Searching File Names ``` $ find ~ -iname "time.rb" $ find . -type f -name "test.log" ``` ## Clean up logfiles in your home directory ``` $ find ~ -iname "*.log" -exec rm {} \; ``` ## Searching for Large Files -
radavis revised this gist
Sep 30, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,6 +55,11 @@ $ cp app.rb old-projects/ $ cp -R old-projects really-old-projects ``` ## Copy with Progress Bar ``` $ rsync -r --progress /folder/to/copy /destination/folder ``` ## Delete Files and Directories `rm` ``` $ rm junk.txt -
radavis revised this gist
Sep 15, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -241,6 +241,12 @@ ps aux | grep chrome renice -n -5 -p pid ``` ## List USB Devices ``` system_profiler SPUSBDataType ``` ## End ``` say 'Thank you' -
radavis revised this gist
Aug 23, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -187,7 +187,7 @@ $ find ~ -name "time.rb" $ find . -type f -name "test.log" ``` ## Clean up logfiles in your home directory ``` $ find ~ -name "*.log" -exec rm {} \; ``` -
radavis revised this gist
Aug 23, 2015 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -185,7 +185,11 @@ $ ag "HTTP POST" --markdown ``` $ find ~ -name "time.rb" $ find . -type f -name "test.log" ``` Clean up logfiles in your home directory ``` $ find ~ -name "*.log" -exec rm {} \; ``` ## Searching for Large Files -
radavis revised this gist
Jul 28, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -177,6 +177,8 @@ way fast ``` $ brew install the_silver_searcher $ ag collection_select ~/Dropbox/code $ ag --list-file-types $ ag "HTTP POST" --markdown ``` ## Searching File Names -
radavis revised this gist
Jul 13, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -99,7 +99,7 @@ $ ./food_trucks.rb ``` ## Environmental Settings and $PATH * `/usr/local/bin` should be first when using homebrew!: `export PATH=/usr/local/bin:$PATH` * Always append to the end of the $PATH * Postres.app: `export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin` ``` -
radavis revised this gist
Jul 13, 2015 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Using the OS X Command Line ## Directory Shortcuts ``` @@ -31,6 +31,13 @@ $ mkdir -v code $ mkdir -p code/sinatra-app/public code/sinatra-app/views ``` ## Creating Files ``` $ touch notes.md $ echo "# Using the OS X Command Line" > cli.md ``` ## Getting Help `--help` and `man` ``` $ ls --help -
radavis revised this gist
Jul 11, 2015 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -219,6 +219,15 @@ scp user@ip_address:/Users/rd/Downloads/raspbian.img ~ sudo scutil --set HostName your-new-hostname ``` ## Setting the priority of a running process Scale is from +10 (very nice) to -10 (not nice) ``` ps aux | grep chrome renice -n -5 -p pid ``` ## End ``` say 'Thank you' -
radavis revised this gist
Jun 11, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -213,6 +213,12 @@ scp ~/install.sh user@ip_address:/Users/rd/install.sh scp user@ip_address:/Users/rd/Downloads/raspbian.img ~ ``` ## Change your computer's hostname ``` sudo scutil --set HostName your-new-hostname ``` ## End ``` say 'Thank you' -
radavis revised this gist
Jun 2, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -179,6 +179,11 @@ $ find . -type f -name "test.log" $ find . -type f -name "test.log" -exec rm {} \; ``` ## Searching for Large Files ``` $ find ~ -size +500000 -print ``` ## View Disk Info ``` $ df -H -
radavis revised this gist
Jun 2, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -163,6 +163,7 @@ $ grep -rn collection_select ~/Dropbox/code faster ``` $ brew install ack $ ack --bar $ ack collection_select ~/Dropbox/code ``` way fast -
radavis revised this gist
Apr 12, 2015 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -194,6 +194,19 @@ brew install nmap sudo nmap -sP 192.168.1.0/24 ``` ## Connect via Secure Shell ``` ssh username@ip_address ssh [email protected] ``` ## Copy files over SSH with Secure Copy ``` scp source destination scp ~/install.sh user@ip_address:/Users/rd/install.sh scp user@ip_address:/Users/rd/Downloads/raspbian.img ~ ``` ## End ``` say 'Thank you' -
radavis revised this gist
Apr 10, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -191,7 +191,7 @@ $ cat ~/.ssh/id_rsa.pub | pbcopy ## Find Network Devices ``` brew install nmap sudo nmap -sP 192.168.1.0/24 ``` ## End -
radavis revised this gist
Apr 1, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -188,6 +188,12 @@ $ df -H $ cat ~/.ssh/id_rsa.pub | pbcopy ``` ## Find Network Devices ``` brew install nmap nmap -sP 192.168.1.0/24 ``` ## End ``` say 'Thank you' -
radavis revised this gist
Feb 24, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -145,6 +145,11 @@ $ tar -zxvf plans_to_take_over_the_wolrd.tar.gz $ tar -xvjf area51_research_documents.tar.gz2 ``` ## Zipping a Folder ``` zip -r archive_name.zip folder_to_compress ``` ## Viewing the Contents of a tar.gz File ``` $ tar -tf filename.tar.gz -
radavis revised this gist
Feb 19, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,6 +62,8 @@ $ brew install caskroom/cask/brew-cask $ brew install wget $ brew cask install paintbrush $ brew cask install --appdir="/Applications" vlc $ brew search wget $ brew info p7zip ``` ## Other Useful Commands -
radavis revised this gist
Jan 21, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,6 +61,7 @@ $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/maste $ brew install caskroom/cask/brew-cask $ brew install wget $ brew cask install paintbrush $ brew cask install --appdir="/Applications" vlc ``` ## Other Useful Commands -
radavis revised this gist
Jan 21, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ # Using the OSX Command Line ## Directory Shortcuts ``` ~ - Home Directory . - Current Directory .. - Enclosing Directory / - Root Directory ``` ## Change Directory `cd` -
radavis revised this gist
Jan 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ $ rm junk.txt $ rm -rf really-old-projects ``` ## Install [Homebrew](http://brew.sh/) and [Cask](http://caskroom.io/) These two apps allow you to install almost anything from the command line. ``` $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
radavis revised this gist
Jan 21, 2015 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,6 +53,15 @@ $ rm junk.txt $ rm -rf really-old-projects ``` ## Install Homebrew and Cask These two apps allow you to install almost anything from the command line. ``` $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew install caskroom/cask/brew-cask $ brew install wget $ brew cask install paintbrush ``` ## Other Useful Commands ``` $ echo -
radavis revised this gist
Jan 21, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -165,6 +165,11 @@ $ find . -type f -name "test.log" -exec rm {} \; $ df -H ``` ## Copy Your Public Key to the Clipboard ``` $ cat ~/.ssh/id_rsa.pub | pbcopy ``` ## End ``` say 'Thank you' -
radavis revised this gist
Jan 9, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -156,6 +156,8 @@ $ ag collection_select ~/Dropbox/code ## Searching File Names ``` $ find ~ -name "time.rb" $ find . -type f -name "test.log" $ find . -type f -name "test.log" -exec rm {} \; ``` ## View Disk Info -
radavis revised this gist
Jan 7, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,6 +37,7 @@ ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] $ man --help $ man ls $ info ls ``` ## Moving and Copying `mv` and `cp` -
radavis revised this gist
Jan 6, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -157,6 +157,11 @@ $ ag collection_select ~/Dropbox/code $ find ~ -name "time.rb" ``` ## View Disk Info ``` $ df -H ``` ## End ``` say 'Thank you' -
radavis revised this gist
Dec 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -152,7 +152,7 @@ $ brew install the_silver_searcher $ ag collection_select ~/Dropbox/code ``` ## Searching File Names ``` $ find ~ -name "time.rb" ``` -
radavis revised this gist
Dec 31, 2014 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -136,7 +136,7 @@ $ tar -xvjf area51_research_documents.tar.gz2 $ tar -tf filename.tar.gz ``` ## Searching File Contents slooooooow ``` $ grep -rn collection_select ~/Dropbox/code @@ -152,6 +152,11 @@ $ brew install the_silver_searcher $ ag collection_select ~/Dropbox/code ``` # Searching File Names ``` $ find ~ -name "time.rb" ``` ## End ``` say 'Thank you' -
radavis revised this gist
Dec 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -121,7 +121,7 @@ $ subl . ## Killing a Frozen Process ``` $ ps aux | grep safari $ kill 123 ```
NewerOlder