09/07/08

Permalink 01:20:55 pm, by Kieren Email , 61 words, 104 views English (GB)
Categories: Computing, Programming, HTML

Getting rid of gaps under images

As images are inline a small gap will appear around them relative to other CSS objects.

For instance, if you want to display an image at the bottom of a div element then there will be a gap between the bottom of the image and the border of the div.

You can stop this behavior using the CSS code:

Code:

display: block;

19/06/08

Permalink 03:55:14 pm, by Kieren Email , 106 words, 95 views English (GB)
Categories: Computing, Linux

Untar with wild cards

tar doesn’t seem to like using wild cards. If you are trying to decompress multiple files in one go you might try a command like:

kieren@home:~/archives> tar -xf *.tar

However, this produces multiple errors, one for each file that the wild card matches:

tar: archive1.tar: Not found in archive
tar: archive2.tar: Not found in archive
tar: archive3.tar: Not found in archive
tar: archive4.tar: Not found in archive
tar: archive5.tar: Not found in archive

A quick solution is to use a loop to decompress them one at a time like so:

for archive in *.tar ; do tar -xf archive ; done

03/06/08

Permalink 03:38:48 pm, by Kieren Email , 124 words, 72 views English (GB)
Categories: Computing, Linux

Using alias to quickly complete common tasks

If you often use a command with arguments you probably started to get annoyed at having to retype it again and again. For example, if you’re searching the repositories in a Debian style distribution then you would use the command:

apt-cache search <program>

While typing this out isn’t amazingly difficult, using it several times a day will get tedious. Using alias you could do the following:

alias apts=’apt-cache search’

Now the command apts is effectively a shortcut to the longer command apt-cache search so to search the repository all you need to do now is:

apts <program>

One thing to be careful of though is making sure the alias you’re going to use isn’t already taken or a command.

29/05/08

Permalink 02:42:43 pm, by Kieren Email , 243 words, 124 views English (GB)
Categories: Computing, Linux, OpenSUSE, Networking

Viewing display on remote computer

If you want to use two computers using one screen, keyboard and mouse without using a KVM switch you can use Linux to output the display of one computer onto another.

This method should only be used on a secure network behind a firewall as stated in the documentation:

XDMCP service should run only on trusted networks and you have to disable firewall for interfaces, where you want to provide this service.

Any computer in the local network will be able to access the computers display so it is important you trust every computer.

To start with you need to edit the computer you want access to. As root edit the file /etc/sysconfig/displaymanager. Change the line:

DISPLAYMANAGER_REMOTE_ACCESS="no”

To:

DISPLAYMANAGER_REMOTE_ACCESS="yes”

Save the file and exit. You now need to restart XDMCP by typing:

rcxdm restart

Now any computer on the network can gain access to the display of this computer. To gain access use the command:

X :1 -query <remote IP address>

Where <remote IP address> is the IP address of the computer you’re trying to access. If everything has worked the login screen of the remote computer will load. You can switch back to your own computer’s display by pressing ctrl+F7 and then go back to the external computer again by pressing ctrl+F8.

If ctrl+F8 doesn’t work then try some other F keys, it’ll be in one of them.

28/05/08

Permalink 03:47:42 pm, by Kieren Email , 219 words, 123 views English (GB)
Categories: Computing, Linux

Getting Minicom to work

When running Minicom for the first time you’re likely to be greeted with the following error message:

minicom: cannot open /dev/modem: No such file or directory

This is because Minicom is looking for your serial port in /dev/modem and in newer versions of Linux it’s located in /dev/ttyS0 or /dev/ttyS0. In the following example I will use /dev/ttyS0.

There are two ways to fix this problem. You can either create a shortcut of /dev/modem to point at /dev/ttyS0 or edit Minicom’s settings to use /dev/ttyS0.

To use the shortcut method use the following command:

ln -s /dev/ttyS0 /dev/modem

To edit Minicom’s settings start Minicom with the command:

minicom -s

This will open Minicom with the configuration menu. Use your direction key to scroll down to Serial port setup and press enter. Now press a to edit the Serial Device. Change this to be /dev/ttyS0. Press enter once you have finished editing. Now press escape to go back to the main menu. Finally select Save setup as dfl to make sure that the serial port is correct every time you run Minicom. You can now select Exit to start using Minicom or Exit from Minicom to close Minicom. In the future you can run Minicom without the -s flag

:: Next Page >>

November 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search

Categories

KBlog

XML Feeds

What is RSS?

Misc

b2evolution