How to set up FileZilla to connect to Digital Ocean Droplet

FileZilla is a free software, cross-platform FTP application, consisting of FileZilla Client and FileZilla Server.  Setting up FileZilla to access your Digital Ocean droplet is very easy. There are multiple ways to access it e.g. FTP, SFTP, using interactive mode, entering password everytime using keyfile etc. We will use simplest method, using SFTP and entering password everytime we try to login.

Step#1 Install FileZilla

Please refer to How to Install FileZilla on Ubuntu post

Step#2 Start FileZilla

Once you start the application, you will see below screen

Step#3 Go to File->Site Manager

Step#4 Set up “New Site”

  • Host” – you can find this information at your hosting provider. You can get ip by using following command ping <domainname.com>
  • Port” – You can leave this black, if you chose FTP, it will automatically select 21 and if you select SFTP, it will select 22.
  • Protocol” – protocol for exchanging files over any network. Please select”SFTP-SSH File Transfer Protocol”
  • Logon Type” – You can select whichever logon type is convenient to you. For now, please select “Ask for password”
  • User: The username having required access
  • Password: password


Don’t worry about any other tabs as of now.

Once done, clock on “Connect” and you will get connected to your Digital Ocean Droplet.

If you get any issue, please do let me know

How to Install GNU Paint on Ubuntu

GNU Paint (gpaint) is a simple, easy-to-use paint program for GNOME, the GNU Desktop. Gpaint starts as a port of xpaint and takes advantages of features unique to the GNOME environment. Gpaint is licensed under the GNU GPL, version 2 or later.

Current Features:

  • Drawing tools–ovals, freehand, polygon, text, with fill or shallow for polygons and closed freehand.
  • Cut and paste by selecting irregular regions or polygons.
  • Print support using gnome-print (still flaky, will be improved upon next release)
  • Modern, easy-to-use user interface with tool and color palettes
  • Editing multiple images at the same time without running multiple instances of the image editor
  • All image processing features present in xpaint

Installation

To install it type following command on terminal


$ sudo apt-get install gpaint

output


[sudo] password for USERNAME:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libglade2-0
The following NEW packages will be installed:
gpaint libglade2-0
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 161 kB of archives.
After this operation, 915 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libglade2-0 amd64 1:2.6.4-2 [44.6 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 gpaint amd64 0.3.3-6.1build1 [117 kB]
Fetched 161 kB in 10s (15.4 kB/s)
Selecting previously unselected package libglade2-0:amd64.
(Reading database ... 164728 files and directories currently installed.)
Preparing to unpack .../libglade2-0_1%3a2.6.4-2_amd64.deb ...
Unpacking libglade2-0:amd64 (1:2.6.4-2) ...
Selecting previously unselected package gpaint.
Preparing to unpack .../gpaint_0.3.3-6.1build1_amd64.deb ...
Unpacking gpaint (0.3.3-6.1build1) ...
Setting up libglade2-0:amd64 (1:2.6.4-2) ...
Setting up gpaint (0.3.3-6.1build1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

Once installation is done you can find gpaint in list of installed application and its ready to use. Here is screenshot of gpaint

How to Install FileZilla on Ubuntu

Installing FileZilla on Ubuntu is very easy, simply follow below steps

Step#1 Update the system


$ sudo apt-get update
[sudo] password for user:
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 252 kB in 17s (15.3 kB/s)
Reading package lists... Done

Step#2 Install FileZilla


$ sudo apt-get install filezilla
[sudo] password for iser: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  filezilla-common libfilezilla0 libpugixml1v5 libwxbase3.0-0v5 libwxgtk3.0-0v5
The following NEW packages will be installed:
  filezilla filezilla-common libfilezilla0 libpugixml1v5 libwxbase3.0-0v5 libwxgtk3.0-0v5
0 upgraded, 6 newly installed, 0 to remove and 1 not upgraded.
Need to get 9,359 kB of archives.
After this operation, 38.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 filezilla-common all 3.28.0-1 [2,301 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libfilezilla0 amd64 0.11.0-1 [48.3 kB]                                                                                                            
Get:3 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libpugixml1v5 amd64 1.8.1-7 [82.8 kB]                                                                                                             
Get:4 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libwxbase3.0-0v5 amd64 3.0.4+dfsg-3 [954 kB]                                                                                                      
Get:5 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libwxgtk3.0-0v5 amd64 3.0.4+dfsg-3 [4,182 kB]                                                                                                     
Get:6 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 filezilla amd64 3.28.0-1 [1,791 kB]                                                                                                               
Fetched 9,359 kB in 27s (345 kB/s)                                                                                                                                                                                
Selecting previously unselected package filezilla-common.
(Reading database ... 163752 files and directories currently installed.)
Preparing to unpack .../0-filezilla-common_3.28.0-1_all.deb ...
Unpacking filezilla-common (3.28.0-1) ...
Selecting previously unselected package libfilezilla0.
Preparing to unpack .../1-libfilezilla0_0.11.0-1_amd64.deb ...
Unpacking libfilezilla0 (0.11.0-1) ...
Selecting previously unselected package libpugixml1v5:amd64.
Preparing to unpack .../2-libpugixml1v5_1.8.1-7_amd64.deb ...
Unpacking libpugixml1v5:amd64 (1.8.1-7) ...
Selecting previously unselected package libwxbase3.0-0v5:amd64.
Preparing to unpack .../3-libwxbase3.0-0v5_3.0.4+dfsg-3_amd64.deb ...
Unpacking libwxbase3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Selecting previously unselected package libwxgtk3.0-0v5:amd64.
Preparing to unpack .../4-libwxgtk3.0-0v5_3.0.4+dfsg-3_amd64.deb ...
Unpacking libwxgtk3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Selecting previously unselected package filezilla.
Preparing to unpack .../5-filezilla_3.28.0-1_amd64.deb ...
Unpacking filezilla (3.28.0-1) ...
Setting up libpugixml1v5:amd64 (1.8.1-7) ...
Setting up libwxbase3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Setting up filezilla-common (3.28.0-1) ...
Setting up libfilezilla0 (0.11.0-1) ...
Setting up libwxgtk3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Setting up filezilla (3.28.0-1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...

Now you are all set, you can see FileZilla in installed application list

How to enable wifi by default on Windows 10

Recently my hard drive crashed and I had to reinstall windows 10. After installing Windows 10, everytime when I log in, I had to manually start the wifi. This was nagging me so I decided to fix it.

This can not be fixed by controlling startup enable applications menu.

To fix this issue to go “Device Management” (Windows+x) –> Network Adapter–> Properties

I have dell wifi adapter, you might have different depending on manufacturer of laptop.

In Properties go to Power Management and uncheckAllow the computer to  turn off this device to save power

 

Now restart laptop and see wifi adapter is on

Yahoo deleted all my emails !

I had created yahoo account way back when I was doing engineering. It was primarily used to forward and receive funny emails and class assignment files. I used to login once in a while, this email has always been my backup email.

After lot of time (certainly after 12 months ) I logged in to yahoo to find out all my emails are gone. Firstly I thought it still syncing, like outlook program but then I though, this is not a desktop application which needs to be synced. I have logged into their website but still I could see zero emails in inbox and zero emails in sent folder.

I thought something is wrong, I  tried reloading but nothing changed. Then I sent test email from my other email account and after few seconds, I could see my inbox has one email. So this certainly not an issue with the loading of email.

That’s when I googled to find an horrifying fact. Yahoo has deleted all emails from users who has not logged in for over a 12 months !

They think account is abandoned if someone has not logged in for 12 month.

Well, its free account and they can do whatever they want but at least I expected an email on my back up email saying my account will be deleted since I have not logged in for 12 months and asking me to take corrective action. I got it from dropbox in similar scenario

You can refer to this link for more information.

Yes, I checked by back up email box and I don’t see any notification before yahoo deleted my email box !.

Over the period of time, I created many email IDs and I deleted or stopped using many of those which I though were unnecessary but never ever I though to give up my Yahoo account. I was like me bench-marking stone on internet. This account was special to me because it was first email that I created and It had lot of my old emails from my buddies. But now, without data this email is no longer special. Thanks Yahoo for helping me make this decision to give up this account itself.

I guess this is adios Yahoo.

Windows 10 | ‘pip’ is not recognized as an internal or external command

After installing python on windows 10, I wanted to install few more packages such as numpy, scipy, pandas, however I got following error


C:\>pip install pandas
'pip' is not recognized as an internal or external command,
operable program or batch file.

pip script is present in following folder


C:\Users\USERNAME\AppData\Local\Programs\Python\Python36\Scripts
OR
C:\Python\Python36\Scripts

To make pip work, we need to add this to path variable.


C:\>path %path%;C:\Users\USERNAME\AppData\Local\Programs\Python\Python36\Scripts

outcome after adding pip to path


C:\>pip install pandas
Collecting pandas
Downloading https://files.pythonhosted.org/packages/d0/4e/9db3468e504ac9aeadb37eb32bcf0a74d063d24ad1471104bd8a7ba20c97/pandas-0.24.2-cp36-cp36m-win_amd64.whl (8.8MB)
100% |████████████████████████████████| 8.8MB 36kB/s
Collecting python-dateutil>=2.5.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
100% |████████████████████████████████| 235kB 67kB/s
Collecting pytz>=2011k (from pandas)
Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
100% |████████████████████████████████| 512kB 64kB/s
Collecting numpy>=1.12.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/2e/11/f006363050b24fb19a235e5efd219e7ac549398d531110d80b8f2ba3a909/numpy-1.16.3-cp36-cp36m-win_amd64.whl (11.9MB)
100% |████████████████████████████████| 11.9MB 39kB/s
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, pytz, numpy, pandas
Successfully installed numpy-1.16.3 pandas-0.24.2 python-dateutil-2.8.0 pytz-2019.1 six-1.12.0
You are using pip version 9.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Windows 10 | ‘python’ is not recognized as an internal or external command

After installing python on Windows 10, I got following error.

C:\>python
'python' is not recognized as an internal or external command,
operable program or batch file.

To my surprise py works fine but python does not work.

C:\>py
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 

To make python works, we need to set up path. For Windows 10, python will be at following folder

C:\Users\USERNAME\AppData\Local\Programs\Python\Python36
OR
C:\Python\Python36

Use following command to set up path


C:\>path %path%;C:\Users\USERNAME\AppData\Local\Programs\Python\Python36

Once this is done, you can check the path variable using below command


C:\>echo %path%

Now let us try using python

C:\>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

How to find all files in a directory with specific extension using Python

Whenever we need to check if file with specific extension exists in a directory or get list of files with specific extension from a directory, it can be done using python. Here is simple program for doing the same.

There are three ways to do this using python

  1. os.walk
  2. os.listdir
  3. glob.glob

All three methods are demonstrated in below program

Output of the program

*** Program Started ***
List of Files using os.walk: ['file3.txt', 'list_to_file_in_directory.txt', 'test.txt']
List of Files using listdir: ['file3.txt', 'list_to_file_in_directory.txt', 'test.txt']
List of Files using glob : ['file3.txt', 'list_to_file_in_directory.txt', 'test.txt']
*** Program Completed ***

 

How to count number of files in directory using Python

Counting number of files using python in specific folder can be done using multiple ways.  Some of these are mentioned below

Here is the output

*** Program Started ***
Number of Files using os.walk : 7
Number of Files using listdir method#1 : 8
Number of Files using listdir method#2 : 7
Number of Files using listdir method#3 : 7
Number of Files using glob : 7
*** Program Completed ***

As you can see Number of Files using listdir method#1 are different, this is because, its counting a folder as a file.

 

How to write a list to a file and read a list from file using Python

Many a times we need to store list in a file for later usage, in such cases, its better to store list in a file and read this file into list whenever we need to use. Python has very easy methods for achieving this.

 

Output of the program

*** Program Started ***
lines : ['one', 'two', 'three', 'four', '']
type of lines : <class 'list'>
line : one
line : two
line : three
line : four
line :
*** Program Completed ***

file generated is as below

Here is another version of same program

output and file generated is same except file opening closing styles are different.