Friday, 20 April 2018

Linux from the command line | Linux for sysadmins -- Mastering the shutdown command

Linux from the command line | Linux for sysadmins -- Mastering the shutdown command

Many PC Desktop Linux home users may never have come across the shutdown command, but it's handy to know and learn for a lot of reasons. For sysadmins, it's an essential tool for remote management.

For home users, imagine you're downloading a large file that's going to take an hour but you have to leave for work. You want to finish your download, but you don't want to leave your computer running all day. Shutdown is your tool.

Let's try it. OK, so your download says it's going to take an hour, let's be safe and wait 90 minutes before shutting off the computer, in case the download slows down a bit.
Open a shell, become root with su, and type the following

shutdown -P +90

That's it. Leave the shell open and go to work. In 90 minutes your computer will shutdown and power off cleanly unattended.
https://www.howtoforge.com/linux-shutdown-command/

Tuesday, 10 April 2018

Linux from the command line -- Mixing it up with the shuf command

Linux from the command line -- Mixing it up with the shuf command

The bash shell is very powerful and the plethora of commands it provides can be combined into scripts as powerful as full on applications. The shuf command is an example of a tool you might use to build such a powerful script.

Make sure to check out the "sort" command too, it's the ying to shuf's yang.
They will also both teach you why you should use leading zero's instead of the way it's done in the shuf demo. For example, where the demo uses
line1
line2
.
.
.
line10

You should use

line01
line02
.
.
.
line10

Play with shuf and sort to see why.
https://www.ostechnix.com/the-shuf-command-tutorial-with-examples-for-beginners/

Linux tips & tricks -- 14 tools to backup your Linux box

Linux tips & tricks -- 14 tools to backup your Linux box

If there's one piece of advice you'll hear on every computing advice list, it's backup your computer!
Luckily for Linux users, it's UNIX heritage brings with it a sysadmin's mindset of backup soon and often. This in turn has lead to the availability of a lot of great tools and options for backing up. Even better many of these tools can backup more than just your one Linux box, many can backup the other computers on your network as well, be they Linux, Windows, or Mac.
So check out the list, pick a tool, and get backing up.

Pro Tip:
For a lot of smaller customers and home business users, I take an old, low power PC (eg a Small Form Factor) or even laptop, throw a USB 3.0 card in it, and grab two of the same Terabyte or larger external USB 3.0 drives from whoever has them on sale this week. Then set them up to automount by UUID, configure them as RAID 1 (Mirrored), and install Amanda on the system to let it operate as a backup server for critical files. IE "My Documents" on Windows systems, and "/home/*" on Linux systems.
Be sure to setup SMARTD on the server box to check the drives regularly and to e-mail you if it finds any issues.
If you use an old PC/Laptop you already have, and Hard Drives on a good sale, you can setup a pretty decent backup server for under $200. Money well spent.
In fact these days, the Raspberry Pi 3 B+ could even serve in this role reasonably well, as long as you run your backups at night and use compression on the client side to minimize bandwidth, USB utilization.
Whatever hardware you use, plug it all into a small APC UPS and setup the comm cable so the system can auto-shutdown in the event of a power failure.
https://www.tecmint.com/linux-system-backup-tools/

Sunday, 8 April 2018

Linux from the command line -- Command line history with fc

Linux from the command line -- Command line history with fc

We've talked about some of the bash shell command line history tools before, but there's always something new to learn.
https://www.ostechnix.com/the-fc-command-tutorial-with-examples-for-beginners/