Mastering BeagleBone Robotics

Hi guys, I was the technical reviewer of this book by Packt Publishing and I am helping them promote it. Do check the book out if you are interested in learning how to do robotics implementations with Beaglebone Black. The lessons can be extrapolated to most development boards including the Raspberry Pi and the language is fairly easy to understand. Look out for my name in the technical reviewers section! read more

Playing with Acme::Eyedrops

Today I had some fun with Perl code obfuscation Acme::EyeDrops module makes it ridiculously simple to add new obfuscation shapes to your code. Basically all it involves is creating a file with a extension  *.eye and use it to obfuscate your code. There are around 95 existing shapes to choose from to obfuscate your code including the popular Camel shape. There are a few country specific maps as well e.g. one for Canada. I used a image to ascii converter to convert the map of India into two formats. One where the map is the overlay and another where everything except the map is on overlay. I have pushed my .eye files upstream so you might be able to use it as soon as the dev’s accept my pull request. If you are impatient you can download the India specific .eye files from my github repository and manually copy them over. Here is my first result from a “Hello World” perl script obfuscated with my eye map:   Shape => ‘india_map’ eval eval '"'. +( '['^'+'). ('['^')').('`'|')'). ('`'|'.').('['^'/').( '{'^'[').'\\'.'"'.("`"| '"').('`'|',').('`'|'!') . ("`"| '(').('{'^'[').('`'|'"').('`'| ',').(('`')| '!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+' ).('['^')').('`'|')').('`'|'.').('['^"\/").( '{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`' |'!').('`'|'(').('{'^'[').('`'|'"').('`'|',' ).('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+' ).('['^'+').('['^')').('`'|')').('`'|'.') .('['^'/').('{'^'[').'\\'.'"'.('`'|'"'). ('`'|',').('`'|'!').('`'|'(').("\{"^ '[').('`'|'"').('`'|',').('`'|'!').( '`'|'(').'\\'.'"'.';'.('!'^'+').("\["^ '+').('['^')').('`'|')').('`'|('.')).( '['^'/').('{'^'[').'\\'.'"'.('`'|'"' ).('`'|',').('`'|'!').('`'|'('). ('{'^'[').('`'|('"')).( ( '`')|',').('`'|'!').(('`')| '(').'\\'.'"'.';'.('!'^'+').( '['^'+').('['^')').('`'|"\)").( '`'|'.').('['^'/').('{'^'[').'\\' .'"'.('`'|'"').('`'|',').('`'|('!')).( '`'|'(').('{'^'[').('`'|'"').('`'|(',')).( '`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('[' ^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{' ^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`' |'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').( '`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').("\["^ ')'). (('`')| ')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.("`"| '"').('`'|"\,").( '`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'| '!').('`'|'(').('\\'). '"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.'). ('['^'/').('{'^'[').'\\'. '"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"') . ('`'|',').('`'|'!').('`'|"\("). '\\' .'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^('/')).( ('{')^ '[').'\\'.'"'.('`'|'"').('`'|',').( '`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.( '!'^'+' ).('['^'+').('['^')').('`'|')').('`'| '.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|('"')).( ('`')| ',').('`'|'!').('`'|'(').'\\'.('"'). ';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').("`"| (',')).( '`'|'!').('`'|'(').('{'^'[').('`'| '"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').(('[')^ '/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!' ).('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')') .('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"'). ('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[') .'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.("\!"^ '+').('['^'+').('['^')').('`'|')').('`'| '.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'| ( '(')).'\\'.'"'.';'.('!'^'+').("\["^ '+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`' |'"').('`'|',').('`'|'!').('`'|'(') .'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').("`"| '!').('`'|'(').('{'^'[').('`'|'"' ).('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'['). ( ( ( (( '\\'))))).('"').( '`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+'). ('['^'+').(('[')^ (( ')' ))).('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').(('`')| ',').('`'|"\!").( '`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!'). ('`'|'(').('{'^'[').( '`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'."\"".( '`'|'"').('`'|"\,").( '`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').( '['^'/').(('{')^ '[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|'!').('`'|'(').'\\'.'"'.';'.('!'^'+').("\["^ '+').( '['^')'). ('`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'"').('`'|',').('`'|'!').('`'|'(').('{'^'[').('`'|'"').('`'|',').('`'|('!')).( '`'|... read more

Setting the optimum channel for your WiFi using ubuntu

So today I finally decided to fix our WiFi troubles at home. We have a 100mbps internet connection from starhub with a Cisco DCP3925 router and although I can get a full 100mbps speed when connected by a LAN cable, on WiFi I barely got 10mbps on I tried to call starhub for help but twice they made me change my WiFi channel to a random number and it didn’t work very well. I figured they were shooting in the dark with the channel numbers so I decided to do some research on my own and sort this out. Its really silly on part of starhub to use such trial and error methods to fix people’s WiFi. So here is the gist. Wifi works on 2.4GHz spectrum. The 2.4GHz spectrum is around 100MHz wide and it has 11 channels each 20MHz wide centered 5MHz apart from their neighbouring channels. Herein lies the muck. Each channels spreads itself over the center of next two channels on each side. While being on the same channel as another network is not ideal its better than being on a neighboring overlapping channel because 802.11 spec has methods for dealing with co-channel interference. This is bad because that means there is other wifi networks talking on some of the frequencies that your wifi uses.. So the ideal situation in your wifi setup is that there is no one talking two channels next to you. Enough of theory, now time for practical. How do you tell what are the channels being used in the area in your WiFi zone? In ubuntu you can use the iwlist command. sudo iwlist... read more

HTTPS/TLS on NginX and getting a certificate signed by a certificate authority

Today I decided to switch over my website to https mode and acquire a signed certificate for my website. I took the Comodo CA option and have gone for a free 30 day trial period. If things go smooth I might go ahead and purchase the certificate plan. I also learnt about three standardised different levels of validations plans from Cerificate Authorities i.e. Domain Validation : These types of certificate validations provide ssl encryption and certificate authority validates the ownership of the domain against the email address using whois record for the domain. This is the cheapest kind and the one I am using for this website at the moment. If you are committing financial transactions on your site its better to atleast get a OV certificate, which I explain next. Organisation Validation : These kind of certificate validations involve more extensive checks including in-person checks of your organisation’s details before a certificate is issued for your website. these are more secure. Extended Validation Certificates : These kind of certificates are issued after extremely intensive checks on your organisations. these are the most reliable certificates you can get. If your site uses this kind of certificate, it will get the elusive green bar in the address bar of your browser with your company name mentioned alongside. like all the bank websites get. Installing the certificate is quiet easy. First test that things work with ssl on your nginx server. First of all create directory to hold the key and certs: mkdir /etc/nginx/ssl create a key and unsigned certificate file for yourself: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/ read more

Playing with OpenCV Vision Library on Ubuntu 14.04 x86_54

I have been starting to play with OpenCV as a part of my work for security systems. I haven’t found any Perl libraries for this except Image::Resize::OpenCV, Cv::* and Image::ObjectDetect which I might look at later, for now I will start with python libraries. At a later stage I might decide to write a Perl binding for OpenCV library. No commitments yet. It depends on my needs 🙂 For starters, here is what I do: sudo apt-get install libavformat-dev libcv2.4 libhighgui2.4 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev there are a few examples for python in /usr/share/doc/opencv-doc/examples/python and in /usr/share/doc/opencv-doc/examples/python2 I will start off by trying... read more

Setting up fail2ban for my servers

In view of increased attacks on my server from Ukraine and China I decided to harden the security on the server. After normal blocking of unused ports using the firewall, one of my favourite tools to do this job is fail2ban. The way fail2ban works is it scans your log files to look for suspected intrusion attempts or attacks and blocks the offending source. While it provides lots of sources for scanning standard log files like ssh etc. If you have a custom webapp you might have to write your own custom configuration to prevent website attacks. This is much better than using website constraints to block offending users as it prevents offending IP addresses from contacting your server entirely using the iptables instead of showing a not allowed page. To configure fail2ban, the first thing you must do is look at your webapplication logs and then note down the error message thrown by your webapp when a login attempt fails. i.e try to login with a invalid account in your website and see the error message thrown. If your app does not throw a message you will need to add some logging in your code to make sure it throws a message containing the source IP address of the user. In my case the error message is simple : Failed login from <ip address> Create a filter appropriate filter file vim /etc/fail2ban/filter.d/shantanubhadoria.conf enter the following in the file: # Fail2Ban filter [Definition]  failregex = Failed login from <HOST> ignoreregex = You can add more than one regex for conditions other than authentication failure to ban people from... read more

Learning Blender – Building a Tank

I am still trying to pick up more skills with Blender in my evenings. I have been working on this sketch for a Battle Tank modelled on a Indian Army tank called the Arjun. There is still a lot not in place including the tracks. I have also looked at this graphics engine called Unity 3D which lets you rig up a game or a walkthrough using blender models and some scripting and rigging. Perhaps I will be able to create something interesting soon?In the meanwhile enjoy my incomplete tank here :        MBT Arjun – In Progress     by shantanubhadoria     on... read more

Teaching myself Blender

Today I was watched Rio again and I decided to learn some 3d modelling. I am not sure how it will ever be compatible with my existing skill sets(Perhaps it can help in my quadcopter project?). I am just starting with the basics, I picked up a free and surprisingly effective 3d modelling software made for linux called Blender. I created a tiny animation with my name on it. The text breaks up into small cubes and dissolves away. The steps are straight out of one of the blender tutorials. I messed up the dissolving away part but you will probably not notice it in the... read more

Playing with FreeSwitch

Today I have started playing around with freeswitch to explore the possiblity of using it as a tool for secure audio routing. Wikipedia:  FreeSWITCH is free and open source communications software for the creation of voice and messaging products. It is licensed under the Mozilla Public License (MPL), a free software license. Its core library, libfreeswitch, is capable of being embedded into other projects, as well as being used as a stand-alone application. More updates soon . .... read more