linux-unix

recent posts related to linux and unix

Teleport: The Unix/Linux ‘cd’ command, improved

Table of Contents1 - The Teleport command2 - Teleport command help3 - For basic use, tp is just like cd4 - Basic teleporting5 - Listing your teleport history6 - Teleport by number7 - Bash completion with Teleport8 - Teleport aliases9 - Adding/creating a teleport alias10 - Using a teleport alias11 - Listing your teleport aliases12 - Removing an alias13 - Teleport command - summary14 - Teleport command - download

Summary: By keeping a history of the directories you've visited, the Teleport command is an improvement on the Unix/Linux cd command. By having a memory, Teleport lets you jump from one directory to any previously visited directory, easily.

January, 2015 Update: The Teleport command now supports Bash completion. For more details on this, see the Github INSTALL.md file.

Notes on how to configure HTTPS/SSL with Nginx

Table of Contents1 - Summary2 - New Linode Server3 - Update Everything4 - Ubuntu Firewall5 - Add a New User6 - Disabling Root Login7 - Limit Login Attempts8 - Install Nginx9 - Adjust Firewall10 - Nginx Configuration11 - NOT what I used: Let’s Encrypt on Ubuntu 16.0412 - (1) Create a cert (openssl)13 - (2) Create a strong Diffie-Hellman group14 - (3) Configure Nginx to Use SSL15 - Adjust the Nginx Configuration to Use SSL16 - (Alternative Configuration) Allow Both HTTP and HTTPS Traffic17 - Adjust the Firewall18 - Enable the Changes in Nginx19 - Test in Browser20 - Nginx "default_server"21 - Can change to a permanent redirect (301)22 - More Security: Preventing Information Disclosure23 - More Security: Fail2Ban24 - Restricting Access by IP Address25 - See also

Without any introduction or discussion, here are the notes I made while learning how to get HTTPS working with Nginx. These are just for me, but if something helps you, cool.

Cerebro, a Spotlight-like launcher for Linux

I recently “made the switch” from MacOS to Linux Mint, and was lamenting the fact that I didn’t have Alfred on Mint. But then this morning I learned about Cerebro, which, if it’s not Alfred yet, at least it’s Spotlight for Linux. omgubuntu.co.uk has this good intro article on Cerebro.

Cerebro is written as an Electron app, and as a result it’s available not only for Linux, but Windows and MacOS as well.

Linux Mint (and Ubuntu): Suspend vs Hibernate (meaning)

When I put Linux Mint on a few of my computers recently I quickly encountered the words “suspend” and “hibernate” when attempting to put a laptop to sleep:

LInux Mint, Suspend vs Hibernate

“What the heck is the difference between Suspend and Hibernate,” I wondered. “I’m used to just having a ‘Sleep’ option on my MacBook Pro.”

How to install a ‘deb’ file on Debian Linux (dpkg, apt)

As a quick note, this stackexchange.com page has some good background information on how to install a deb package file from the command line on Debian Linux (which in my case is Ubuntu 16.04). The short answer is that if you have a deb file named google-chrome-stable_current_amd64.deb, you’ll want to run these two commands, one after the other, as shown:

Hints for writing Unix tools

Marius Eriksen has a good article titled Hints for writing Unix tools. Some key points: a) consume input from stdin, produce output to stdout; b) output should be free from headers or other decoration; c) output should be simple to parse and compose. There’s much more to it than that, and it’s a good read (or reminder).

Optimizing Linux for slow computers

This is a link to an article titled, “Optimizing Linux for slow computers.” Note that this article links to this more thorough resource on archlinux.org.

Here are a couple of paragraphs from it:

When tuning a server, you'll really want to tweak for performance and high throughput. That's where most Linux configurations really shine over the competition: they come better tuned to get the most out of server configurations.

How to type smart quotes on Ubuntu Linux

Table of Contents1 - Background: Switching from MacOS to Ubuntu2 - Background: AltGr and Compose keys3 - Step 1: Figure out what the Compose key is4 - How to type smart quotes on Ubuntu (the hard way)5 - Note: You can stop here6 - Using Ubuntu macros to make it easier7 - Mapping keystrokes to xdotool commands8 - Summary

Note: I don’t know why, but all of the images for this article have been lost. I’ll replace them when I have some free time (but free time is scarce these days).

There seem to be a few different ways to type “smart quotes” on Ubuntu Linux, including using keys (keystrokes) like AltGr and Compose. In this tutorial I’ll document an approach that works best for me: creating simple macros I can assign to simple keystrokes rather than having to use more-complicated keystrokes.

An Ubuntu screensaver shell script to rotate images

This is a Bash shell script written for Ubuntu (Linux). I just switched from Mac/MacOS to Ubuntu, and I don't like the default blank screensaver in Ubuntu. I just want a screensaver to rotate my collection of images, so I'm considering using this rather than Xscreensaver. The script comes from jamcnaughton.com.