Mark's Technomusings

Thoughts, notes, and ramblings on the technology Mark Cervarich deals with on a daily basis.

Secure password storage w/ PHP & MySQL

If the salt is random, how do we reliably generate the same salt value (For the same user) next time they log in?
The answer is to simply store the generated salt with the user pass.
For example I use PHP and MySQL and so a simple user information table only needs 3 fields: `username`, `pass`, `salt`
When someone tries to log in then you can check if the details are right by using the following:
$user = mysql_real_escape_string(“USERNAME”);
$pass = mysql_real_escape_string(“PASSWORD”);
$result = mysql_query(“SELECT COUNT(`username`) FROM `table` WHERE `username` = ‘$user’ AND `pass` = MD5(CONCAT(‘$pass’, `salt` ))”);
if(mysql_result($result,0) == 1)
{
echo “Logged in correctly.”;
}
else
{
echo “Sorry, no dice.”;
}

Determine framerate, size, resolution, etc of your video or audio files

MediaInfo
Media Info supplies technical and tag information about a video or audio file. Supported formats: Video : MKV, OGM, MP4, AVI, MPG, VOB, MPEG1, MPEG2, MPEG4, DVD, WMV, ASF, DivX, XviD, MOV (Quicktime), SWF(Flash), FLV, FLI, RM/RMVB. Audio : OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF, WMA.
It produces reports in many different formats, like:
General : C:\home\testGam56K_Dial_Up.flv
Format : Flash Video at 44.4 Kbps
Length : 485 KiB for 1mn 29s 443ms
Video #0 : H.263 at 24.0 Kbps
Aspect : 192 x 144 (1.333) at 10.000 fps
Audio #0 : MPEG Audio at 16.0 Kbps
Infos : 1 channel, 11.025 KHz

Christmas Wish List

In case you decide to get me (or anyone else) anything from Amazon.com, please start your Amazon.com shopping here! — that link will give a small percentage of your purchase price to Laurel Hill Nursery school.

  • Incase Power Slider — This will double as a hard case for my iphone….as well as double the battery life! My most expensive wish at $100.
  • Next up I am looking for a webcam for my laptop. Something small I can carry around in my backpack. There are two that interest me:
  • A new SF Giants hat. I really like the velcro in the back rather than the plastic snaps.
  • Something for everyone to enjoy — get me a new board game. The link takes you to the Chronicles review of board games. Pick a winner
  • I know (nose) this might sound crazy, but I think I am becoming an old fart that needs to better manage some of my extra facial hair, and a ear/nose hair trimmer would be appreciated (and everyone else benefits too! I become that much easier to look at).

If I think of anything else, I’ll throw it up here. But feel free to ignore this list and get me something

Developer’s Guide – Google Chart API – Google Code
Let google make your charts for you on the fly!

http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250×100&chl=Hello|World

Useful Commands to Analyze Network Connections Under Linux

Squarebits Blog: Useful Commands to Analyze Network Connections Under Linux — netstat | grep sequences to count # of SYN_RECV per IP, etc

18 Portable Apps That Every Tech Needs

18 Portable Apps That Every Tech Needs � CaseyTech.com The subject says it all. Plus, in the comments, there are quite a few more apps named.

A great selection of HTML, CSS, JS links

MooTools Help! I Don’t Know JavaScript! This page contains a great listing of various reference sites, tutorials, etc for HTML, CSS, JavaScript, etc. If you are just getting started in coding, or wanting to bone up on the basics, you can’t go wrong by starting here.

How to prevent caching of swf files

SWFs, like other documents and media retrieved by a Web browser, are often saved, or cached, locally on the user’s hard drive. The next time that media is requested the Web browser may load the file from the cache instead of downloading it over the network. This might be desirable for a Flash movie whose content doesn’t change often but undesirable for SWFs that are updated frequently with new content or information.
How to prevent caching of swf files

Linking to Google’s calendar via XML and Sunbird – Part 2

I forgot to mention that you will need Lightning in order to fully integrate the Mozilla calendar product with either Sunbird (a cross-platform calendar app) or Thunderbird (stand alone email application).

Linking to Google’s calendar via XML and Sunbird

This extension allows Sunbird and Lightning to read and write events to a Google Calendar. Provider for Google Calendar :: Sunbird Add-ons
What this means, is that since I don’t maintain a paper calendar, and I pretty much use Google Calendar as my calendar, I’ve been trying to figure out a way to have a desktop version of the calendar. since I keep my calendar separate from my email client.
With the above extension, I can now add entries to either the Sunbird calendar, or the Google Calendar, and they both end up making changes in the same place!