Wait For Trigger File – Unix Shell Snippet

So recently I was doing doing some bash scripting and required a functionality that would allow my script to wait for for a trigger file in order to execute. After some thinking, I was able to some up with a function to perform the required action.

Basically, how this works is that a function will be looping constantly looking in a specific directory for a specific file to arrive, the function will loop ‘n’ times looking for that specific trigger file, sleeping ‘n’ seconds in between tries. Once found, it fires off the next portion of the script (or a separate script). If the file is not found in ‘n’ times, then will exit with an exit code of 1. You can also set it so it will keep looking for the trigger file indefinitely.

This snippet will also send an email if the trigger file is not found in ‘n’ times.

Code after the jump.
Continue reading

Share

bulkGetter – A Script Wrapped Around wget

Basically bulkGetter functions as a downloading command line tool accepting an input file as a feed with the desired link(s) to download. It can download files, save them to a specified location, rename them and it also supports resuming downloads.

For this tool to work, you need to have ‘wget’ tool, if you have Linux, more than likely is already included in your distribution. If you have OSX, then you need to download it, the only thing is that you have to compile it. Get wget. If you do not wanna go thru the hassle of compilation, then you can download my compiled version that I have provided with bulkGetter. [GitHub repo]

Continue reading

Share

How to Calibrate the Phone’s Battery After Flashing a new ROM or Kernel

If you are like me, changing roms very often, you will find yourself calibrating your phone’s battery very often. I remember the first rom I flashed back when I had my Sprint Hero, battery life was terrible after flashing it, and since I was a n00b back then, I did not know that I had to calibrate my phone’s battery. After some research, I was able to find out that I needed to calibrate the battery and the how-to thread.

Continue reading

Share

Mac OS X Not Recognizing Galaxy S Phones

When I bought my Galaxy S phone (Sprint Epic 4G) I was really excited about the phone until I connected it to my Mac, to my surprise, OSX wouldn’t recognize the phone, so Mounting the phone as USB Mass Storage was of no use, nor trying to connect it thru ADB; I was very disappointed. I rushed to Google trying to find an answer and to my surprise, I wasn’t the only one having the same problem, some people were able to connect for a couple of seconds then OSX would kick them out of the system, some others wouldn’t connect at all, and some other ones connected just fine. Digging deeper I found several solutions:

Continue reading

Share

How to set up ADB (Android Debug Bridge) in Mac OSX

I have seen many questions regarding the set up of ADB under Mac OSX, and when I got myself a MBP I had the same question. After some research, I was able to find that is not as complicated as I thought it would be; it’s actually less of a hassle than setting it up under Windows or Linux. In OSX, ADB just works, as simple as that.

What is ADB?
ADB (Android Debug Bridge) is a handy tool that comes with Android SDK that allows you to control and interface with your Android device.

IMPORTANT Update 12/11/10 – There has been a change to the new Android SDK. ADB Tool has been moved to /android-sdk-mac_86/plataform-tools, so if you have the old SDK, please download the new one and update your path (Step 4.5 of this tutorial). If this is your first time doing this, then disregard the update and continue with the tutorial.
Continue reading

Share

How to Take Screenshots in Mac OS X

I have been a Windows user ever since Windows 95 came out, and it wasn’t up until this past May (2010) that I decided to make the switch to Macs; it wasn’t really hard to adapt from one OS to the other. It’s just that some basic functionality is way different from from what I am used to, for example, in Windows you can cut-and-paste file and in OSX you cannot (this annoys me) unless you create a special script to do that.

Continue reading

Share

Lake Fayetteville

Lake Fayetteville is comprised of 458 acres of land and 194 acres of water. In 1948 bonds were issued to construct Lake Fayetteville. The lake was completed in 1949. The lake was named Lake Fayetteville in 1950. The Beaver Water District was established in 1959 by Fayetteville, Springdale, Rogers and Bentonville to provide the cities with treated water from Beaver Lake.

Continue reading

Share