convert date time to timestamp in python
Simple code but powerful output. One of the ways to get unix timestamp using python. import datetime import time print int(time.mktime(datetime.datetime.now().timetuple()))
Simple code but powerful output. One of the ways to get unix timestamp using python. import datetime import time print int(time.mktime(datetime.datetime.now().timetuple()))
I was trying to configure containers to get IPs from dhcp and it was difficult. at last I found a way to do it and thanks to debian wiki it again solved my problem, the source to solutions :). Step 1 Installing lxc containers installing lxc in debian stretch aka testing apt-get install lxc… Read More »
I always wondered how come in elementary OS the title bar is transparent, When I found the way to change it in debian it was amazing, The GNOME 3 environment has simple and plan but under the hood we can do lot of customization, one of the commands used to customize is gsettings. Ok lets… Read More »
A simple script to change the background. Just a simple bash script for changing the position of your wallpaper, and it works on Fedora 18;) #!/bin/bash OPTIONS=”Centered Scaled Spanned Zoom Stretched Wallpaper Quit” select opt in $OPTIONS; do if [ “$opt” = “Centered” ]; then gsettings set org.gnome.desktop.background picture-options “centered” echo You choose the… Read More »
I was working on a project that involves moving data from one point to other, it involves a verity of commands. I am listing some useful tricks. 1. This script is a tiny script to compress, generate md5 and transfer any directory. tar cvJf $1.tar.xz $2; md5sum $1.tar.xz > $1.md5sum scp -i<private key> -P<port> $1.md5sum <user>@<hostname>:<path>… Read More »
This is work in progress configuration. Fetching mails is working fine. But need to check how to send mail. Ok lets get started. A short intro. If you are looking to configure and read mail through terminal this is one of the ways to go. Most of them simply suggest mutt or gnus for emacs.… Read More »
I was struggling to add an unofficial repo for amd catalyst. When I tried to add the key I get a strange error. “connecting to dirmngr failed” simplest hack to solve it is to give the following command from root. sudo -i dirmngr < /dev/null this will create necessary stuff for gpg. after the pacman-key… Read More »
This command finds the fastest mirror. The contry option is to narrow down the search as well as other options. reflector -p http -c ‘United Kingdom’ –threads 2 -f 5 -n 5 –sort rate > /etc/pacman.d/mirrorlist If you don’t want to disturb mirrorlist file then skip the last part. reflector -p http -c ‘United Kingdom’… Read More »
Acer C720 is compact and very handy. It is packed with celeron 1.40 GHz processor and 2 Gigs of ram with 32 GB SSD. It has a ~4100mAh battery which should last for 4+ hours with debian without X. I did a quick search and found a way to install debian on to this device.… Read More »
Recently I started working on a django project which is exciting at the same time challenging. I thought its good time to document some of the steps to deploy the project and these are the steps to follow. System requirements In a typical debian system run the following commands to get required packages before we… Read More »