Thursday, 28 August 2014

Configure proxy on Ubuntu Terminal

To configure proxy for terminal in Ubuntu, you need to edit apt configuration file. You can do so by the following command:

sudo gedit /etc/apt/apt.conf

Add the line:
Acquire::type::proxy "http://proxyaddress:proxyport";

type can be http,https or ftp

Or on GUI:=>

Settings => System Settings => Network => Network Proxy

Select method as "Manual" and put in IP and Port.

Click "Apply System Wide" and enter password. You are done.

I was behind a http proxy server(, port-3128) of institute and needed to configure proxy for the terminal. This line is what worked for me:

Acquire::http::proxy "";

Tuesday, 26 August 2014

How to install a CA Certificate in Ubuntu

I was looking for the above problem when I found this to be a perfect solution.

Given a CA certificate file 'foo.crt', follow these steps to install it on Ubuntu:
First, copy your CA to dir /usr/local/share/ca-certificates/
sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt
then, update CA store
sudo update-ca-certificates
That's all. You should get this output:
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....
Adding debian:foo.pem
No file is needed to edit. Link to your CA is created automatically.
Please note that the certificate filenames have to end in .crt, otherwise the update-ca-certificates script won't pick up on them.

Thanks to Frantisek for his answer here.

Thursday, 7 August 2014

Removing the Shortcut Virus

I came across an intersting virus today.

Everything in pendrive becomes a shortcut. Although the file is not visible on the pen drive, it opens correctly when you click the shortcut.

These commands can be run on command prompt and are helpful to remove such virus from pendrive:

attrib F:\*.* /d /s -h -r -s


attrib -h -r -s /s /d f:\*.*

F being the drive letter.

The command simply restores your original files as they were. You are then free to delete the malicious shortcuts or let a anti-virus do the job.
For more info, see this.