Use .htaccess to Stop People From Viewing Files in a Directory.

Open the directory with your favorite FTP client – unless you’re local and can just navigate to the directory.

Add a file called .htaccess. The ‘.’ is important and mandatory.

The permissions for .htaccess should be 644.

Edit the .htaccess file with a plain-text editor (don’t use a word-processor application) and add the following line:

Save the file.

What this will do is prevent indexing the files in the folder. If people try to access the folder directly, they’ll get a 403 forbidden error.

At the same time, you can still link directly to files in that folder.

So, let’s say you added the .htaccess to a directory called /tmp. You can still link to, use, and send people to /tmp/picture.jpg like normal, but people won’t be able to browse the directory and find files you don’t want them to see.

For more information,  click this.

Smash a Button
[Total: 0 Average: 0]
Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


Prevent Duplicates in Bash History

As you may have noticed, bash keeps a history. If you open your terminal and push the up arrow, you’ll see the last command you used. This fills up with duplicates. This is how you ensure it doesn’t keep duplicates.

It’s pretty easy. Just open your terminal and enter:

After that, bash should no longer keep duplicates of previously entered commands.

See? Linux is pretty simple.

Smash a Button
[Total: 1 Average: 4]
Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


How To: Enable PPAs With Elementary OS

Elementary, like Debian and some other Debian derivatives, doesn’t support PPAs out of the box. In order to use them, you’ll have to install `software-properties-common`.

Open your terminal with CTRL + ALT + T and simply enter the following:

sudo apt install software-properties-common

Once you’ve done that, you can add PPAs in the normal way. For example, this is a LibreOffice PPA:

sudo add-apt-repository ppa:libreoffice/ppa

Smash a Button
[Total: 0 Average: 0]
Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


How To: Find the hostname.

The hostname is, for many of you who will be reading this, the same as your username. This is not always true.

Why is it important? Well, if I want to connect to a box on my network, I use its hostname. For example:

ssh kgiii@kgiii-lmde.local

That means I don’t need to know the IP address of the box, I merely need to know the hostname. That, as I said, is usually your username. On the off-chance that it isn’t, it’s easy to find.

cat /proc/sys/kernel/hostname

And there you go.

Smash a Button
[Total: 0 Average: 0]
Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


“Best” ‘inxi’ Command?

If you don’t know about inxi, you’re either really new to Linux or you’ve been living under a rock. It’s a tool to give you information about your computer. So, what is inxi? This is what ‘man inxi’ has to say:

inxi is a command line system information script built for for console and IRC. It is
also used for forum technical support, as a debugging tool, to quickly ascertain user
system configuration and hardware. inxi shows system hardware, CPU, drivers, Xorg,
Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other
useful information.

It’s actually fairly complicated and has a ton of options. So, what’s the best? 

Personally, I have ‘inxi’ aliased to be ‘inxi -v 5’. It gives me a great deal of information and generally has all the information I’d be looking for.

Here’s an example output from one of my older computers that I’m running VMs on:

As you can see, that’s a lot of information and that’s exactly the information I (and others) need to know to help you in many situations. So, when I ask for your inxi output, that’s exactly what I want to see.

Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
SITEMAP