iPhone App: FTP Server

There are a few different apps in the app store that turns your iPhone into a storage device. I find this one pretty convenient.

Sick of carrying around a memory stick to transport your files?  This could be a simple solution.  If you’d like to take advantage of all of the space on your iPod touch or iPhone, and don’t usually carry your cable around with you this app may be for you.  This app turns your iPhone into a simple FTP server that you can anonymously login to over WiFi and transfer files to and from your phone. There isn’t a lot to this app, there are no options, just a simple ftp server with no authentication. When you run the server you are given a console screen that will display the IP address that you will use to login with your favorite ftp client.

On a security note, be sure to use this app on WiFi networks that you trust and don’t leave the server running when you don’t need it, as there is no authentication and diddyftpserver has some known Ddos vulnerabilities.

Check it out @ http://itunes.apple.com/us/app/ftp-server/id356055128?mt=8

Compiling Darwin Streaming Server 6.0.3 Under Debian.

I was recently tasked with a Linux install of Darwin Streaming Server on a Debian server. Unfortunately for me Apple stopped making Windows and Linux builds of DSS when version 6.0 was released.

After a lot of failed attempts at compiling from source on Linux I came across a wonderful post that had a shell script that would install all dependencies, download the source plus a handful of patches, compile and install v6.0.3 on Ubuntu 10.x. A few tweaks and I was able to get it to work for my install of Debian.

For the life of me I can’t find the page again where that script was located, and apparently I’m not the only one. A google search brings up a whole lot of dated material mostly for DSS 5.x.

You shouldn’t run into problems with these, I’ve used them several times now and they work pretty well. Be sure to run them as root though.

Debian 5.0 & 6.0 DSS Compile Script:

#!/bin/bash
apt-get install build-essential wget
addgroup --system qtss
adduser --system --no-create-home --ingroup qtss qtss

wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
mv DarwinStreamingSrvr6.0.3-Source DarwinStreamingSrvr6.0.3-Source.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
patch -p0 < dss-6.0.3.patch
mv DarwinStreamingSrvr6.0.3-Source.orig DarwinStreamingSrvr6.0.3-Source
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
patch -p0 < dss-hh-20080728-1.patch

#need to answer n then y
cd DarwinStreamingSrvr6.0.3-Source
mv Install Install.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
chmod +x Install
./Buildit
./Install


Download debian-dss.sh

 

Ubuntu 10.x DSS Compile Script

#!/bin/bash
sudo apt-get install build-essential wget
sudo addgroup --system qtss
sudo adduser --system --no-create-home --ingroup qtss qtss

wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
sudo mv DarwinStreamingSrvr6.0.3-Source DarwinStreamingSrvr6.0.3-Source.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
sudo patch -p0 < dss-6.0.3.patch
sudo mv DarwinStreamingSrvr6.0.3-Source.orig DarwinStreamingSrvr6.0.3-Source
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
sudo patch -p0 < dss-hh-20080728-1.patch

#need to answer n then y
cd DarwinStreamingSrvr6.0.3-Source
sudo mv Install Install.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
chmod +x Install
sudo ./Buildit
Sudo ./Install


Download ubuntu-dss.sh

 


If you run into problems or are just plain lazy, here is Darwin Streaming Server 6.0.3 compiled for Linux. Simply unpack the archive and run ./Install :

 

Download: Darwin Streaming Server 6.0.3 Linux Binaries

Displaying a subversion commit log with PHP

I was recently tasked with a small project that had to pull commit logs from various subversion servers and repositorys and display them on a web page.

The process was a lot simplier than I first anticipated.  Hopefully someone else will find this useful.   This php code snippet requires that the server have SHELL_EXEC() enabled and subversion must be installed.   We’ll use the SHELL_EXEC() function to actually use the subversion cli to grab the commit log from a remote server and store it in an xml file.

I’ll break down the code a bit. This first bit, is a simple helper function that will help us read the XML file itself. We call the function xml_atrribute().

function xml_attribute($object, $attribute)
{
    if(isset($object[$attribute]))
        return (string) $object[$attribute];
}

Next up is to actually run the subversion CLI client with all of the correct parameters to generate an xml file of the commit log. You will want to adjust the server, username, password, repository name and output path to meet your needs.

$test = shell_exec("svn log --xml --verbose svn://svn.mydomain.com/reponame --username USERNAME --password PASSWORD > /home/html/svnlog/reponame.xml ") ;

Alright, at this point we should have a nicely formatted XML file that we can read, loop through and display information from. Here is a simple bit that loops through the various XML elements and displays them. As commented we go one step further than just reading the commit comments, we actually display the files and what action was performed on them.

foreach ($xml->logentry as $logentry)
{
  $date = date('m/d/Y', strtotime((string) $logentry->date));
  foreach ($logentry->paths as $paths)
  {

	echo ' <BR><B>Revision: ' . xml_attribute($logentry, 'revision') . '</B>';
	echo ' <BR>Date: ' . $date;
	echo ' <BR>Message: ' . $logentry->msg;
	echo ' <BR>Commited By: ' . $logentry->author;
	echo ' <BR> ' ;

		/* 	Now lets loop through and get a
			list of files that have changed
			in this commit */
		echo '<UL>';
		foreach ($paths->path as $path)
		{
			echo "
<li>" . $path['action'] . "  " . $path . "</l1>";
		}
		echo '</UL>';		

	}

  }

Here is the entire script all put together and commented:

<?php

/* 	This is a helper function
	to aid in reading our XML
	file we are going to create */
function xml_attribute($object, $attribute)
{
    if(isset($object[$attribute]))
        return (string) $object[$attribute];
}

/* 	Run SVN to get an xml file
	of the commit log.
	SHELL_EXEC() must be enabled
	on the server.
*/
$test = shell_exec("svn log --xml --verbose svn://svn.mydomain.com/reponame --username USERNAME --password PASSWORD > /home/html/svnlog/reponame.xml ") ;

/* Pull the XML file in */
$xml = simplexml_load_file(dirname(__FILE__).'/reponame.xml');

/* now lets roll through the XML and display the results */
foreach ($xml->logentry as $logentry)
{
  $date = date('m/d/Y', strtotime((string) $logentry->date)); // format the date
  foreach ($logentry->paths as $paths)
  {

	echo ' <BR><B>Revision: ' . xml_attribute($logentry, 'revision') . '</B>';
	echo ' <BR>Date: ' . $date;
	echo ' <BR>Message: ' . $logentry->msg;
	echo ' <BR>Commited By: ' . $logentry->author;
	echo ' <BR> ' ;

		/* 	Now lets loop through and get a
			list of files that have changed
			in this commit */
		echo '<UL>';
		foreach ($paths->path as $path)
		{
			echo "
<li>" . $path['action'] . "  " . $path . "</l1>";
		}
		echo '</UL>';		

	}

  }

?>

It’s worth noting that when we read in the XML file we assume it lives in the same directory as the script reading it does. You can adjust this as needed. I Hope this is helpful to anyone out there needing to do something similar. The full source is here: svnsample.zip.

Quick Debian Server Provisioning Script

Here is a quick little bash script that I use to initially provision Debian LAMP servers from a fresh install. This should setup PHP with all the whistles and bells, a whole handful of utilities as well as install webmin for you.

Nothing to complicated here, just a quick little script to speed up your life.

clear
clear
echo 'Debian Provisioning Script'
echo '01-12-2011 TNL Total Solutions'
echo 'http://www.tnlsoft.com'
echo ''
read -p "Press any key to begin provisioning"
clear
echo 'Preparing server for provisioning...'
apt-get update
apt-get upgrade
apt-get dist-upgrade
echo ''
echo 'All existing packaged updated'
echo ''
read -p "Press any key to begin installing NEW packages"
clear
echo 'Installing Required Packagesn'
apt-get install apache2 apache2-utils apache2.2-common bind9 bind9-host bind9utils curl gawk denyhosts sendmail ftp proftpd gzip iptables lftp libapache2-mod-perl2	libapache2-mod-php5 libapache2-reload-perl libcurl3 libxml2 lynx mysql-client mysql-common mysql-server ntp ntpdate openssh-client openssh-server openssl perl perl-base perl-modules php-pear php5 php5-cli php5-common php5-curl php5-dev php5-gd php5-geoip php5-imagick php5-imap php5-ldap php5-mcrypt php5-mhash php5-mysql php5-odbc php5-xmlrpc proftpd python rdate samba samba-common sendmail sendmail-base sendmail-bin sendmail-cf sensible-mda subversion tar unzip wget makeself zip libghc6-openal-dev libsage2 libsdl-gfx1.2-4 mingw32 mingw32-binutils mingw32-runtime
echo ''
echo ''
echo 'Creating Skel'
mkdir /etc/skel/www
mkdir /etc/skel/logs
mkdir /etc/skel/www/cgi-bin

cd /var/www
rm index.html
wget http://www.tnlsoft.com/debian/index.txt
mv index.txt index.php
chmod 0777 index.php
cp index.php /etc/skel/www

echo ''
echo ''

echo 'Reconfiguring PHP 5'
cd /etc/php5/apache2
mv php.ini php.ini.old
wget http://www.tnlsoft.com/debian/php.ini

echo ''
echo ''
echo 'Installing PEAR Packages'
pear install Mail
pear install Net_SMTP

echo ''
echo ''
echo 'Enabling Apache Mods'
a2enmod dav_fs
a2enmod dav
a2enmod rewrite

echo ''
echo ''
echo 'Restarting Apache'
/etc/init.d/apache2 restart

echo ''
echo ''
echo 'Installing Webminn'
cd /root
wget http://downloads.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530.tar.gz
tar -xvf webmin-1.530.tar.gz
cd webmin-1.530
./setup.sh
echo 'Done!'

Grab it here: http://dev.tnlsoft.com/download/debian_provision.zip

The IPv4 Apocalyspe is Upon Us!

Are you ready for IPv6? Only a few days left until the ipv4 apocalypse.

Some interesting links:

Fox news has no idea what they are reporting on:
“Web developers have tried to compensate for this problem by creating IPv6 — a system that recognizes six-digit IP addresses rather than four-digit ones.”
http://www.foxnews.com/scitech/2011/01/26/internet-run-ip-addresses-happens-anyones-guess/

Twitter Feed reporting the countdown:
http://twitter.com/IPv4Countdown

Facebook Page
http://www.facebook.com/pages/IPv4-Countdown/162683847102050

Want a countdown widget thingy? On your phone perhaps?
http://ipv6.he.net/statistics

For those who aren’t in the know of this techno-apocalypse wikipedia has the answers for you:
http://en.wikipedia.org/wiki/IPv4_address_exhaustion

TimeTrac, our internal, homebrewed time tracking software.

A number of times clients ask how we track our time.  And each time I have to explain that I built some software specifically to meet my needs.    The software is a continual work in progress, the codebase is ancient and I hate working with it, although I still actively use it to track my time.   But, for those who are wondering here is a quick demo of what we use here at TNL Total Solutions.

I’m also going to make it available for download.  Just keep in mind, this was never intended for public consumption, some buttons don’t do anything, there are annoying bugs that no one has gotten around to fixing and there is no documentation.  The demo above does explain how everything works (mostly).   Nonetheless, here is a copy of the current build for you to check out.

Download Link: Download TimeTrac v1.6

Cheers!
Brian

iPhone App: RDP Lite (Remote Desktop)

All server administrators are well aware that servers never go down during business hours, they have explicit code that requires any downtime to occur in the middle of the night or when your out at the bar away from your computer.  Because of this, the iPhone can be a server administrator’s best friend.    Anyone who has the misfortune of dealing with Windows servers will find they spend a great deal of time in the Windows Remote Desktop application (RDP).  Many server administrators will opt for services such as LogMeIn.com because they offer an iPhone App (for $30) and one doesn’t have to worry about setting up firewall rules.  But those who are opting to pay for one of these remote desktop services out there probably haven’t discovered RDP Lite for the iPhone.   RDP Lite is a must have for any server administrator who has the to manage Windows based servers.

Frankly there is nothing pleasant about trying to manage and troubleshoot a server from your phone, even with the right tools the screen size is a real annoyance.  Windows RDP on the iPhone is a lot worse, as the windows GUI was never designed for a screen the size of the screen on your iPhone.  I imagine that on the iPad this less of an issue, as you have a lot more screen real estate to work with.

Nonetheless, RDP Lite can be a lifesaver when out away from your computer.  RDP Lite allows you to remote desktop from your iPhone or iPad over 3G or wifi.  The free version allows you to save multiple connection profiles.  The controls are fairly intuitive, although I found mouse control a bit difficult on the iPhone screen and the free version lacks right click.  Overall though a great app.

The paid version will run you $5.99 in the app store and seems well worth it.  The paid version offers a handful of additional features including:

  • Another cool key board
  • More mouse functions: right button,drag and over (hover)
  • Mouse wheel
  • Text macro support
  • Can handle 20 different Host configurations.

Find RDP Lite in the App Store or visit their homepage at http://mochasoft.dk/iphone_rdp.htm

Also See: Monitor Your Server With Net Status


iPhone App: Monitor your servers with Net Status

If your like me and manage a multitude of servers, this app maybe one of the handiest things in the world.  Net Status is a FREE service monitor that will check your servers and the services running on them to be sure they are all up and running. This handy app checks most popular services and does so quickly, the speed in which Net Status executes its check is consistent even if a service fails.    You can add as many hosts as you would like; I have about a dozen setup on my phone.  You can also configure it to check each host right when you load the app.   If a host is completely down, it’ll move to the top of the list and turn red, if only some services are down, it will turn yellow.   You can touch any specific host for a wealth of information.   The following video gives a quick look on how it works.

If you manage more than one server this free app is a must have.  Highly recommended!

From the Net Status Homepage

“Using Net Status™ you can get a fast glimpse of what is happening now with your hosts, routers and other network devices connected to the Internet or LAN.Net Status™ checks network services your hosts run for availability and present the information in a convenient way aiming at providing a faster way to diagnose network problems. With Net Status™ you can quickly and easily determine which hosts and services are down from your monitoring list.Network probes are performed using asynchronous algorithms that allow Net Status™ to operate quite fast – a host with quite a lot of running services is checked within fractions of a second. Even problematic hosts don’t slow down the check process for a time much longer than a timeout you specify.”

Homepage:
http://happymagenta.com/netstatus/

Making your 3G faster on IOS4

I’ve complained quite a bit, here on this blog as well as on all of the social networking sites, that if you have an iPhone 3G and performed the upgrade to iOS4, your living in a painfull life.  It can take 5+ seconds just to open your address book.

This video offers a nice comparison of 3.1.3 compared to iOS4x:

Where does this leave us 3G owners, Apple doesn’t offer a downgrade back to OS3.x.  You could try a tricky hack to downgrade explained here: http://www.iphonehacks.com/2010/07/how-to-downgrade-iphone-3g-from-ios-4-to-iphone-os-3-1-3.html

The downgrade option seems sketchy at best and feels like you’ll need to be prepared to set aside some time to do it.

There is another option.  It still wont be as zippy as it used to be, but the performance improvement I’ve seen is significant.  The cure is turning off ‘Spotlight’ .  Spotlight is the indexing app that runs in the background that enables the global search to work.  To disable spotlight:

Settings->General
Home Button->Spotlight search

switch off all you don’t use.  I rarely use search at all, so I felt confident turning all of them off.   Then reboot your phone.  It will make you feel like your back on OS 3.1.3 again.

Google in 1998

I remember in 1997 when someone first pointed me to http://google.stanford.edu a student project that was supposed to beat out WebCrawler as a search engine. I wasn’t too impressed at the time… It’s interesting to think how huge Google has become and how I don’t really use anything else to search the web. Let alone the dozens of other services I use Google for regularly.    At the time the Google.standford.edu homepage looked something like , complete with the default to only show 10 results.

What is even more impressive is the hardware that ran google back then:

  • 2 300 MHz Dual Pentium II Servers with 512MB of RAM. There are 9 9G drives between the two machines. The main search engine ran on these.
  • An IBM RS6000 with 4 processors and 512MB of memory. It had 8 9G drives internal.
  • A Machine with  3 9G drives, and there are 6 4G drives attached to a Sun Ultra II.
  • An IBM disk expansion box had another 8 9G drives.
  • A Sun Ultra II with dual 200MHz processors, and 256MB of RAM.
  • A homemade disk box which contains 10 9G SCSI drives.

All of Google in 1998 as a whole: