Saturday, 6 October 2012

Securing your FileZilla settings from prying eyes

FileZilla save FTP site settings in plain text including passwords.
There is no way to save FTP passwords in encrypted form (as of my knowledge). The only thing we can do is, save FileZilla settings to encrypted volume/disk.

To do it we we need edit fzdefaults.xml file and change 'Config Location' property to location where we want to save our passwords.
Here are steps we need to follow

1. Find fzdefaults.xml.example file. On my debian squeeze it is located at '/usr/share/doc/filezilla-common/examples/'. Issue following command to find it at your computer

sudo find -name fzdefaults.xml.example

2. Copy it to $HOME/.filezilla folder. Do not forget to put here actual path to folder having fzdefaults.xml.example

cp (path to folder)/fzdefaults.xml.example ~/.filezilla/fzdefaults.xml

3. Open copied file in text editor

gedit ~/.filezilla/fzdefaults.xml

4. Scroll down and loacte property "Config Location". There will be a path just next to it. Replace it with the path to your desired secured location. Save and close.

5. Now move your previously saved FTP site settings to secured location. Make sure you move it NOT copied.

mv ~/.filezilla/sitemanager.xml (your desired secured path)/sitemanager.xml

Now all is done!
To verify if new settings are effective, run FileZilla, you should see all your old FTP settings there.

Friday, 21 September 2012

Print and save PDF files in Linux

Creating PDF in Linux is quite easy. Here i am illustrating it for Ubuntu 10.04

First we need to install cups-pdf package using agt-get

sudo apt-get install cups-pdf

It will be downloaded and installed at path /usr/lib/cups/backend/cups-pdf.
A new entry 'PDF' will also be added to printers list.

Now add current user on Execution

sudo chmod +s /usr/lib/cups/backend/cups-pdf

Now we need to create a new folder 'PDF' inside home folder

sudo mkdir ~/PDF/

Reason behind this is, when you print using this PDF printer, by default the files will be saved to PDF folder under your home folder. That's why we created above. However you can change it (see below)

If you want to change that default save folder then you can do this by editing the config file :

sudo nano /etc/cups/cups-pdf.conf

Find there line with text 'Out ${HOME}/PDF' (do not include quotes)

Replace it with your desired path, like

Out ${HOME}/Documents

Now all done. Enjoy print to PDF in Linux!

Friday, 26 August 2011

VB.NET Comment Remover

As a programmer I used to write lot of code along with the comments. Comments - the most important part of coding that help me understand my own code after few months when i forget about it’s working, logic… and look it like a stranger :)

Often we need to remove comments from code before forwarding it further because along with the comments we often leave there commented code that is not in use but we do not want to delete (due to any reason). There are two ways to do it.


1. First is to remove comments manually if the volume of comments is low.
2. Another way is to use regular expression replacement.

Either way require manual efforts, we have to go through each file and delete comment or run regex replacement. But what if application has hundreds of files?

To stop doing the bull work, i wrote a small tool to remove comments from entire application with few clicks. Download it here.



Requirements:
.NET 3.5 framework will be required to run this tool.

Limitations:
It can remove comment lines starting with comment character (') only. Inline comments are not supported in current version.

Further improvement/suggestions are welcome.