Show Line Numbers in Vim

Vim (Vi iMproved) is a text editor for Unix. It is free and open-source software. It is a popular text editor for system administration and development work. When you start Vim, it looks minimal but it is very powerful under the hood. Depending on your level of comfort with Linux, you may use Vim for … Read more

Automation with Bash Scripts

Are you able to automate with Bash scripts? Definitely! Is this something you want to do all the time? Of course not! It depends on the situation. What is it that you are automating? If you are a System Administrator, SRE or a frequent user of Linux, Bash scripts come in handy. There are things … Read more

Understanding Big O Notation

Looking from the outside, Big O is very scary. Why? O is not an abbreviation for a word, it’s a concept. It’s a concept used in mathematics. It’s a concept in computer science when we want to talk about algorithms. What is algorithms? Yeah, that is another scary concept on its own but we’re here … Read more

How do you iterate over a dictionary in Python?

Suppose you have a piggy bank containing a lot of coins and you want to count them. You store your coins in a dictionary. Once you finish adding them in the dictionary, you want to know how much you have of each denomination. How do you do it? To see this example in real life … Read more

How to get the current time in Python?

There are many ways to get the current time in Python. Good thing Python has provided us with a module we can just import and use right away. Do consider how you plan to display the current time. Does it include the date with the time or is it just the time? If it includes … Read more

How to check if a Python list is empty?

Suppose you are writing a Python program and you want to check if a list is empty. How would you do it? This should be something that is very straightforward right? Or is it? The example could be a list of fruits that you are keeping track of. The list can be something like the … Read more

How to Generate a Random Number in Bash

There are a number of reasons why you may want to generate a random number in a Bash shell. We are referring to a Bash shell rather than using a programming language such as C++, Java or Python. Maybe you want to pull a random line from a file. Maybe you want to generate a … Read more

Python Date and Time

Python Date and Time

Adding a date or time to your program is really easy with Python. All you have to do is import date or import time and then use the available method calls.

Most likely though, you are here because you need something more than that. You probably need to convert epoch seconds to a date format. You may want to know how to get the difference between two dates.

How to Learn Python

How to Learn Python

Question. How do I learn Python? I’m not a programmer and I don’t know any computer languages but I want to start learning Python. How do I do it?

Troubleshooting Tips for Ruby on Rails

Although Ruby on Rails makes web development much easier, getting it set up is not so easy. There are certain quirks that may cause you grief. I”ve put together some questions and solutions I have come across when setting up my web projects.

Useful Regular Expressions

From the words of Peter Parker “With great power comes great responsibility” so too is the power of regular expression. It is concise, flexible and powerful. At the same time, it can do complex matching of text such as characters, words and patterns of characters.