Tuesday, December 18, 2012

How to - execute shell scripts on your Android phone

Hi All,

This post explains how to run simple shell scripts on your android phone...

Assume we have a script that generates odd numbers b/w 1 to 10

Here is the script:

i=1
echo $i

while [ $i -lt 9 ]
do
       i=`echo $(($i+2))`
       echo $i
done

Type this content onto a shell (a text file with a .sh extension) using an App called TextEdit written by Paul Mach.

Save the file (test.sh) in your external sd card root folder.

Then you need a shell to run this script.

Download an app called Terminal Emulator from the Google Play store.

So we are set to run our script...

Steps:

1. Open the emulator
2. Give the below commands:

     cd sdcard
     cd external_sd
   
     sh test.sh

3. If there are any errors, you can fix them using the TextEdit once more. Save it and re-run!!

Note:

1. This procedure will work for both rooted and not-rooted phones.
2. The script uses echo command instead of expr command.
3. Since the phone I used to run this script is not rooted - I had to save my files to the card.

Hope you enjoyed scripting on your Android,
Ananth G S


Friday, December 14, 2012

Start-up sound of Nimblex on Debian 5 using Sun Virtualbox

Hi All,

Was playing around my Lenny trying to tweak some of the things that I used to do in the past.....

I installed Nimblex on my old laptop which was on Debian 5. Of course I did not want to touch the god (Debian) - so only used Virtualbox (older version and not the new one from Oracle)

I fell in love with the start up sound of Nimblex. So I wanted to get the same sound to my Debian 6 on my other laptop.

So heres what I did....

1. First enable sound (Direct OSS or Direct ALSA) on Virtualbox
2. i.e take sound from host OS.
3. Open the terminal and run the command to copy the sound startup file.

Alt F2 (Run prompt)

Type gnome-terminal

Then as su-

cp /usr/share/sounds/startup/startup.ogg . 

I copied the startup file to the current directory (~ of Debian 5)

Then

cp startup.ogg /share/ (I had shared a folder in Virtualbox)

Press Left Control key to go back to the host OS (Debian 5 from Nimblex)

cp /share/startup.ogg/ /media/sdb1/ (Copy the shared file to my pen drive)

Now finally on my other laptop (running Debian 6)

Issue the command -

cp /media/sdb1/startup.ogg /usr/share/sounds/

Last enable login sounds in Debian 6.

Hope you too can manipulate your startup-sound files in your distros from these simple commands...

Tc ,
Ananth S Gouri






fdisk - you can lose your disk

Hi All,

fdisk is a command line partition tool for *nix systems.

The fdisk tool is the default tool even till today in many UNIX and LINUX distributions. For ex: freebsd, netbsd, openbsd and Slackware till 12.0 versions.

Ok so what is the big deal using fdisk?

Though fdisk is a wonderful tool - but if the user does not know its options - the probability of losing all the data or even the full partitions of the disk is very high.

One such problem this post discusses is:

fdisk shows the size of all partitions by default in bytes.

If a user plans to install a new distro onto a partition - first thing after backup of data is to know its exact size.

But knowing the partition size in a hard disk when the tool shows in bytes is a pain....

Trying to understand 100 GB is how much of bytes could be simple but indeed calculation to that extent is not required. Also when the user want to resize that 100Gb into 40 GB 2 partitions - then doing everything wrt bytes is a task better not to attempt!!!

Solution:

By pressing Z key in fdisk - fdisk toggles b/w different file sizes. So after bytes, the same partition is shown wrt KB, MB and GB when Z key is used (3 times)

Hope this helped :)

Thanks & enjoy,
Ananth S Gouri

Command Line Steganography in LINUX

Hi All,

So what is steganography?? I would not want to waste time in explaining all you want about this but yet give high regards to www.google.com :P [google it out]

So what could be the command to hide data using Linux command line??

Trying to send data - a gif image in an encrypted form? Finding it difficult to find free steganography tools based out on *nix? Dont worry...

This very simple command should do it all...

Step(s):

We shall assume that we have created a dummy zip file through which we send across data (here the image)

The command is:

cat dummy.zip >> rogue.gif

The data image is embedded in this format...

Plz note:

1. Normal decompress softwares like winzip, 7 zip et al may not open the file at all.
2. pkzip check once to see if you can retrieve the image.
3. use winrar based softwares in Windows or use unrar (non-free versions) in LINUX.

Thats it... Enjoy :)

Happy data hiding,
Ananth S Gouri





Tuesday, November 27, 2012

Convert your MTS to a WiFi Hotspot

Dear All,

This post explains how to convert your MTS internet dongle connection to a WiFi hotspot to use at home.

Note:

1. MTS uses the same concept used in GSM technology. Your internet speed would be pretty slow if you are using MTS at weak signal points. Use open space for better signal reception.

2. This post does not require any MS Virtual WiFi driver.

3. This WiFi hotspot could be used for your Android phones for all normal internet functionality.

4. This WiFi hotspot does not require any physical router. :)

5. Download a software called mhotspot from download.com

Steps:

1. Connect your MTS and make sure that it is working fine.

2. Next install the software mhotspot. Select the drop down from the software to select MTS Mblaze Internet connection. Also give a name for your hotspot and a proper password.

3. Click on "Start Hotspot" button on mhotspot.

4. Next go to settings of your Android phone, go to wireless and networks, Tethering and portable hotspots.

5. Check the checkbox Portable Wi-Fi hotspot.

6. If the mhotspot software is been configured properly, then you should find the name given in step 2 now on your android phone.

At this stage your can connect to your hotspot but you would not get any internet working. You would have limited connectivity.

Note: You could connect any number of clients to your WiFi hotspot by increasing the Max clients value.

Next open your Network settings in XP or Win 7, right click on your MTS connection, go to properties and then click on sharing tab.

There select - allow this internet connection for sharing (ICS) with your new hotspot connection.

You should now be able to browse in your android phones.

Thanks and hope this article helped you all,
Ananth Gouri


Tuesday, October 30, 2012

S2 - Soft brick bug fix (MMC_CAP_ERASE brick)



Hi All,

This article briefs the steps and processes I did to recover my soft bricked S2 GT i9000. 

{ Basically this post is written keeping in mind that it should help me for any kinds of soft bricks to my phone ;) :P }

1. You may have to read a lot xda forums to get detail info about these briefed steps. 
2. Also you may have to google out a lot of info. 
3. This article or the owner of this blog is no way responsible for any kinds of damages that may occur to your phone. 
      1. About S2 Memory options
      2. 3 types – internal card of S2 (16Gb with 11.5Gb user space, 1.97 Gb internal system space and external card till 32Gb)
      3. Custom ROM installation for advantages like – better battery backup et al, tweaking the kernel, overclocking, lot more hardware related tweaks.
        [ Lots of custom ROMs for S2 at galaxys2roms.com ]
      4. Custom ROM installed – M1U1 A1exander with custom themes and downloads from xiaomi.com
      5. The PIT problem (wrong PIT file used partition information table which soft bricked my S2)
      6. 11.5 Gb became 4Gb
      7. Retrieval via processes (unsuccessful attempts)
          1. Reinstallation of the same ROM
          2. Tried other roms like JellyBAM, Vanilla RootBox
          3. Reinstalled 4.0.3, 4.0.4 ICS also lots of old GB versions Samsung stock ROM via samfirmware.com using ODIN
          4. Only changed the kernel – used different kernels also rooted them
          5. Ripped the bootloader
          6. different ODIN versions used
          7. used the proper – with no bug PIT file

Usage of partition tools (Some hope via)
      1. went into recovery mode n tried to use live Cds, partion magic softwared, parted magic live cd none worked
      2. then connected the usb cable n in recovery mode tried to side load or side push parted – the command line tool (Usb debugging option required for side load functionalities)
      3. Device was not detected cos the stock rom by default wont enable USB debugging option.
      4. Then had to again root (used cfroot) the Stock ROM with the hope of USB debugging option enabled. Yes luckily it got enabled.
      5. then via adb (Android Development Bridge) the device got detected but as ??? (Unrecognized device)
      6. Then had to set permissions (fix permission in recovery mode - via CM mod 6.1.2 of cfroot)
      7. Then was able to detect the device
parted command used (thanks to XDA developer hg42)
          1. parted (only parted command with no arguments wont work)
          2. parted /dev/block/mmcblk0 (Note your internal SD card is a block device)
          3. print (prints the partion info, throws error if the card has any non-contigous blocks of memory)
          4. the device (S2 only) shows 12 partitions
          5. dont manipulate the first 6
          6. dont touch the EFS SBL1 SBL2 space/area. You could hard brick the phone.
          7. rm 11
          8. rm 10
          9. rm 9
          10. then reformat (mkpartfs commands as primary partitions)the last 3 once more n this time into ext2
          11. label all the partitions back to original (use name command of parted)
          12. journal fs to ext4(tunefs command) (parted does not support ext3/ext4)

Then tried to install the same M1U1 custom ROM – but now got new errors
The getprop(“S2 i9000”) errors
Then tried 2.3.4 and 4.0.3 stock ROMs – but same errors.

Then had to install notepad++ editor to open the manifest.mf file of the M1U1 zip file.
Find the line where it read getprop and delete the line and save the file.

Notepad++ is an editor that could open your .mf file (other editors not tried)

Reinstall M1U1 ROM n now it was successful

Once the stock ROMS of samsung are rooted – you cant use KIES software for firmware updates or recovery

So had to use SpoofFW (spoof firmware by Johan Nenzen)

3 days with lots of card data transfers –
Tried to reboot but got the black screen error (thought as hard brick but then lucky)

tried Samsung 4.0.4 XXLQ5 firmware thro ODIN but now this was successful

then reformatted the USB storage for successful retrieval of 11.5 Gb data.

Hope this brief article did help you retrieve the soft brick bug of your S2. 

Contact me for more help. Send me a PM,
Ananth G S

Sunday, August 26, 2012

How to get Liquorix Zen Kernel for Debian

Hi ,

Linux in the end is all about configuring your system for something called super fast performance and optimization.

If you feel the need for speeding up your stock kernels into a new one ever - you may try out Liquorix zen kernel.

Installation and configuration of the kernel is pretty much straight forward once the apt line is added to your repos and if the problem of solving dependencies is achieved.

Here goes the apt line to add to your repos:

deb http://liquorix.net/debian sid main

Then run your apt-get update command to use either synaptic or the command line to install the new kernel.

Search for liquorix in your synaptic and dont forget to update your linux headers to liquorix headers and like wise the installation of linux-firmware-free package.

Lastly let it be only an update and have access to your previously working stock kernel(s) so that you may go back before you could break your system.

Let me know for any dependencies help needed during your installation process.

-Ananth

PDF Merge and Split packages in Debian Squeeze

Hi,

Don' t feel like logging into XP or 7 only for the need of using a pirated software called Adobe Professional Reader to merge / split pdf files???

Just chill and use these 2 packages on your Debian based systems...

1. pdfsam

PDF split and merge - a easy to use UI with needs no special computer skills but normal usage of a good working mouse :P ;)

2. pdfshuffler

PDF-Shuffler is a simple pyGTK utility which lets you merge, split and rearrange PDF documents. You can also rotate and crop individual pages of a pdf document.

Use synaptic package manager and search for these to install or use the command line apt-get commands.

Try out these 2 packages and let me know if you found better ones for Debian :)

-Ananth

Friday, August 24, 2012

Android: Opening a GIF file based PPT

Hi,

Thanks to a small problem faced by one of my friends.. All she wanted to do was check out if a GIF based presentation opens on an Android based smartphone....

After enough research on this topic - I could finally still save the image of Linux and Android to her :P ;)

The steps are as follows:-

1. Go to Google Store and install the app called Mobile Document Viewer written by Joerg Jahnke

[ First try out the free app and then purchase the ad free full version based on your needs... ]

2. Also make sure that the presentation file is created using OOI or Libre Office or at least converted to .odp file format after creation in MS Office 07 or higher versions :)

Note: Power Point of MS is called Open Office Impress in the OO suite or Impress in Libre Office suite

Hope this helps :)

Tc,
Ananth

Thursday, August 23, 2012

A download scheduler for torrents in Debian

Hi,

Many of us who use XP or MS 7 prominently always see that it has many features which other OSes dont!!!

For most of us download freaks - if you used a DM like IDM or many other free managers - one common functionality all of them have - is a scheduler.

A scheduler has the following functionalities -

1. A scheduler can start a download at one particular time and then stop seeding (if its a torrent download)

2. It can download your data and then shut down your machine

3. It can download only upto some % of data and lot more

So does Debian have a torrent downloader which is also a scheduler

Yes is has..

Install Vuze also called Azureus (www.vuze.com)

After installing Vuze - you will have to install a plugin called - Speed Scheduler

Download the jar file from sf.net or you can install it directly from Vuze
 
If you have downloaded the jar file then - open Installation manager in vuze - select offline download and then browse for the downloaded file and let vuze finish its job :)

Hope this helps you all :)

Tc,
Ananth