Posts

    Saturday, 7 September 2013

    Automatic log manager for Game of Thrones series.

    I watch a lot of anime. When I started watching One Piece which had 500+ episodes, it was very hard for me to keep track of how many episodes I have seen already. So I used to keep a log file which always had the next episode's number and I used to manually update it whenever I watch an episode.

    That was a good idea but not good enough :P. At least for awesome people like me doing work manually is too mainstream xD.
    If you do all the work what is your computer there for???
    So I wrote a script which automatically manages the log. And next time when I run the script it will continue from the place I stopped last time \m/. Now I am planning to start Game of Thrones TV series. People tell I'll like it because I am a big fan of Age of Empires and I love wars :D.

    So now what I am planning to do is to automate viewing it just like I did for One piece. In the version of Game of Thrones which I have, each episode name has SxxExx in it. For example S02E09 is there in the file name of episode 9 in season 2. So using this I can iterate over series and inside that i can iterate over episodes.

    Setup

    Download the gist from here or copy it from here:

    Step1

    Place the script in the base folder which has folders of all the series. Make it executable:
    $ chmod +x script.sh

    Step2

    create a file called "log" in the same folder. The log file contains current series number and episode number. For example if you are watching third episode of season 1, put 1:3 in that file and save it.

    Running:

    Just go that folder in terminal and do this:
    $ ./script.sh

    Now just enter the  number of episodes you want to watch in a stretch and enjoy!

    Monday, 20 May 2013

    Customizing linux terminal with powerline (powerline-shell)

    Borded of how your terminal looks?
    In the past I used to edit the bash superglobal $PS1 to make it look a littile better.
    I found this awesome thing called powerline-shell on github which makes your terminal look so awesome. Not only it makes your terminal look beautiful it also helps us to visualize many things easily. Like errors, git stuff..etc
    I took some time and modified it a little. Here is mine:

    Download

    How to get it?


    1.  Download powerline-bash.py from the link and place it in the home folder.
    2. Make it executable

      chmod +x ~/powerline-bash.py
    3. Then add the following lines to the file ~/.bashrc:
      function _update_ps1() {    export PS1="$(~/powerline-bash.py $?) " } export PROMPT_COMMAND="_update_ps1"
    4. Now patch the font. Download anonymous Pro-Powerline.ttf and open it to install it
    5. You are done!!! Now just open the terminal.


    NOTE: If it doesn't work properly and prints some garbage elements then u have to patch the font you are using for your terminal from here

    Saturday, 18 May 2013

    Jarvis, at your sevice


    Hello everyone! Its been a long time since I blogged. Today I will show you how to use 'Jarvis' which is an open source software which can be used to control your Linux system using your hand motion, gestures which was made as my Human Computer Interaction project. This is mainly an image processing based project developed using python.



    Things u can do using Jarvis:


    1. The first thing you can do using Jarvis is control your mouse. You just need a colored object (preferably has color different from its background). So you can do things like draw in air!
    2. The second thing is that you can assign any gesture which is a combination of
      Left->Right, Right->Left, Top->Bottom, Bottom->Top to any command. So using this you can literally perform anything!!! The following are the things you can do by default:

    • Maximize/Minimize/Close current window
    • Go next and forward in PPT presentation
    • Page up and Page down
    • Switch window (Alt+tab)
    • Take screenshot
    • Shutdown/Suspend system
    • Mute and unmute
    • Open Calculator, File manager, Gedit


    You can practically add anything else also. All you need to know is the command which does that and the equivalent of the gesture which you want to assign in the combination of Left->Right, Right->Left, Top->Bottom, Bottom->Top.

    Getting dependencies:

    Ubuntu:
    $ sudo apt-get install python-opencv xdotool
    Fedora:
    $ sudo yum install python-opencv xdotool

    Installation:

    $ git clone https://github.com/alseambusher/jarvis.git
    $ cd jarvis
    $ ./install

    Now you need to set the screen resolution of your screen. If your screen resolution is 1366x768 then skip this step.
    $ gedit ~/.jarvis/config.py
    change the value of variable RESOLUTION corresponding to your screen resolution.

    Running:

    Now simply open Jarvis from your Applications menu
    OR
    Do this:
    $ cd ~/.jarvis
    $ python main.py
    Now click on Start Jarvis 

    Add new gesture:

    1. Go to settings from the File menu


    2. Click on Add gesture from the File menu of settings


    3. Suppose say that you want to add a gesture which opens terminal.
    Say the gesture you wish to give is (Left to Right)->(Right to Left)->(Top to Bottom)->(Bottom to Top)
    The command corresponding to open gnome terminal is 'gnome-terminal'

    4. Fill the details and save it.


    You are done!!!

    Editing and deleting gestures are simple :P

    How to use?

    We need two different colored objects which are required to run. One the tracker and the other one is the flag!

    1. If the flag is not exposed then the gesture is disabled and Jarvis works as a mouse controller.
    2. When both tracker and flag are exposed the gesture begins. Perform the gesture using the tracker. Once the gesture is complete hide the flag. Jarvis then processes and analyses the gesture performed and checks for any matches from the existing database. If there is a match then it executes it!.

    Customizing Tracker and Flag color:

    By default the tracker is yellow color and flag is blue color.
    You can change it by editing the config.py file

    $ gedit ~/.jarvis/config.py

    Change the min and max values of TRACKER_COLOR and GESTURE_COLOR corresponding to the HSV values of the color intended

    By default these are the values:
    TRACKER_COLOR={'MIN':[20,100,100],'MAX':[30,255,255]}
    GESTURE_COLOR={'MIN': [108.0, 100, 10],'MAX': [118.0, 255, 255]}

    Thank you. Dont forget to contribute to this open source project as there is a lot of scope for improvements. :)

    Fork the project from here: https://github.com/alseambusher/jarvis

    Thursday, 4 April 2013

    Open with script in Gnome/Ubuntu

    I always liked the feature open with script which was there in old ubuntu. I have no clue why they removed it. However as always in Linux there is always a way to do anything! Today I will show you a simple way( complex than before though ) to do it. Using this I was able to install Picasa Photo Viewer, Logism, yEd, MS Office..etc on my Ubuntu \m/

    Step 1: Find MimeType of the target file (the file you want to open). You can find it in file properties


























    Step2: Download this gist. And make it executable:

    $ chmod +x open_with_script.sh

    Step3: Then run the script and enter necessary details. For example I was trying to install yEd, an awesome Software Engineering Drawing tool. This is what I did:
    NOTE that if the command is <command> <file name> enter as <command> %U





















    Step4: This step is optional. This is to set font to the script. If you don't wanna do it, skip it. Open application called "Main Menu" or alacarte which comes by default in ubuntu. Then search for the script you just added and then set the font.

























    Step5: Now just set the file to open with the script by default if necessary using file properties.


























    Now you can simply open the file using yEd by default. So you are done!!! 

    Saturday, 16 March 2013

    Installing Turbo Assembler (TASM), Turbo Debugger (TD) on Ubuntu

    Step 1
    First we will install an windows emulator called dosbox.
    sudo apt-get install dosbox

    Step2

    Download the packages for Turbo Assembler(tasm) Turbo Debugger(td). Create a directory for tasm in your home directory and extract files into that directory.If you are unable to extract type this in your terminal and try again
    sudo apt-get install unrar

    Step3

    download this sample .asm file. Place the file in the tasm directory.

    NOTE:  You can use your own asm file instead

    Step4

    Open dosbox( generally found in games sublist ). Now you have to mount the virtual c drive.
    mount c /home/<username> eg: /home/alse

    Step5

    Now go to your TASM directory



    Now test the test3.asm which you downloaded






    Tuesday, 26 February 2013

    Make STAR WARS message greet you when you open the terminal

    I am a great fan of STAR WARS like many of you out there. So I decided to write a script which greets me with star wars message every time I open my Terminal to code.
    Suppose say you are using Bash, when you open your terminal the file ~/.bashrc will run. Similarly if you are using Zsh => ~/.zshrc will run. So basically I can just put an echo statement in that to make it greet me every time I open my terminal. Today lets do something more interesting. Someting like this:


    To get this you can just download this gist and add the contents in it to ~/.bashrc or ~/.zshrc or ~/.cshrc ..etc depending on which shell you are using. Or you can just copy the following and paste it in ~/.bashrc or ~/.zshrc or ~/.cshrc


    Saturday, 16 February 2013

    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443



    I was setting up SSL on localhost to get https://localhost. I was successfully able to get the digital signature, sign it. But when i restarted apache2 I was getting this error:

    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

    This means that port was already being listened. Hence at first I tried to kill the processes which are using that port. When this didn't work I tried this:

    open /etc/apache2/ports.conf
    Remove the line outside any <IfModule> tag which says Listen 443

    Problem solved!!

    Wednesday, 6 February 2013

    Top 100 apps / software / libraries in Linux


    Yesterday I took up the task of of listing out top hundred+ apps/softwares/libraries I use in Linux thinking that it might help people to make a list of what they have to install when they have newly installed linux.

             Editors
    1. vim - Vi improved
    2. gvim - Vim with GUI
    3. emacs
    4. kate
    5. geany - Good editor for many languages.
    6. bluefish - Good editor for PHP, Javascript, HTML, CSS
    7. code blocks
    8. eclipse
    9. netbeans
    10. pycharm 
    11. jedit

      Programming
    12. qt designer - Design in Qt
    13. pyqt4 - Python Qt library
    14. qt creater - Design and Code for Qt
    15. freeglut - OpenGL library
    16. filezilla - Good ftp client
    17. g++ - c/c++ compiler
    18. cmake - Cross-Platform Makefile Generator
    19. wireshark - Packet analyser
    20. unetbootin - startup disk creater
    21. apache2 - apache server
    22. mysql - mysql client/server
    23. php5 - php5 library
    24. php5-mysql - mysql library for php
    25. ipython - interactive python shell
    26. phpmyadmin - manage mysql databases
    27. open-jdk - java development kit
    28. git - revision control
    29. sqlite3 - database
    30. arduino - arduino programming
    31. linux-matlab - matlab for linux
    32. FontForge - create your ttf, ps..etc
    33. xampp

      General stuff
    34. unrar - extract files from rar archives
    35. ark - KDE archiving tool
    36. kchmviewer -  Windows CHM viewer for KDE
    37. gsnash-viewer - swf viewer
    38. virtualbox - x86 virtualization solution
    39. wine - wine is not an emulator
    40. deluge - torrent client
    41. linuxdcpp - Dc++ client
    42. ubuntu-tweak -tweak ubuntu settings
    43. compiz-config -change compiz settings
    44. k3b - CD/DVD buring tool
    45. brasero - CD/DVD buring tool
    46. nerolinux - CD/DVD buring tool
    47. playonlinux - Play on Linux
    48. q4wine -runs  GUI utility for wine applications and prefixes management.
    49. dropbox - cloud
    50. gnome-do - Launcher application
    51. gparted - partition manager
    52. empathy - GNOME multi-protocol chat and call client
    53. lightread - Google reader
    54. pidgin - IM client
    55. dolphin - File manager
    56. thunderbird - Mail manager
    57. cheese - webcam client
    58. evolution - calander
    59. adobe flash player
    60. axel - A light download accelerator for Linux
    61. proxychains - proxifier for linux
    62. ubuntu one - ubuntu cloud
    63. stellarium - astronomy
    64. byobu - cool terminal
    65. burg - customize how your bootloader looks
    66. dosbox
    67. docky - dock
    68. avant-window-navigator - MacOS X like panel for GNOME
    69. gnome-do - awesome searcher

      Update
    70. Conky

      Package Managers
    71. synaptic - package manager
    72. apt-fast - 'apt-get + axel' to download very fast
    73. aptitude - command line package manager
    74. pacman - package manager

      Browsers
    75. chomium-browser
    76. google-chrome-stable
    77. firefox
    78. konqueror - advanced file manager, web browser and document viewer

      Media editors
    79. picasa(on wine) - photo editor/viewer
    80. blender - 3D modelling
    81. gimp - photo editor
    82. audacity - audio editor
    83. inkscape - an SVG editing program
    84. dia - diagram editor (UML,Use Case,ER..etc)

      Update
    85. Kdenlive - awesome video editing software

      Media Players
    86. amarok
    87. banshee
    88. vlc
    89. mplayer
    90. Rhythmbox

      Interfaces
    91. unity
    92. gnome-shell 3
    93. kde plasma
    94. awesome
    95. openbox

      Games
    96. open Arena
    97. savage2
    98. assault cube
    99. nexuiz
    100. super tuxkart
    101. blobby volley
    102. hedgewars

    Saturday, 29 December 2012

    Minimizing all windows to show desktop in gnome 3.5.4

    I Just upgraded to gnome 3.5.4 from gnome 3.4 on Ubuntu and now I feel that it is one of the most buggiest gnome versions ever :(
    Gnome shell extensions are one of the best things ever for me especially when gnome came up with installing extension from their website. But unfortunately for Gnome 3.5.4 almost no extensions in their website support it :'( . And it is extremely hard to install gnome shell extensions from their source.
    One of the most annoying thing is that "Hide all normal windows" feature doesn't seem to work. And bug while changing brightness still not fixed.
    So I have decided to manually fix each of the bugs myself for now.
    Today I will show you how to enable "Show Desktop" or "Hide all normal windows"

    Open Terminal and install xprop and xwit

    sudo apt-get install xprop xwit 

    Download the Gist file which i have created or copy from below and save it as minimize.sh
    Loading ....
    Then open Keyboard shortcuts and create a Custom Shortcut










    Then give a name to the shortcut and in place of command give the link to the script which you just downloaded. Make sure that that file is executable. If not change it using file properties or use chmod.

    Now assign some key for it preferably Super+D

    If you don't  like doing all those there is a docklet called "Show Desktop" for Docky which still works pretty well if you don't mind using your mouse :P

    Saturday, 15 December 2012

    Make a bootable usb for windows using DISKPART

    It has been some time since i came to know about this method and I really don't remember from where I came to know how to do this.
    Although there are many software with GUI which can do exactly the same thing as this, I prefer to do it via command line simply because i don't want to depend on some dumb software to do such a petty task :P
     The idea is to make a primary partition on you usb drive and put the contents of the windows os onto the usb drive. After making the bootable usb you can simply boot from usb to install windows.

    STEPS:

    1.   Go to Start->run
    2.   Type 'cmd' to open the command prompt
    3.   In command prompt type DISKPART
    4.   Then type LIST DISK. This should display all the active disk drives.
    5.   Now select the usb drive from the list. Say Disk 1 is the one ! type SELECT DISK 1
    6.   CLEAN
    7.   Now create a primary partition on your usb drive. CREATE PARTITION PRIMARY
    8.   SELECT PARTITION 1
    9.   ACTIVE
    10. Now format your usb drive to ntfs. FORMAT FS=NTFS
    11. ASSIGN
    12. EXIT
    13. Now copy all the contents in the windows iso or disk to usb drive( DONT COPY ISO ITSELF)
    14. Now boot from usb to install from the usb drive