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
Post a Comment