Skip to content

Instantly share code, notes, and snippets.

View JGaudette's full-sized avatar

Jon Gaudette JGaudette

View GitHub Profile
#!/usr/bin/ruby
# Download NASA MODIS imagery and use it as a desktop background.
# You'll need ImageMagick installed for this to work.
require 'date'
require 'net/http'
# Screen width/height
X = 2580
Y = 1024
<html>
<head>
<title>A Little Bit of PHP</title>
<style type="text/css">
td {font-size: 8pt; font-family: Arial;}
</style>
</head>
<?php
#!/usr/bin/perl
use Net::Amazon;
use Net::Amazon::Request::Wishlist;
use Net::Amazon::Request::ASIN;
use DBI;
use Product;
use Price;
#!/usr/bin/perl
use Net::Amazon;
use Net::Amazon::Request::Wishlist;
use DBI;
use Product;
sub createRecord{
my $rec = shift;
<?php
<html>
<head>
<title>Sybase Test</title>
</head>
<body>
Testing execution<br />
<?= print_sybase_version() ?>
#!/usr/bin/ruby
require 'dbi'
require 'odbc'
dbh = DBI.connect('DBI:ODBC:prod', 'username', 'password')
query = "select getdate()"
row = dbh.select_one(query)
puts "got a value of: " + row[0].to_s
[TDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/libtdsodbc.so
Setup = /usr/lib/libtdsS.so
FileUsage = 1
CPTimeout =
CPReuse =
[prod]
Driver = /usr/lib/libtdsodbc.so
Description = ODBC
Trace = No
Servername = PROD
Database = <database_name>
[PROD]
host = sybase_hostname
port = sybase_port
tds version = 5.0
@JGaudette
JGaudette / mysql_repl_status.sh
Created January 7, 2011 13:29
MySQL Replication Health/Status
#!/bin/bash
#
# Determine if master and slave mysql servers are in sync
# If not, report it via STDOUT and non-zero return code
# If are in sync, exit successfully
#
# Paramters:
# -v - verbose, show stats even if 100% synchronized
USER='YOUR_USER_NAME'