Tag Archives: linux

Create Aliases in Ubuntu

How to Create an Alias in Ubuntu

If you run the same commands in Linux (or Ubuntu) all the time, you can add what is called an “alias” to your user account. For example, I regularly type:

ls -alh

So I setup an alias so that I can just type la. (also, see my Top 10 Aliases list) To do this, simply edit your “profile”. Bash is the program that you typically use when you are in a command shell, so it may be called your “bash profile”. Your profile is in your Home folder and stores all of your preferences. Just edit the “.profile” or the “.bash_profile” if it exists.

cd ~
pico edit .profile

Add the following code to the bottom:

alias la='ls -alh'

Now when you are typing at the command prompt, you just type la and it acts like you typed ls -alh. Pretty handy.

Display Novell Servers Connected to Your Server

I found an easy way to find out what Novell Netware servers you are connected to and can access. This requires that you have ncpfs installed in Linux and I’m guessing Novell’s Netware client for IPX in Windows. If you do, just type:

slist

And you’ll see a quick list of all the Novell machines on your network. If you don’t have ncpfs, Ubuntu will prompt you to install ncpfs by running:

sudo apt-get install ncpfs

If you do have it, you’ll see a similar list in Windows and Linux:

If you have ncpfs installed, but are not attached to any Novell servers, you’ll see the following:

Displaying JPG files over a Mapped Drive

Displaying JPG files over a mapped drive when using Apache:
I don’t think that most people would have guessed this, but if the images you are going to display on your website are located on a mapped network drive, Apache needs to be modified in order for the image to display. If you mapped a network drive but it only displays the text of the image in the browser, you need to change the following inside of your Apache Directives:

<Directory "/path-to-mapped-drive">
EnableSendfile Off
</Directory>

So, this may not make a lot of sense unless you have experienced the problem firsthand; but if you open the browser window, expecting to see a jpg, and instead you see something like this:

http://brockangelo.com/wp-content/uploads/mnt/2008/08/sample.jpg

Then you need to set EnableSendfile to “Off” inside your Apache Directives.

Allowing Uploads via the Media Uploader

Allowing Users to Upload via the WordPress 2.6 Media Uploader:
You have to chmod wp-content/uploads/ to 777 in order for the Media Uploader to allow users to upload files. With the websites that I host, I prefer to not have anything chmod’ed to 777 unless it is extremely inconvenient, so I just create folders every few months and chmod them to 777. I go into /wp-content/uploads/THE_YEAR/ and do a mkdir 08 (or whatever the current month is) and then chmod 777 08 for the month, and I chmod previous months back to 755. The alternative would be to chmod the entire uploads directory, but then all prior uploads would be at risk of tampering.