Skip to main content

Linux: Things I don't want to Google again

ssh: connect to host localhost port 22: Connection refused
------------------------------------------------------------------------------------------------------------
Error: 
ssh: connect to host localhost port 22: Connection refused

Solution:
install openssh-server
service ssh start
------------------------------------------------------------------------------------------------------------

Secure way of doing SSH: SSH with Keys 
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------

How to set proxy in Ubuntu terminal
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------


Using GREP
  ------------------------------------------------------------------------------------------------------------
    grep to search inside files in the same directory
    grep -nrw '.' -e "Input"

Installing Ubuntu (Credits: https://www.cse.iitb.ac.in/~aamod/ubuntu/install.html#repo)
------------------------------------------------------------------------------------------------------------

    You can either install Ubuntu by downloading the ISO file and creating a bootable device and create a disk partition, OR you can download the Windows Installer and install directly from windows.

    If you have another operating system already, it would be nice to backup your files (just in case). If in case you you blow up you Windows while trying to install Ubuntu (happened to me the first time I tried), you can download Windows from IIT Bombay's MS Store, if your from IIT Bombay. If your not from IIT Bombay, then God help you!

    You then also need to set up proxy settings if you are within the IIT Bombay network and repository settings if you need to install softwares and packages fast:

* Ubuntu Proxy Settings (Credits: https://www.cse.iitb.ac.in/~aamod/ubuntu/install.html#repo)
------------------------------------------------------------------------------------------------------------
Following is the way to get Ubuntu working under IITB proxy with apt-line installation
Ubuntu 11.04 and below, go to network proxy.

proxy either netmon.iitb.ac.in port 80 or www.aero.iitb.ac.in port 8081 for all protocols.

In exclusion list, add *.iitb.ac.in and 10.0.0.0/8.
Apply system wide

For Ubuntu 11.10 and above, go to Network from the dash. Network Proxy should be under it. Set proxy as above.

Now some files have to be edited:

Open terminal.
Type
sudo gedit /etc/apt/apt.conf /etc/environment /etc/wgetrc
This will open 3 files in gedit
      
If you are using aero proxy, P=http://www.aero.iitb.ac.in:8081/ . If you are using netmon, P=http://ldapusername:ldappassword@netmon.iitb.ac.in:80/. Use HTTP protocol only. No https://.... or ftp://....

        The /etc/apt/apt.conf should look like

        Acquire::http::proxy "P";
        Acquire::https::proxy "P";

        #### P is from previous step
        #### Notice: No FTP proxy
                   

        For /etc/environment,

        #### Something about PATH variable here

        http_proxy=P
        https_proxy=P
        ftp_proxy=P
                   
       
For /etc/wgetrc, Uncomment the proxy lines and replace the values by value of P. Uncomment the line use_proxy=on
       
Save files, restart Terminal and you are done!!!


* Ubuntu Repository Settings (Credits: https://www.cse.iitb.ac.in/~aamod/ubuntu/install.html#repo)
------------------------------------------------------------------------------------------------------------

    To use IITB apt software repositories in ubuntu, follow the steps:

        Make sure you have no FTP proxy in /etc/apt/apt.conf file. If you have followed proxy instructions from this wiki, you don't need to do anything.
        Make a backup of /etc/apt/sources.list if you want to.
        Open Terminal.
        Type & hit enter

    sudo gedit /etc/apt/sources.list

        A file will open in gedit. Replace all the contents by

        ######### Warning: Instead of maverick, use the name of your distribution in following lines
        # For 12.04, its 'precise'

        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick main restricted
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick main restricted

        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates main restricted
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates main restricted

        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick universe
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick universe
        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates universe
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates universe

        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick multiverse
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick multiverse
        deb ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates multiverse
        deb-src ftp://ftp.iitb.ac.in/os/ubuntu/archives/ maverick-updates multiverse
                   

        Save the file.
        Run sudo apt-get update in Terminal. You are done.
        Now you can install softwares from IITB repositories. They are very fast as compared to HTTP repositories.

Tar in terminal
------------------------------------------------------------------------------------------------------------
    * tar -zcvf archive_name.tar.gz folder_to_compress

'Cannot open display error
------------------------------------------------------------------------------------------------------------
    * Use the following command
        DISPLAY=:0

Error: exit status 1: Autolaunch error: X11 initialization failed. Cannot open display:
------------------------------------------------------------------------------------------------------------
    * Solution:
        Added the following lines to ~/.bashrc
            xhost +
            alias sudo='sudo DISPLAY=:0'
    * Ref: 
        http://superuser.com/questions/514688/sudo-x11-application-does-not-work-correctly
    * After effects:
        Whenever I open a terminal it will show the warning given below
            access control disabled, clients can connect from any host

Mount and unmount iso file in termial
------------------------------------------------------------------------------------------------------------------
    Mount
        sudo mount -o loop /home/vineeshvs/software_installations/SPEC/cpu2006-1.2.iso /media/iso
        Ignore the error
            mount: block device /home/vineeshvs/software_installations/SPEC/cpu2006-1.2.iso is write-protected, mounting read-only
    Unmount
        sudo umount /media/iso/



Comments

Popular posts from this blog

Install Modelsim in Ubuntu

Updates (23/09/14): The steps given below are for 32-bit version of Ubuntu. To install Modelsim on 64 bit Ubuntu, please refer to this link.  What is Modelsim? Modelsim is a hardware simulation and debug environment primarily targeted at smaller ASIC and FPGA design ( Ref ) How do I install it? Download Modelsim Linux edition from here   For more information visit me   Go to the download location of the .run file and type chmod +x ModelSimSetup-13.1.0.162.run Visit me for more details Use the command ./ ModelSimSetup-13.1.0.162.run install Modelsim  How do I start Modelsim?   Change your directory to 'Location_where_you_installed_Modelsim '/altera/13.1/modelsim_ase/linuxaloem   Type ./vsim   Verified on: Ubuntu 12.04 LTS

VIS & VL2MV

18/01/2016: -----------     Installing VIS model checker     ----------------------------         Download from: http://vlsi.colorado.edu/~vis/vis_files_2.4.html         Note: First do the installation of glu and then install vis or vl2mv (order doesn't matter)         Installation: Follow the steps in the VIS README file in http://vlsi.colorado.edu/~vis/vis_files_2.4.html         Pitfalls: Dont extract the vis and glu .tar.gz files using gui. Instead use the commands given below             % gzip -dc /tmp/glu-2.4.tar.gz | tar xf -             % gzip -dc /tmp/vis-2.4.tar.gz | tar xf -         Setting environment for VIS          ...

Installing Latex (Miktex+Winedt platform) in windows 7

courtesy: Jinu jayachandran (IIT Bombay) Note: To use latex in windows, you can use the softwares Mikitex and Winedt 1.install the mikitex 2.9 2.Install Winedit 7 3. Start->mikitex 2.9->maintenance->settings->general->change the preference for ‘install missing packages on-the-fly’ to ‘yes’ 4. Start->mikitex 2.9->maintenance(admin)->package manager->repository->change package repository->click ‘packages shall be installed from internet’-> give proxy settings and tick ‘authentication required’-> next->give ldap username and password 5. select any repository 6. Start->mikitex 2.9->maintenance(admin)->package manager->repository->synchronise 7.Start->mikitex 2.9->maintenance(admin)->update(admin) and update by selecting ‘use nearest package repository’ and give proxy settings Now you can start using mikitex using winedit interface. download MikiTex 2.9 download Winedt 7 userguide Note:The ldap i...