linux tips

linux tips

Opening and editing files remotely in Linux

Using KDE, it is very easy to open and edit a remote file using pretty much any application (any application that uses KDE to open files that is). I use this method using Kate (a sophisticated text editing program), and Quanta .

To open a file using ftp, in the box in the middle at the top that shows the current path you are looking at, type:

ftp://user@site.com:port/

Securing Linux: process limits

This tip was found at http://aymanh.com/tips-to-secure-linux-workstation.

An old school attack on Linux systems is called a fork bomb. There is demonstration code at the fore-mentioned website, but essentially, it is a command that will spawn an unending number of processes, eventually killing the system.

Linux tip: Managing users

Managing users is easily done via the command line in Linux. For example, to get a list of users currently logged on, you can use the who or w command.

jsteel@jsteel-desktop:~$ w
17:08:34 up 10 min, 1 user, load average: 0.44, 0.63, 0.46
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
jsteel :0 - 16:58 ?xdm? 60.26s 0.04s /bin/sh /usr/bi

jsteel@jsteel-desktop:~$ who
jsteel :0 2008-02-24 16:58
jsteel@jsteel-desktop:~$

Mount netware share in Linux using ncpmount

I had some problems with the "server not found" error and login doesn't exist error. I finally got this to work by using:

$ ncpmount -S SERVER -A server.fqdn.edu -U user.ou.ou.tree mnt/point

I had to use the -A option which had the fully qualified domain name of the server (an IP address might work) as well as my fully qualified username complete with ous and the tree.

Automatix for Ubuntu

Automatix is an automated installation program that offers many installations that are either unavailable in Ubuntu (for legal reasons or otherwise), or difficult. Automatix includes many installs such as Acrobat reader, Wine, Crossover, which allows the installation of Windows programs like Office and PhotoShop, pesky proprietary codecs, libcss2 for decrypting DVDs and much more. These are all installed using a GUI.

Managing processes and long jobs in Linux

If you have a long job using the command line in Linux, here are some tips.

Some jobs, such as compiling a program or using vacuumdb in postgres require a long time. Normally, you cannot use the same command line when running these jobs. If you are using ssh remotely, you're stuck (unless you login again).

Now you can add a space and ampersand at the end of the command and this *should* send this to the background. But I've found this doesn't always work. But even if it does, the following does still apply.

rsync and Ubuntu

Imagine you have a very important disk you want to mirror, or have a copy of. This could be a remote disk, like on a website, or even a directory.

You could copy and paste the files, at least if they are local disks, or use FTP. Problem solved, right?

Now, imagine you have two disks, both of which have data, but you need them to match. This was the problem I ran into with over 100 GB of data. I solved this in ubuntu using rsync.

To install, use apt-get:

$ sudo apt-get install rsync

Secure ftp using Ubuntu

I recently wanted to setup an automated backup system for a company I purchase hosting through (who promptly shut off full backups), and wanted to do so using FTP to my home computer.

The first thing I did was setup vsftpd. This is an FTP daemon that provides the ftp service. After installing the daemon and creating the system account with /bin/false as a shell, I edited /etc/vsftpd.conf. I didn't run it on a non-standard port, although you can for greater security. I did NOT enable anonymous access and neither should anyone else not requiring them.

Disk usage in Linux

Here are some simple commands to use to get the disk usage in Linux.

$ df

will give you the disk usage for all mounted drives, including available and percentage of use.

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 17077684 7868596 8341580 49% /
varrun 1038144 272 1037872 1% /var/run
varlock 1038144 0 1038144 0% /var/lock
udev 1038144 84 1038060 1% /dev
devshm 1038144 0 1038144 0% /dev/shm