This page will cover a wide range of tips and tricks regarding Linux devOps administration.
Bash: curl Command Tips, Methods and Usage Information – Bash curl information resource page
Working With The Linux Files System – Tips & Tricks when working with Files & Directories in Linux
Working with Linux Users , Groups and Permissions– Use Cases for ‘adduser’ & ‘useradd’
External Resource Links
How to Check Hardware Information on Linux Using Command Line Need to make a similar list like this one to put on blog.
Working with Remote Directories/Folders:
A while ago I has issues mounting a folder on a file server I was trying to backup because it needed to be updated & I really just wanted to do a fresh install.
Well after a bit of searching, turned out that the mount command was defaulting to a newer version of CIFS than my server had. I just had to explicitly set the version to 1.0 in the command line options and I was on my way.
sudo mount -t cifs //192.168.0.106/NFS-10TB /mnt/SMB-10TB -o username=brandon -o vers=1.0
I got the tip from the follolwing page: 16.04 CIFS host is down, but they are not – AskUbuntu.com
Package Managers –
Apt usage and how to install Debian (.dpkg) packages manually.
- Get the version number of an installed package:
dpkg -s <packagename> | grep '^Version:'
Found this tip at:
How can I find the version number of an installed package via dpkg
The results of ‘dpkg –list’ contain letter codes that I had a hard time looking up. I did find a snippet in a book (The Debian System: Concepts and Techniques) with a table. Below is my version of that table:
|..x||reinst-required & *hold|
|…||ok (empty third column)|
Notes: Package states and their mappings to single letters. The dots identify the column in which the letter may be seen in the dpkg –list output. States prepended with an asterisk are not states defined by the package management system but rather emerge out of other states.
Echo using sudo
SO I needed to create a file with just one line of text. I though instead of firing up vim, I would just echo the file and send the output to a file instead of the tty.
Well, once again, nothing simple is ever simple. I fortunatly found a page by a developer that seems as fed up with these constant time wasting hurdles.
Basically the command:
sudo echo "some_setting=1234567890" > /etc/write-to-file-needs-root-privledges.conf
Yup, this fails with permission denied, but doing it this way works:
sudo sh -c 'echo "some_setting=1234567890" > /etc/write-to-file-needs-root-privledges.conf
The above command using ‘sudo sh -c’ does the trick. Just don’t forget the single quote around the whole echo command like I did the first time I tried it.
End of page Paragraph text to prevent pre-formatted from fuckin shit up