image_alt_text

1

Mar/10

PDF Printer In Ubuntu

Monday, March 1st, 2010

It is really simple to add a PDF printer in Ubuntu 9.10. A PDF printer prints a page and writes to a file in PDF format. To install this feature typer in the terminal:
sudo apt-get install cups-pdf

That’s it. It should install and even add the printer automatically.

12

Feb/10

NFS Server

Friday, February 12th, 2010

Overview

Network File Share (NFS) is a protocol for sharing storage. It is quite common in Network Attached Storage (NAS) devices and is a standard compared to Samba which is Microsoft specific but has been ported to Linux.

Install NFS Server

Install the relevant software:
sudo apt-get install nfs-kernel-server nfs-common portmap

Configure NFS Server

Configuring NFS server is relatively simply. Edit the file /etc/exports file and add all the directories available as a share. The format should be as follows

/media/cdrom 192.168.0.1/24(rw,async)

  • mount point on local system.
  • host
  • permissions
  • Using the above string this would share the CDROM to any computer with the IP range 192.168.0.1-192.168.0.254 that has read and write permissions and requests can be process asynchronously.

    Specific IPs can be given to each share like this:

    /media/cdrom 192.168.0.1(rw,async) 192.168.0.1(ro,async)

    Computer 192.168.0.1 has the permissions described in the above example and the computer with 192.168.0.2 only has asynchronous requests and read only access to files for that share.

    When specifying mount points note where the spaces are and are not because spaces are read by the system so

    /media/cdrom 192.168.0.1 (rw,async)

    is invalid because there is a space between the IP address and the parenthesis.

    Once all the shares have been configured it is necessary to restart NFS to see the changes:
    sudo /etc/init.d/nfs-kernel-server restart

    Mount NFS Share On Linux

    Install the NFS client if the computer does not have a NFS server itself:
    sudo apt-get install portmap nfs-common

    To mount the share manually from the terminal type the following:
    sudo mount 192.168.0.1:/media/cdrom /media/share
    First is super user command sudo then mount command, IP address of NFS server followed by the path to share. The last parameter is the local mount point so in the above example it will mount the CDROM drive from the server onto /media/share directory of the client computer.

    To make the mount more permanent edit the /etc/fstab file and the following line, one for each NFS share.

    192.168.0.1:/media/cdrom /media/share nfs rsize=8192,wsize=8192,timeo=14,intr

    The only part that needs to be changed is the IP address, NFS share point and the mount point. This is highlighted in bold in the example above. The rest should be fine left as is. This change should mount the share when the computer is started.

    Mount NFS Share On Windows 7 Ultimate Edition

    NFS support does not come as standard with Windows so it has to be installed. Also I only found the feature in Windows 7 Ultimate Edition and not the Professional. I believe there is a Business Edition in between but do not know if it has the support for NFS.

    Go to the Control Panel and on the left hand side click on Turn Windows features on or off hyper link. It will load a list of software in a tree / node structure. Find Services for NFS and tick Client for NFS as a minimum.

    On the start menu right click on Network and select Map network drive. If this option is not in the start menu go to Computer and right click on Network from the left hand panel. A wizard will start for mapping a network drive.

    Select the drive letter to be assigned to the NFS share and for the Folder enter the address [server]:[path] for example 192.168.0.1:/media/cdrom
    Tick Reconnect at logon if you want it to connect on start up and click Finish to end the wizard.

    The only problem with mounting the NFS on Windows is every time Computer it takes a longer to scan and load the drives because it scans the NFS to get the size and amount used on the NFS.

    Summary

    NFS between Linux machines is perfect and a good way to share files. Mounting a NFS makes the local share look as if it was it was local drive.

    For Windows I’d stick to using Samba because it doesn’t take a while to scan the shared drive every time the drive is highlighted to get the drive information such as amount of space available. It’s not a nice to administer two services doing the same thing but it works.

    NFS Server and Client Configuration in Ubuntu

    31

    Jan/10

    Enable SFTP On VSFTPD In Ubuntu

    Sunday, January 31st, 2010

    Enabling SFTP is very easy and makes FTP protocol a lot more secure than traditional FTP because passwords are not sent in plain text which is susceptible to a lot of things such as packet sniffers, man-in-the-middle, etc.

    Assuming VSFTPD has been installed (in the default location) edit the file /etc/vsftpd.conf and check there are security certificates installed and configured.

    There are two entries which start with either:
    dsa_cert_file
    dsa_private_key_file

    or
    rsa_cert_file
    rsa_private_key_file

    Each specifying a file path to where the key and certificates are located.

    The last step is to enable SFTP by adding the following line:
    ssl_enable=YES
    Save and exit the file and restart the FTP server sudo /etc/init.d/vsftpd restart

    19

    Jan/10

    Bypass Blocked Websites Using SSH Proxy

    Tuesday, January 19th, 2010

    Overview

    SSH tunnels are very useful for all sorts of things. One of these uses include proxy. If you have SSH access you can set one up very quickly.

    I do not condone any misuses of any I.T equipment, software or any other kind described in this article. All practices should be used within the law and policy set by your region. Any examples are given are done so to highlight the uses this article may provide.

    Uses

    By using your own SSH proxy you can by pass firewalls or blocked websites by directing the data through this connection and out from your SSH server.

    For example at a work place they block websites such as Facebook, Twitter, etc. As long as you can connect to your SSH server the web traffic can be re-routed through this connection without the company seeing what is happening when the data is being re-routed apart from you have a SSH session (which may raise some eye brows if you do not have a legitimate use in your daily activities).

    Pre-requisites

    A server running an SSH server. The remainder of this article will be done on a Ubuntu box.

    Install SSH server by entering the following command in the terminal:
    $ sudo apt-get install openssh-server

    The default configuration should suffice and you can use your local accounts to log in.

    Establishing Multiple Ports

    It is generally a good idea to have your SSH server listening to more than just the default port (which is 22). Most places may ban this port to stop SSH session going out of an organization potentially leaving a connection open for unwanted outsiders.

    To work around this look at my earlier article on how to set up multiple ports on the SSH server.

    Using Proxy On Windows

    Download Putty from Putty’s website. It’s just a small program that lets you connect to a SSH server amongst other protocols.

    Starting the program up will show a window with a tree like navigation to the left and settings pane to the right and a bunch of buttons at the bottom. The following sections are based on the nodes on the left hand side of the window.

    Session

    Enter the IP address of the server and the ports configured above. Ensure the Connection type is set to SSH.

    In Saved Sessions enter a name to call your connection so you do not have to enter the above and the following details every time. Do not press the Save button till all the settings have been set.

    Connection > SSH > Tunnels

    Enter the port your web browser will be using in the Source port box.

    Leave Destination blank and select Dynamic and Auto radio buttons. Click the Add button to add the connection tunnel to the list. Multiple tunnels can be entered as long as different ports are used.

    At this point you can go back to the Session page and save the session by clicking on the Save button. To load the connection next time, select it from the list and click on the Load button.

    Click on the Open button to initiate the connection.

    A warning my come up if it’s your first time connecting to your server via SSH. Accept it and it will prompt for a username then password. Enter your details pressing enter at each stage to move onto the next.

    Once you get in it’s time to configure the web browser.

    FireFox

    Go to Tools > Options… Select the Advanced button and go to the Network tab. Click on the Settings button in the connection area. A new window should pop up.

    Select Manual proxy configuration and set the HTTP Proxy to localhost and the source port set in the Putty section. Ok to all the dialogues and your done.

    Internet Explorer

    Go to Tools > Internet Options. In Internet Options window go to the Connections tab.

    Click on the LAN settings button to reveal another window.

    In the Proxy server settings tick the box for Use a proxy server for your LAN… and enter the address as localhost and the port as the source port in Putty. Save and close all dialogue boxes and windows.

    Summary

    A neat trick to stop people snooping at your browsing habits or just to avoid blocked sites. Sites may load slower because it has to go from your local machine, to the proxy server and out to the Internet and back again.

    28

    Dec/09

    Unable to access MythTV Perl API. Try with –verbose to find out why.

    Monday, December 28th, 2009

    I have been getting the error message

    Unable to access MythTV Perl API. Try with –verbose to find out why.

    on MythTv running on Ubuntu 8.04. It wasn’t bothering me too much because the TV guide was still being updated. Also I believe this is something to do with MythTV-Status only which prints out in the console what is being recorded (if any), next up coming recording and the amount of available space.

    The problem is the MythTv-Status program is ran on a schedule and is requires the config.xml in the ~/.mythtv directory to be copied or a symbolic link in /root/.mythtv Run the following commands to solve the problem:
    $ sudo mkdir /root/.mythtv
    $ sudo ln -s ~/.mythtv/config.xml
    $ sudo /etc/init.d/mythtv-status reload

    The last command will run MythTv-Status to read the new configuration XML file and run without any errors.

    The only problem it has caused is that it does not say how many days worth or TV guide it has where as before this fix it specified it with errors.

    Unable to access MythTV Perl API. Try with –verbose to find out why. Ubuntu Forum