Docker can be tricky to debug. There’s instances where after upgrading a container the volume that was previously attached fails to work. In this case it was a dev image and the quickest, and dirtiest, option was to clear out and rebuild. I could go one by one to delete the specific volumes. Instead I Read more about Docker remove ALL volumes not attached[…]
I needed to grep a directory, and sub directories, and not displaying the filenames in the output. This is when the man page came to the rescue. Output There we go, -h, –no-filename, is what I needed. Example with output to a file:
Needed to head all files in a directory.
First, the easier way to do this is to use rsync in the first place. rsync -avh –progress sourceDirectory destinationDirectory However, sometime you think cp will be quick and you already kicked it off. Here is a quick way to check the progress of a copy command after you’ve already started. watch lsof -p`pgrep -x Read more about How to check cp progress after cp has started[…]
Recently upgraded to 15.10 and that looked okay at first. However, the displa driver that it installed, NVIDIA, was causing issues. So I defaulted back to the open source driver and reboot. MISTAKE! Ended up causing the system to crash and couldn’t do anything about it. I rebooted into root terminal. Then ran a command to Read more about Ubuntu Command line Display Driver Change[…]
Using bash I needed to check that a file exists, then do something. This one turns out to be super simple. I wanted to conditionally load a db file if it existed in this case. What I needed was, a check for the file in bash. Then execute the command. In this instance it was to Read more about Bash test if file exists[…]
Running linux machines sometimes it’s needed to figure out what is taking up a large amount of room on a server. Here’s an easy way to investigate large directories.
Previously I’ve transferred file with a pgp key, but this is an ok alternative. You can also checkout the easier and more supported zip method.
Sometime a simple encrypt with a password is needed. This isn’t the most secure method (7z provides more secure methods), but is better than nothing. I simple way to do it is to create a zip password protected with all the files. Often it’s easier to just zip a whole directory.
This one is super simple.