If this blog helped you in any way, please donate a dollar here

Saturday, September 2, 2017

[off] a poetry in the lovely city of bangalore

It has been a while I have had the heart or the mind to write some rhyming lines comprising of a poem, not that I have been particularly busy but maybe I was just fighting some battles that made me feel so. Bangalore, the silicon valley of India, the Garden City as they say it, is a beautiful city. The weather pleases me like no other city of this country, it is remarkable that I have to come back to the city from where I had started my professional journey.

So on a lovely rainy night I decided to try myself and type down some words in random order. Trying to sound lyrical and, to understand the beauty in words and expression.

So here goes, a poem untitled, as below

Its 4 am and the perfect time to get lonely,
As the world sleeps it comes to me very clearly
the silence wasn't meant for the deaf
the darkness wasn't meant for the blind
it is but the feelings inside of us
that we are destined to find.
Of course does that mean we can?
Is it so easy and effortless a task,
Sometimes senses fail us, comprehension we lose
The life in our blood from the bruises ooze
drop into the darkness we cannot see
fly into the noise we cannot hear
drown into the depths we cannot swim
nobody is here nor will be, my dear.

Friday, July 7, 2017

Logging PF Firewall on Mac OSX

Steps to enable logging for pfctl utility on newer osx like Yosemite, Sierra:


Add "log" to all rules in "/etc/pf.conf" or which ever PF configuration file you have.

Also set the logging interface with:

set loginterface pflog0

on the top of the PF config file.

Create a virtual interface with:

sudo ifconfig pflog0 create

Now start viewing packets which match the rules you logged with this:

sudo /usr/sbin/tcpdump -lnettti pflog0

At the end do:

sudo ifconfig pflog0 create

Monday, June 26, 2017

Fast download with Golang

Hey all, people keep saying about how great the concurrency is in golang. To be honest, I am pretty much a novice in this.

So just wrote a download accelerator in golang using it's much awesome parallel feature, the source of which can be found here: https://github.com/rghose/go-parallel-downloader

Here are a few results:

URL DownloadedTime taken by wgetTime taken by Golang

This was with GOMAXPROCS=2, threads = 5  with Chunk Size = 10 KB

So well, the chunk size of download did make a lot of difference, since the number of connections to download the thing would decrease, too many connections does not help in speed up

Tuesday, June 20, 2017

Get brightness levels on jailbroken ios devices

One liner:

idevicediagnostics ioreg IOPower | grep -A7 'brightness' | tail -n1 | egrep -o '\d+'


idevicediagnostics ioreg IOPower

This gives a lot of hardware info!