Thursday, December 15, 2016

Sunday, October 30, 2016

Sunday, June 19, 2016

SSH For Android - For The Ones Who Are Fed Up With Fancy Apps


After batteling the ever-great, mighty overlord of hell Lucifer Morningstar himself for over 666 minutes I finally managed to compile dbclient+dropbearkey for API level 21 and above. ( Lollipop+ ) It only supports public key authentication because getpass() wouldn't work on Android _yet_ . Boy Android NDK really is a mess. ( Either that or I'm stupid. )

Here's the git repo.

Most of my knights have already fallen in battle and it's almost sunrise. So I don't have the strength, time or courage to finish the job and do sshd ( dropbear ) too. Maybe another time when my armies are back on their feet.

Saturday, February 6, 2016

Maximum Product Of A Grid


I started this blog to post stuff about programming and algorithms but all I've done so far are some Android and Linux tips, which for a programmer who doesn't care about anything but programming, is total garbage. So this is going to be the first post about programming and algorithms.

I'm assuming you have basic knowledge about algorithms and programming and for this specific post some knowledge about arrays, 2D arrays and a little bit of graph theory studies might help. All I/O is done to and from STDIN and STDOUT.

Maximum product of an NxN grid, a 2D array, or a matrix. I've seen this exact problem repeated and repeated so many times in too many algorithmic programming contests with very little changes. You may have to find the sum of a grid, the sum of the absolute values in a grid, and the sum/product of X adjacent values. Which is basically the same thing, loop through the array horizontally, vertically and diagonally find the max, return it.

So this is what we're going to do:
  1. Initialize the grid with the constraints number.
  2. Read the array
  3. Loop horizontally and vertically while comparing to the maximum.
  4. Loop diagonally.
  5. Return the maximum.
Simple right?

Leave a comment so I know my time spent on this isn't a total waste. :D

Wednesday, January 20, 2016

Boot your PC from your Android


NOTE: This requires your android device to have "Connect as CD-ROM" (or equivalent) option otherwise it won't work. If your device doesn't have this feature you'll have to manually mount an ISO in your android and connect the device to the computer as a CD-ROM although I don't know how to do the latter. Figured it out? Let me know in a comment. :)

Once you're able to connect the device as a CD-ROM, locate the iso file the system mounts. You can do this by opening a root shell and issuing

find . -name \*.iso


If multiple results are returned you'll know what's the right one because every other iso except the one we need is yours. Seriously who stores ISOs on mobiles?

In my case it was iAmCdRom.iso in /system/etc/

This is the file you need to replace with a bootable iso. (The excact path and filname might be different from mine.)

I found this little distro TinyCore which is like 15MB and even has a GUI. Really fits the need and easy to use even for a total newb.

Mount the partition rw, replace the file, remount CD-ROM (usually /mnt/cd-rom) [or just give a reboot]. And now you have a fully functional on-the-go linux distro, anywhere and whenever you need it. It will boot like any other live cd boots.

It looks like this when run...


Leave a comment if anything went wrong though I guarantee NOTHING. :)

PS: If TinyCore GUI doesn't show up try
sudo tce-setup
startx

Monday, January 4, 2016

Minimum Brightness + Turn Off Button Backlights on rooted Android.


Hello again, yes it's another app. I'm not really good at (or not interested in) the interface. So it's ugly af. Yet functional af too. :) It just does the job unlike many other fake backlight apps or screen overlays. This is not an overlay, it changes your screen brightness to the lowest possible level your screen allows. If you ever need more, you better use an overlay. Because this is the lowest. And it really can turn off your button backlights.

Needless to say, it needs ROOT. --> Root your Dialog Optima 2 here..

In case it doesn't work on your device, just leave a comment with a file explorer ( or even better shell ls -l ) screenshot of "/sys/class/leds/". I'll give you a fix asap. Even better, see the source below. :)


PS: If you can make a better ui and stuff, just publish it as your own. I won't mind. :)