• Category Archives software
  • BPM Counter Display update

    I finished the display for the bpm counter!! Its amazing what you can do with a few transistors.  I’m currently using 10 of the 14 digital pins on my board, but running three 7 segment LED displays.  Parts include 10 NPN 2n2222 transistors and NPN 2n3904. 7 x 3.7K resistors and 2 dual 7 segment displays (only 3 being used).

    Thanks to Codekiller, im going in a slightly different direction, he suggested to create a VU meter first and get a good reading, then start to create the algorithm to find out the bpm is. Timing will be essential to get an accurate calculation, and also to visually look at the graphed data the arduino puts out will help in creation of the bpm algorithm, from my experience in audio editing and mastering, I am pretty certain I can pick out the Beat and measure the time it takes for the next peak, doing this visually should not be to hard but putting it into a programming language and having it work may be a little challenging.

    I am currently coding a quick gui to read and graph the values using The processing programing language(very easy to build visualization software and gui interfaces using a C like programming language). This may turn into a start of a simple oscilloscope later this year since i do need one for my bench.

    Pics comming this morning when  I get home from work(lol)and maybe a video if i can get it to work correctly. I am so happy that I have a radio shack within 5 mins from my place, and only have to wait till 9 am till they open.

    Thanks Codekiller for the great help and ideas—> his site http://smfinc.web.elte.hu/ruckus/index.html

    and the site Im using as a starting point —>http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/

    at the time of this post the last link had a Database connection error in German, I will check in a day or so and if its still down, I will post the PDF and code that I’m using from there project.

    Look for more updates Soon!!



    my camera is not function at this moment, im working on getting it fixed and recovering some of my pics, but work is continuing on my days off. (not to much time on work days) the audio circuit is done, just need to test .

  • I hate slow DBs

    Have you ever called a place that needs to look up your account or other info? ever notice how it takes about a some time for them to get that info?

    I’m the guy on the other side of the line waiting to get that info so I can help fix what ever problem they had called in with, and the longer i work the more i notice that its taking longer and longer to for me to pull up any info about any account. So whats is the deal, why cant a multi billion dollar company fix a database?

    We live in the Age of Information, where almost everything is instant, where people expect info or help to be provided to them that instant. My guess is everyone at my place of employment probably don’t even notice the long waits between DB queries through our ticketing system. So how long is long? well i decided to test this, for a basic customer id I queried takes about 20 seconds, ok thats acceptable but thats only to bring up there info, not there ticket history. So i click on there history, guess what another 30 seconds on the clock, so it starting to get bad, after that you can click on individual tickets, create a new one or use tabs to look at more info. Each tab when clicked on takes 5-25 seconds to open. And these are the fast times, other times i sit 30 secs to about 1 min to get anything useful, and there have been times that I started a query when I left for break , came back and still had 5 mins to wait till it finally showed some results. My querries where presise and dont pull alot of data, but this is getting ridicolous. So how does a database get this slow? traffic? Nope cant be traffic, I work 3 rd shift and have about 15 people who use it , during the day over 100 people use it. What about maitnence? not likely, thats run once a week for about 2 hours or so.

    What else could it be? corrupted database? bad design for a large database? I  have never worked with a large database like that before so I don’t know the challenges of design or maintenance of such a large beast. But I have worked with smaller DBs that had similar slowdowns, but that was caused by too much data being pulled, like querying the entire DB or a few thousand rows. Or could the bandit be the vendor lock on the ticketing system in combo there DB, by the way the ticketing system looks very customized and even has features, custom built by other vendors, like the data being pulled from  an access database or integration into 2 other ticketing systems. My guess is Oracles Seibel, and DB work wonders out of the box and setup correctly even better when you use there system to input the data. I wonder who approved adding more plugins was a great idea?  This kind of bloat is inexcusable in a place where employees are timed. How do you fix something thats going to get screwed anyways, there policy just keep it chugging along, my solution would be to start gettting rid of or migrating 3yr+ old tickets and closed accounts to another DB, at least it would be a start, next would be to start removing the bloat from system, we do not need it to make our coffee and tell us were great. We need something light fast and simple, all we want to do is get the person what they want and move on. What will it take for these so called decision makers to realize that there all in one application dream doesn’t work in reality. Maybe this will become the next epic IT failure? not likely because its behind closed doors and if it failed i doubt that they would even tell the employees. So far i enjoy working for the smaller company, at least your voice is heard unlike here where your the bottom of the barrel.

    Sorry about the long rant but some things at large companies are inexcusable that can throw money at situations. I thought customer service was supposed to be the focus of what we do. When will the people who call the shots going to learn to think logical instead of  using a magic 8 ball and some business lingo to make decisions about technology.

  • Hacking the Code

    Last Post i was talking about how to clean up a hacked web server, hopeful your server is clean now and you can get back to what you do best. But what was the hacker trying to do? What does that long string mean? I will tell you how to decode the string the safe way, and understand how it was constructed.

    The Example that I am going to use is from a real hacked website, the code that I will display is only partial but the construct will be complete. Any identifiable URLs will be changed to prevent identification and your safety.
    Lets start by identifying the code, this is what i had found at the very beginning of the page.
    <? /**/eval(base64_decode(aWYoZnVuY3Rpb25<–>KTt9fX0=)); ?>

    lets start with /**/, it looks innocent but its a way to hide the code, what the code usually used for is large blocks of comments instead of using // on each line you would start it with /* and  end with */ but what i noticed is that in bluefish and notepad++ when these are highlighted the whole line appears to be a comment, my guess is that other code scanners will look like one long comment  on that line and skip it. But this is just my conclusion and testing, very clever way to use comments.

    almost forgot the first thing to notice is the use of short tags(<?) that they use, on my personal server I have short tags disabled, I had learned that it should be disabled for security purposes, I don’t know if this holds true today. but the reason they use it is it helps hide it as a comment adding php to   it (<?php),makes it show up as php code not a comment, now its starting to unravel………

    evalEvaluate a string as PHP code

    very simple right, they need something to run there code, eval does this trick, you can even add html to the string. just another peice of the pie.

    base64_decode – it decodes base64 code, now what is base64? It was originally for email to send binary data in emails, and other uses like binary data in urls and other variables but newest use is hiding php code in a long string, the string was 2692 characters long. So what did that string have in it.

    Continue reading  Post ID 372

  • Web Site Security- what to do when you get hacked?

    Recently a Client/friend asked me to help him with his site after he found out he was hacked, in a situation like that i would gladly volunteer my time to help assess and fix the issue and prevent it from happening again. All the Guides from the major CMSs or other frameworks all have help guides to helped you when you get hacked. WordPress and Zen cart both have very good guides, but this guide should be a general help guide to getting back on track, you may have better site specific info from the company that developed the framework. Also check the forums as well for other people that have been hacked and how they fixed it and what the cause was.

    Continue reading  Post ID 372

  • Optimizing your social networking updates

    Most people, now have multiple social networking accounts. so what do you do if you want to update all of them? Most would just log in to there preferred site and just do a status update, I think that this takes to long and i could spend that time coding or writing another post, so i decided to consolidate everything to my blog.
    Now I have been using WP plug called ‘Post to Twitter’. Its very simple you put your login info into it and click test, and its all set to go, simple enough write?
    Next is hooking up myspace to twitter, very easy, click on the link on your home page ‘get synced’ and fill out the form and your connected, next you would test by making a post to your blog, then check your update on myspace, now it should have updated. I didn’t have any issues with it updating my status at all, I cant guarantee that it will work for you, but why not try.
    After that I hooked up my facebook. I tried 2 different apps, the official twitter app and the ‘Selective Twitter Status’. I liked the selective one better because i didn’t have to use my user name and password for twitter, I really don’t like to give social networking password to other social networking apps, Its just add another link that could fail.For the selective app, all you have to do is install the app, allow it to post, on your next post add #fb and it will post it to your status.
    This setup may be useful for Blogs and people who just want to post to one place. This is a one way update, I post to my blog then my WP plugin Posts to Twitter, next Facebook and Myspace get updated, and thats exactly what i wanted this to do.

  • Fun with user agents

    I wanted to share this fun and interesting tool that I use and to test certain aspects of some of my applications, User Agent Switcher Is a Firefox plug in that changes the user agent to the one selected. For those who don’t know, a user agent is the name that the browser gives to the website to make sure it is compatible, another use is for search engine crawlers to identifies them to the site that they visited and added your site.

    My original use for it was to bypass a governments website restriction to IE only so i searched for the best possible way to change my user agent, there are other ways to hack Firefox to have the same out come but takes a little bit of know how, so i found user agent switcher for this purpose, next i turn it on and change my user agent to IE 7, then go to the website with that restriction, and i get through with out a problem, this doesnt always work and may crash your browser so try that at your own risk.

    Now for the fun part, ever wanted to see what some sites show google but not you, So download the ltest list of user agents here, import it and change your user agent to google’s bot and explore to see what sites show google or yahoo, or change your user agent to some ancient browser, like MSIE 3.0; AOL 4.0;, see what sites depend on such things to work, you would be surprised to find that Facebook and MySpace depend on user agents and ask you to upgrade your browser, other sites just say that support for your browser is coming soon, or get back at those people that look at browser statistics from sites and you start seeing profanity driven browsers…

    Another Use i found was for work, there are a few web applications that we use and they dont play well with Firefox, so i load up User Switcher Agent and turn on IE 7 and load the apps up and they start working……..well almost one, worked fine, the other…..the one that I really wanted working Bombed and froze Firefox……..well you can’t win them all but at least I tried.

    So Try out User Agent Switcher and add it to your toolbox.

  • twitter script for linux

    Well let me give you an interesting script i found on Tech Republic………..

    Its how to Tweet from the command line using cURL, its very simple and to the point….just like a script should be
    if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then
    echo "FATAL: The tweet is longer than 140 characters!"
    exit 1
    curl -k -u ${user}:${pass} -d status="${tweet}" https://twitter.com/statuses/update.xml >/dev/null 2>&1
    if [ "$?" == "0" ]; then
    echo "Successful tweet!"

    to us it just type this
    $ ~/bin/tweet "social server rules"
    the only other thing to worry about is you have to escape “?”, “!” -> “?”, “!”

  • Server2Go….apache on usb drive

    I was trolling through the internet and found this little application, Server2go , So i decided to look into it.

    the software contains a great list of features that any web devolper needs for presenting there app to clients, there are many other great uses for this product, to many to list.

    • Complete WAMPP Server-Stack
    • Runs directly from CD-ROM, USB Stick or Hard disk without installation
    • Full featured webserver (based on apache)
    • PHP 5.x support with many extensions installed (e.g. gd)
    • Supports SQLite databases
    • Runs on all versions of Windows from Win 98 and above, MAC OSX support is coming
    • Support for MySQL 5 Databases
    • Supports many PHP extensions (GD-Lib, PDO…) by default
    • Support for Perl 5.8

    It pretty much turns any PC into a devolopement enviroment or a portible application that can be run on almost any windows based PC.

    So after loading it up onto my USB drive unpluging it and plugging it back in, it started the server2go.exe and started apache without an error, no configuration of the server except the simple ini file to tweak the behaviour of the servers that are avaible.

    Next i started up phpmyadmin and loaded up an old test DB with the PHP app to go with it, so far so good, DB loaded up and worked great, was able to connect to mysql with the mysql client as well. After that I used the browser that opend up with the server2go app and there was my PHP web app sitting there waiting to be tested, This app is a simple login to test DB connections. It worked with out error and so far the PHP is working great with out any PEAR errors or missconfiguration………

    This is definitly being added to my tools, it may even have the ability to be a portable webserver on any home network, or even an application server for those with home business that need a simple CRM like “simple customer”.

  • easy LFS chroot script

    In chapter 6.4 in the stable release of LFS you need to chroot into your build environment, and I have to keep rebuilding the chroot, and i keep going back to my PDF and retyping all the commands so i created on that would rebuild the environment by just calling my new script, then make it one better CP it into /usr/bin and make it executable
    mount -v --bind /dev $LFS/dev
    mount -vt devpts devpts $LFS/dev/pts
    mount -vt tmpfs shm $LFS/dev/shm
    mount -vt proc proc $LFS/proc
    mount -vt sysfs sysfs $LFS/sys
    chroot "$LFS" /tools/bin/env -i
    HOME=/root TERM="$TERM" PS1='u:w$ '
    /tools/bin/bash --login +h

    just copy and past the above code into a new file and called it lfsroot then if you just want to make it into a command copy it into /usr/bin and you are ready to go, the script will mount the file systems and the enter the chroot environment
    This has saved me plenty of time by not typing or copying and pasting commands, My next script will be a script that will tar and cd into the directory of source packages……look for it soon