Pages

Saturday, June 12, 2010

Ubuntu - Link the folders with "ln"

 Hello folks,
            The purpose of writing this blog is only because i want to link two folders and when i tried to google it no good reults are there that can satisfactory show you how the two folders are linked. So here I will describe the most simple way how you can link two folders.

           The command you are looking for is "ln". This command creates the symbolic links in the Linux. The word "Symbolic" means that no matter you enter in any of the two linked folder you will end up in the same physical location. So now when you make changes to any of the folder it will reflect to the other folder also. So it means that it is shown to you as two different folders but actually they are one folder with two different names. This two folders can be in any directories, any path, it doesn't matter.

        Example:
          Say i have following structure of directories
            /root/
            /root/source/
            /root/dummy/

          And i want to link the "source" directory with say "link" directory

          you don't need to create the directory named "link" it will be created automatically.

          Run the following command
          ln -s /root/source /root/link
Note :  You can remove the "link" folder when ever you like to remove the link because it is just a link not actual folder. while if you remove the "source" folder then the "link" folder will not have any physical link to go to. so you will be stuck with the dead link.

        for more regarding command "ln" please check the manual page of ln - click here. there is wiki page for "ln" click here.

Thursday, June 10, 2010

Kubuntu Proxy setting for apt


We have a Netcache webproxy in use at work and so to get the various apt-get and adept commands to work it is necesary to do some configuration.
There are a few posts on the web about how to do this some, saying you just need to set the environment variable http_proxy, others that you must specify the proxy settings in the file/etc/apt/apt.conf.d/70debconf . For my Kubuntu install I found a mixture of the two was required, more of which anon.
Firstly a word about what the url for your proxy should be: If it is a proxy that requires authentication then it will need to be of the form “http://username:password@proxy.blah.com:8080″using your username, password and the dns name or ip address of the proxy itself and whatever port number your proxy listens on at the end.
N.B. If your password ever expires and/or gets changed then you will need to update the proxy url wherever you set it.
Following is a summary of my findings and what needs to be set where.
  • Adding a line
    export http_proxy=”http://username:password@proxy.blah.com”

    in /etc/bash.bashrc works fine for using apt-get commands from the command line but the graphical tool adept does not appear to read this file or somehow ignores the http_proxy environment variable.
  • For adept to work you must remove the line Acquire::http::proxy “false”; from /etc/apt/apt.conf to get any other apt.conf.d file settings to work.
  • Add in the line
    Acquire::http::proxy “http://username:password@proxy.blah.com:8080″;

    to the end of /etc/apt/apt.conf.d/70debconf (this file seems to be the “traditional place” to put this setting.)
This got me up and running. I also found the command apt-config dump very useful for displaying the settings that apt-get is going to use. Bear in mind however that for command line apt-get usage the http_proxy environment variable, if it is set, appears to overule whatever Acquire::http::proxy settings you may have in apt.conf.d files.
You can just set the Acquire::http::proxy setting and apt-get from the command line will use this in the same way as adept does but as I like to use wget for fetching the odd file from the ‘net I needed http_proxy set anyway.
Clear as mud? That’s got that sorted then.