Archive for category Self Made Tools

PHP MySQLDump Browser

Posted by admin on Sunday, 30 January, 2011

I’ve been working on a new PHP script to help people restore individual MySQL tables from a MySQL Dump file. You may recall my post on having a backup plan. This tool works great with another great tool called BigDump.

PHP MySQLDump Browser
Version 0.01 Beta
Author: Matt Kendrick (yeah! that’s me)

DESCRIPTION:
PHP MySQLDump Browser allows users/system admins to browse through MySQL Database Backups (Dump Files).
Users can view and extract individual table structures and or data from MySQL database dumps.
Use this script to avoid restoring entire backups to recover individual tables.
Database dumps complied by mysqldump and phpMyAdmin are compatible with this tool.
Note: This is an unofficial tool released under the GNU General Public License.
PHP MySQLDump Browser creators have no affiliation with Sun Microsystems.

INSTRUCTIONS:
1. Place the script on your webserver or webhost in the same directory as your MySQL backup dumps.
2. Run the script.
3. Choose which backup file you want to search. The script will search through the
dump file for table structures and data. Depending on the size of the dump, this may take some time.

4. Once the script has finished indexing the dump file, you may choose which table you wish to extract or
view. By default the results of your query will display in the iframe at the bottom of the page. However
you may download the results to file by clicking the download link above the iframe.

IMPORTANT: Remove PHP MySQLDump Browser as soon as you are finished.

COPYRIGHT AND DISCLAIMER:
THIS SCRIPT IS PROVIDED AS IS, WITHOUT ANY WARRANTY OR GUARANTEE OF ANY KIND
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option)
any later version. If you change this script or add any features please tell me.

PHP MySQLDump Browser (1381)


Google BuzzBlogger PostTwitterYahoo BookmarksGoogle GmailBeboGoogle ReaderStumbleUponYahoo BuzzYahoo MailRedditMySpaceDeliciousAmazon Wish ListWordPressYahoo MessengerFarkGoogle BookmarksSquidooTumblrShare

Self Made Tools: Proportional Image Resizer

Posted by Matt Kendrick on Monday, 29 March, 2010

I’ve decided to create a new segment on my site called “Self Made Tools.” From time to time, I make software tools to help me through tasks that I can’t find tools for quickly. I’ve decided to really jump on the Open Source movement bandwagon and share my tools with source. This week’s tool is “Proportional Image Resizer.” What? Ok, let me explain.

When coding HTML, you know when you have an image that is one size and you need it to fit within an area that is of another. Say the image is 800 px X 600 px and you need to make it fit into an area that is 500 px wide spot. Easy right? Just change the one dimension in your code to reflect the change. Sure your browser will adjust your image. But it may not pass some web standards for all browsers. It’s just not clean. You need to have both a width and height specified when resizing an image using code.

How do you resize these images proportionally? Use a simple equation to do the job. You know the before image is 800 px X 600 px right? You also know you need the image to fit within a 500 px width. Now you just need the other part of the equation (solve for x).

800 / 600 = 500 / X

Cross multiply and you’re done right? How about we just skip doing the equation every time and just use a tool? That’s how the proportional image resizer tool was born. You can also do the reverse as well (height vs width). I know there are other tools out there to perform the task. But why not use something homegrown? You could even code this yourself in a matter of minutes. I’ve posted the source to the script above. Thanks for reading!

<html>
<head>
<title>Proportional Image Resizer</title>

<script language='Javascript'>
//Matt Kendrick
//March 28, 2010

function resize_by_width(width)
{

var x_before = document.getElementById('x_before').value;
var y_before = document.getElementById('y_before').value;

var x_new = width;
var y_new;

//a / b = c / x

//x = (c * b) / a

y_new = (x_new * y_before) / x_before;

document.getElementById('y_new').value = y_new;

}

function resize_by_height(height)
{

var x_before = document.getElementById('x_before').value;
var y_before = document.getElementById('y_before').value;

var x_new;
var y_new = height;

//a / b = x / c

//x = (c * b) / a

x_new = (x_before * y_new) / y_before

document.getElementById('x_new').value = x_new;

}

</script>

<style>
.dim_box {width:50px;}
</style>

<head>
<body>

<h2>Proportional Image Resizer</h2>

<b>Instructions</b><br>
<p>
Enter the starting dimensions of the image. <br>
Then enter the dimensions you would like to conform the image to. <br>
<br>
ex. You have an image that is 800 x 600, and you need it to fit the image <br>
proportionaly in a 525 pixel wide area. Enter 800 for the width and 600 for <br>
the height in the before dimensions. Then enter 525 in the after dimensions <br>
width. The script will then compute the proportional height for you.
</p>
<br>

<b>Before Dimensions</b><br>
Width: <input type='text' id='x_before' class='dim_box' value=0> Height: <input type='text' id='y_before' class='dim_box' value=0><br><br>

<b>After Dimensions</b><br>
Width: <input type='text' id='x_new' class='dim_box' onKeyUp='resize_by_width(this.value);' value=0> Height: <input type='text' id='y_new' class='dim_box' onChange='resize_by_height(this.value);' value=0><br><br>

</body>
</html>

Google BuzzBlogger PostTwitterYahoo BookmarksGoogle GmailBeboGoogle ReaderStumbleUponYahoo BuzzYahoo MailRedditMySpaceDeliciousAmazon Wish ListWordPressYahoo MessengerFarkGoogle BookmarksSquidooTumblrShare