Deja Vu

Jul 27

Python : PrettyPrint a OrderedDictionary

pprint is a very handy module for printing out objects in a humane form.

Unfortunately it doesnt prettyprint OrderedDict objects properly.

The following is a workaround for printing a OrderedDict object in a manner close to what pprint does for a regular dict

Use json module’s dumps method to print the OrderedDict

import json
od = <Your OrderedDict>
print(json.dumps(od, indent=4))

Download Linux Mint System Administrator's Practical Guide for Beginners -


Chapter 1: Introduction to Linux Mint
  • Overview
  • A bit of history
  • Open source project
  • Contributing to the project
  • Why Linux Mint is different
  • Editions
  • Summary
  • References
Chapter 2: Installing Linux Mint
  • Creating a bootable Linux Mint USB flash drive
  • Time for action – downloading and burning the ISO image
  • Installing Linux Mint from a flash drive
  • Time for action – booting and installing Linux Mint
  • Booting Linux Mint
  • Time for action – booting Linux Mint for the first time
  • Summary
Chapter 3: Basic Shell
  • What’s a shell?
  • Where are you?
  • Time for action – learning pwd and cd commands
  • Running commands
  • Time for action – launching a program from the command line
  • Search commands
  • Time for action – using the which command
  • Listing, examining, and finding files
  • Time for action – using the ls, locate, find, and cat commands
  • Pipelines and redirection
  • Time for action – using pipelines and redirection by applying different commands
  • Setting environment variables
  • Time for action – setting the PATH environment variable
  • Displaying command history
  • Time for action – using the history command
  • Creating your first shell script
  • Time for action – creating and executing a shell script
  • How to get help
  • Time for action – using the man and the info commands
  • Summary
Chapter 4: Account Provisioning
  • Who am I?
  • Time for action – finding out the current user
  • Becoming the root user
  • Time for action – using the sudo command to become the root user
  • Changing password
  • Time for action – changing the password for a user
  • Adding a new user
  • Time for action – changing the password for a user
  • Adding a new group
  • Time for action – creating a new group called develop
  • Adding a user to a group
  • Time for action – adding the user luke to the develop group
  • Changing user privileges
  • Time for action – granting permissions to a user for monitoring system logs
  • Summary
Chapter 5: Installing, Removing, and Upgrading Software
  • Installing software
  • Time for action – installing AbiWord word processor
  • Removing software
  • Time for action – removing the AbiWord program
  • Upgrading software
  • Time for action – upgrading software through the Update Manager tool
  • Summary
Chapter 6: Configuring hardware
  • Detecting hardware
  • Time for action – how to display the device information
  • Configuring your monitor
  • Time for action – changing the screen resolution
  • Configuring a keyboard
  • Time for action – adding a new layout
  • Configuring your mouse
  • Time for action – changing mouse orientation
  • Configuring sound
  • Time for action – how to enable window and button sound
  • Installing additional drivers
  • Summary
Chapter 7: Networking
  • Configuring a wired network
  • Time for action – configuring your connection
  • Configuring the wireless network
  • Time for action – how to connect your computer to a wireless network
  • Accessing a Windows-shared folder
  • Time for action – how to access a specific shared folder
  • Connecting to servers
  • Time for action – connecting to an FTP server
  • Summary
Chapter 8: Storage and Backup
  • Filesystem types
  • Disk quotas
  • Time for action – assigning disk quota to a specific user
  • Disk usage analysis
  • Time for action – examining disk usage
  • Creating backups
  • Time for action – making a backup of a specific folder
  • Restoring backups
  • Time for action – restoring a backup folder
  • Summary
Chapter 9: Security
  • Running an SSH server
  • Time for action – installing and configuring an SSH server
  • Installing an anti-virus software
  • Time for action – installing Clam-AV anti-virus
  • Configuring a firewall
  • Time for action – how to configure a simple firewall
  • Using a security module for the kernel
  • Time for action – installing AppArmor
  • Managing your password safely
  • Time for action – installing and using KeePass
  • Building a security checklist
  • Summary
Chapter 10: Monitoring Your System
  • Processes and services
  • Starting and stopping services
  • Time for action – stopping and starting an SSH daemon
  • Activating services
  • Time for action – activating Samba
  • Listing the running processes
  • Time for action – list the processes running on our machine
  • Displaying CPU, memory, and network usage
  • Time for action – Displaying resources information in real time
  • Summary
Chapter 11: Troubleshooting
  • Hardware
  • Time for action – checking memory, CPU, USB, and PCI devices
  • Checking log files
  • Time for action – listing the last five lines of the syslog file
  • Kernel
  • Time for action – using lsmod, modprobe, and dmesg commands
  • Networking
  • Time for action – checking who is listening on what port
  • Processes and filesystems
  • Time for action – finding a specific process
  • Summary

Jul 15

Git : How to stop tracking a file

To stop tracking a file that was previously being tracked by git, do the following:

Git shall now stop tracking the file

Jun 11


What HRs and Programmers look for in a resume…


What HRs and Programmers look for in a resume…

What is the best comment in source code you have ever encountered? -

// Magic. Do not touch.
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
#define TRUE FALSE //Happy debugging suckers
stop(); // Hammertime!
// drunk, fix later
// Replaces with spaces the braces in cases
// where braces in places cause stasis $str =...

(Source: stephantom)

May 30

Sublime Text 3 : Keyboard Fu : Navigate the sidebar using only keyboard

Sublime Text is an amazing text editor. To make it even more awesome, it has extensive support for all actions using keyboard only. This is the first post in my Keyboard Fu Series wherein I shall post random tips and tricks and shortcuts for using keyboard to do all sorts of action in Sublime Text.

So here is the first one.

To shift focus to the sidebar, use the keyboard shortcut

Now you can navigate the folder structure in the sidebar using arrow keys

May 26

Q&A: Clement Lefebvre: The man behind Linux Mint -


An in-depth, comprehensive interview! Clem shared his setup here a few years ago.

(via linuxmint)

May 18


Some pretty advanced, nerdy kids must use this playground slide.


Some pretty advanced, nerdy kids must use this playground slide.

May 13

Ubuntu / Xubuntu - How to autologin as a particular user

To enable autologin in Xubuntu


Apr 25

The Three Flaws in Software Design & How to Avoid Them ! -

In this series, Jeremy Walker & Max Kanat-Alexander discuss the Three Flaws of Software Design from Max’s book Code Simplicity: The Fundamentals of Software