Extracting the icons from an EXE in PHP on Linux

For a project I am working on I wanted to add the ability to see an EXE’s built in icon file in a web application. I am running a Debian Linux / PHP5 stack and figured out a way to extract a png out of a Windows EXE. To accomplish this I am using icoutils to extract an ico file from the exe, then search for the target size icon I want and extract a png from that ico file. The script is commented and should be pretty easy to understand and edit to fit your needs. Help with icoutils can be found on the wrestool and icotool man pages. The gist is below:

jQuery.flipper: A jQuery plugin for retro clock-like animations, and more!

After a little bit of searching around on the web for a javascript solution to create a flip-down animation for a clock a wanted to build, I decided to build my own. I started from this flip-down clock animation css3 example/test page. I have a github repo here which documents all the options and usages. I also have two examples, one that demonstrates all the options and one that shows off the queueing feature.

Again, Important links:

Please feel free to clone the repo and make your own transitions, or maybe improve upon my current transitions.

TPM: Ticks Per Minute PHP Class

I have been writing a couple PHP CLI scripts, some that are long running. I wanted a simple way to keep a running average of how many times certain actions were taking place. In comes TPM. A very small and simple class that keep tracks of “ticks” per minute for you.

Hope you find it useful!

Perl Script to automatically put emails into a MySQL Database

I have written/highly modified a perl script to take piped in emails and insert them into a MySQL database. I accomplish this by having my MTA pipe them to this script. You can download the script from this Github Repo, or you can download it directly from here.

This script requires that you have Perl installed with the following Modules:

  • DBI
  • Email::MIME
  • Email::Address
  • HTML::Strip

To use this script, first replace the following items in the script:

  • _DATABASE_ The name of the Schema/Database
  • _SERVER_ The host of the MySQL Server. ex: localhost, 192.168.0.10, etc
  • _USER_ The user of the MySQL database
  • _PASSWORD_ The password of the MySQL user

Place the script on your server and make sure it is accessible and executable by your MTA. Set your MTA to pipe incoming emails to this script. That should be all that is needed.

GitHub Repo: https://github.com/mrkmg/email2mysql
Original Script: http://www.blazonry.com/perl/mail2mysql.php

Chive Project Debian Package

I put together a .deb to install the Chive Project MySQL Administration Package automatically. It is based off of the phpMyAdmin deb package. I have made a github project for the deb package.

Installation is simple.

  • Download the “chive1.1-0.deb
  • From the terminal, run
    sudo dpkg -i chive1.1-0.deb
  • In your preferred browser, navigate to http://localhost/chive

Important Links.

Cronic, fixing excessive cron emails

Earlier today I found a very very useful program to help cut down in the massive amount of spam system administrators receive from cron emails. I decided to create a simple installer for it. Check out cronic at http://habilis.net/cronic/. To install automatically to your system, just run this command as root.

wget http://mrkmg.com/install_cronic.sh -qO - | sh

There is no error checking in the installer, use at your own risk.

 

install_cronic.sh for your reference if you do not want to trust running a shell script from the internet.

#!/bin/sh
mkdir /tmp/cronic
echo "Downloading Cronic from habilis.net"
wget http://habilis.net/cronic/cronic -qO - > /tmp/cronic/cronic
echo "Installing Cronic into /var/local/cronic/cronic"
mkdir -p /var/local/cronic/
cp /tmp/cronic/cronic /var/local/cronic/cronic
chmod 755 /var/local/cronic/cronic
echo "Linking Cronic into /usr/bin"
ln -s /var/local/cronic/cronic /usr/bin/cronic
echo "Cronic is installed and ready to be used. Checkout"
echo "http://habilis.net/cronic/ for more information."
echo "Installer created by Kevin Gravier <[email protected]>"

Simple Floating Clock for Linux CLI (tclock)

I found a very nice and easy to use script to place a floating clock on your CLI in linux.

wget https://gist.github.com/raw/2713194/cb9eb0426dc81f3411c7bb2e592963378bb3b2d7/tclock.sh
chmod 755 tclock.sh
./tclock.sh&

I also made a simple installer

wget http://mrkmg.com/install_tclock.sh -qO - | sh

Update to AxelFE, no more console

Quick update to AxelFE, no more console! Everything is now contained and run in the GUI. Check out the new version. http://mrkmg.com/?page_id=79

Axel Download Accelerator for Windows – with Graphical Frontend

So a while back I showed you how to speed up your downloads for free on OSX with Axel and a simple applescript. Well it looks like someone has compiled Axel on Windows (http://st0rage.org/~n2j3/?page_id=225717166) . I went ahead and created a very simple frontend for it. Feel free to download and try it out.

**EDIT 2/15/2012** I updated the frontend to look a little better, added a title and got rid of the the program icon. Also defaults are now set and if you have a valid URL in your clipboard it will automatically paste it into the URL field. I also created a simple installer. Nothing extra in there either, no ads, no bloatware, no spyware, etc.

http://mrkmg.com/Axel.zip  — No-Installer, Launch “Axel Front End.exe” to Run
http://mrkmg.com/AxelFE.zip — Installer – zipped – No Bloatware, No Ads. Just a simple installer.
http://mrkmg.com/AxelFE.7z – Installer – 7zipped – No Bloatware, No Ads. Just a simple installer.

PHP function to generate a color from a text string

So I was in need of a way to generate a unique color based on a string input. I wanted to be able to define a minimum brightness and how unique each color should be. After a little googleing, I did not find anything I liked, so I wrote my own real quick. Hopefully someone else can find a use for this function as well