Get Second Column Of Ouput
pbpaste | cut -f2 Where -f2 gives the second column.
Command Line or Terminal
pbpaste | cut -f2 Where -f2 gives the second column.
diskutil info -all Look for the disk: eg. disk3 diskutil unmountDisk disk3 Unmount of all volumes on disk3 was successful
:s/from/to/g Similar to sed g does it globally, otherwise it only does the first match.
hdiutil info to find the disk id hdiutil detach /dev/disk3
I wanted to be able to run: sudo apt-get update; sudo apt-get -y upgrade; sudo apt-get -y install docker.io; sudo usermod -aG docker steven; sudo reboot docker run -d -p 8001:8001 archiveteam/warrior-dockerfile And have the warrior up, however the problem is then I need to use my browser to enter a username and select a project. We can leverage curl to make the necessary requests for us using only the command line. curl ‘http://localhost:8001/api/settings’ -H ‘Origin: http://localhost:8001’ -H ‘Content-Type: application/x-www-form-urlencoded;…
sudo tcpdump -i lo0 -X -i selects the interface -X prints packets in hex and ascii
I keep using history | grep but is there a better way of searching history? Digital Ocean has a nice blog post on history in bash CTRL-R quickly search the history. eg CTRL-R ssh !-2 will run the 2nd last command entered into history. !! runs the previous command which can be combined with sudo sudo !! !1 will get the 1st (or nth if you change 1) argument of the previous command.
Useful tips: Put this into ~/.bashrc: HISTSIZE=5000 #controls how much history is loaded into memory HISTFILESIZE=10000 #controls how much history is saved on disk #By default bash overwrites the history file at the end of each session #which is a pain if you open multiple shells (not all history is saved) #use this to append to the history file shopt -s histappend However if you want each history item to be available in every shell as soon as you press…
cat file.txt | uniq is incorrect cat file | sort | uniq is correct Why? From the manual: Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output).
Create an instance and then ssh into it. Install docker using sudo apt-get install docker.io Add yourself to the docker user group sudo usermod -aG docker steven Restart the docker service using sudo service docker restart or reboot using sudo reboot, if you restarted the service you’ll need to logout and back in due to the change in group. Run the warrior docker run -d -p 8001:8001 archiveteam/warrior-dockerfile Congradulations you can now exit and use ssh -L 8001:localhost:8001 google-server to…