<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19696450</id><updated>2012-01-28T00:17:31.030-07:00</updated><category term='enunciate'/><category term='innotek'/><category term='virtualization'/><category term='android thread background service'/><category term='code formatter'/><category term='visual studio express 2008'/><category term='sms'/><category term='REST'/><category term='alternating'/><category term='listview'/><category term='VirtualBox'/><category term='tutorial'/><category term='example'/><category term='web services'/><category term='http'/><category term='c#'/><category term='android'/><category term='stunel'/><category term='tls'/><category term='stunnel'/><category term='sun'/><category term='https'/><category term='WEB21C'/><category term='colors'/><category term='mono'/><category term='BT'/><category term='BT SDK'/><category term='monodevelop'/><category term='netcat'/><category term='astyle'/><title type='text'>DB</title><subtitle type='html'>Just ramblings and notes or I'll forget it.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19696450.post-4421916033480369548</id><published>2011-12-01T08:26:00.001-07:00</published><updated>2011-12-01T08:39:17.223-07:00</updated><title type='text'>FIXED!  Mac and Excel 2011 -- Can't open XSLX, PPTX, or DOCX files</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s1600/excel%2Bissues.jpg.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s1600/excel%2Bissues.jpg.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s1600/excel%2Bissues.jpg.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s1600/excel%2Bissues.jpg.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="136" src="http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s400/excel%2Bissues.jpg.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Have spent HOURS trying to figure out why I get the above error, "Excel cannot open this file.&amp;nbsp; The file format or file extension is not valid."&amp;nbsp; every time I try to view an XLSX/PPTX/DOCX file in an email attachment.&lt;br /&gt;&lt;br /&gt;I've completely uninstalled Outlook 2011, done system traces to see what I could find, view all sorts of logs, re-installed multiple times, etc.&amp;nbsp; Even upgraded to Lion.&lt;br /&gt;&lt;br /&gt;Turns out, it was the NAME of my hard drive causing the issue.&amp;nbsp; Go figure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To check this, go into Disk Utility and see what the name of your HD is.&amp;nbsp; If it doesn't have ABC123 characters, change the name.&amp;nbsp; In the example below, it just shows ":" as the name:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-_bcmbf8ML6U/TtefZHW2VyI/AAAAAAAACMU/X3xgWzI7RJA/s1600/excel+-+diskutil.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-_bcmbf8ML6U/TtefZHW2VyI/AAAAAAAACMU/X3xgWzI7RJA/s1600/excel+-+diskutil.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To change the name of the drive, just RIGHT CLICK and select SHOW IN FINDER, then rename it as you would any normal file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-4421916033480369548?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/4421916033480369548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=4421916033480369548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/4421916033480369548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/4421916033480369548'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2011/12/fixed-mac-and-excel-2011-cant-open-xslx.html' title='FIXED!  Mac and Excel 2011 -- Can&apos;t open XSLX, PPTX, or DOCX files'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--_srnb2IiQU/Ttedh_QDSxI/AAAAAAAACMM/RFXzXOFdENQ/s72-c/excel%2Bissues.jpg.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-5505854903298979789</id><published>2011-03-09T10:11:00.004-07:00</published><updated>2011-03-09T10:27:06.897-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android thread background service'/><title type='text'>Android Background Processing</title><content type='html'>Background processing on mobile devices can be tough -- services, threads, etc, can be killed on a whim when memory/CPU resources start getting low, the device goes to sleep, network connectivity is less reliable, etc.&lt;br /&gt;&lt;br /&gt;There are multiple ways to handle background processing in Android.  Here's a QUICK overview of each (mainly so I can get it clear in my mind.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Runnable/Threads&lt;/span&gt;&lt;br /&gt;Standard Java threading.  Just create a new thread and start it.  The issue here is that it is difficult to communicate things back to the UI.  You end up having to use "handlers" to pass messages to the UI.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    import android.os.Handler;&lt;br /&gt;    private void testThread() {&lt;br /&gt;        final int PRE_EXECUTE = 1;&lt;br /&gt;        final int PROGRESS_UPDATE = 2;&lt;br /&gt;        final int POST_EXECUTE = 3;&lt;br /&gt;        final Handler handler = new Handler() {&lt;br /&gt;            @Override&lt;br /&gt;            public void handleMessage(Message msg) {&lt;br /&gt;                if (msg.what == PRE_EXECUTE)&lt;br /&gt;                    Log.d("JAVA THREAD", "PRE EXECUTE: " + msg.arg1);&lt;br /&gt;&lt;br /&gt;                else if (msg.what == PROGRESS_UPDATE)&lt;br /&gt;                    Log.d("JAVA THREAD", "PROGRESS: " + msg.arg1);&lt;br /&gt;&lt;br /&gt;                else if (msg.what == POST_EXECUTE)&lt;br /&gt;                    Log.d("JAVA THREAD", "POST EXECUTE: " + msg.arg1);&lt;br /&gt;&lt;br /&gt;                super.handleMessage(msg);&lt;br /&gt;            }&lt;br /&gt;        };&lt;br /&gt;        new Thread() {&lt;br /&gt;            public void run() {&lt;br /&gt;                // send a PRE-EXECUTE message just for example&lt;br /&gt;                Message msg = Message.obtain();&lt;br /&gt;                msg.what = PRE_EXECUTE;&lt;br /&gt;                msg.arg1 = 9999;&lt;br /&gt;                handler.sendMessage(msg);&lt;br /&gt;&lt;br /&gt;                for (int i = 0; i &lt; 10; i++) {&lt;br /&gt;                    android.os.SystemClock.sleep(1000);&lt;br /&gt;                    msg = Message.obtain();&lt;br /&gt;                    msg.what = PROGRESS_UPDATE;&lt;br /&gt;                    msg.arg1 = i;&lt;br /&gt;                    handler.sendMessage(msg);&lt;br /&gt;                    Log.d("JAVA THREAD", "ITERATION: " + i);&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                // send message to UI with result so it can update widgets, etc&lt;br /&gt;                msg = Message.obtain();&lt;br /&gt;                msg.what = POST_EXECUTE;&lt;br /&gt;                msg.arg1 = 12345;&lt;br /&gt;                handler.sendMessage(msg);&lt;br /&gt;&lt;br /&gt;            };&lt;br /&gt;        }.start();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;AsyncTask&lt;/span&gt;&lt;br /&gt;Android utility class to do background processing.  Can override methods such as onPreExecute(), doInBackground(), onProgressUpdate(), and onPostExecute() to easily handle background processing and communicating things back to the UI thread for screen updates, etc.  This is VERY handy and does all the home-grown handler stuff you'd have to do if you just used Java threads.  Almost all of the methods you override run on the UI thread EXCEPT for doInBackground().  Android handles everything for you.   The issue with this approach is that the task is tied to whatever started it -- if Android kills the process that started it, then the thread will die, too.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    import android.os.AsyncTask;&lt;br /&gt;    private void testAsyncTask() {&lt;br /&gt;        // Create an AsyncTask that counts to 10 seconds and publishes updates&lt;br /&gt;        new AsyncTask&lt;Void, Integer, Integer&gt;() {&lt;br /&gt;            @Override&lt;br /&gt;            protected void onPreExecute() {&lt;br /&gt;                Log.d("TASK", "PRE EXECUTE ON UI THREAD");&lt;br /&gt;                super.onPreExecute();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            protected Integer doInBackground(Void... params) {&lt;br /&gt;                for (int i = 0; i &lt; 10; i++) {&lt;br /&gt;                    android.os.SystemClock.sleep(1000);&lt;br /&gt;                    publishProgress(i);&lt;br /&gt;                }&lt;br /&gt;                return 12345;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            protected void onProgressUpdate(Integer[] values) {&lt;br /&gt;                Log.d("TASK", "PROGRESS: " + values[0]);&lt;br /&gt;            };&lt;br /&gt;&lt;br /&gt;            protected void onPostExecute(Integer result) {&lt;br /&gt;                Log.d("TASK", "POST EXECUTE ON UI THREAD: " + result);&lt;br /&gt;            };&lt;br /&gt;        }.execute();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Services&lt;/span&gt;&lt;br /&gt;The recommended way to do anything that is long-running (more than a few seconds, perhaps, such as a background refresh with a web server), is to use a Service.  A Service should be well-behaved -- it should not consume battery or memory resources, should not keep the device awake, etc.  Services can still be killed be the OS, but the chances are less than other elements as Android gives a higher priority to services.  There are still considerations you need to consider -- what if multiple requests to start a service are received?  What if the device goes to sleep?&lt;br /&gt;&lt;br /&gt;There are two variations of a Service in Android that I know about -- Service and IntentService.  Service is mostly used for parallel processing as well as a permanent background process.  I've always used the Service class incorrectly and ended up doing a lot of synchronization logic to ensure only a single thread was executing at one time.&lt;br /&gt;&lt;br /&gt;And then I found the IntentService.  The IntentService ensures that only a single thread is executing at a time.  It also ensures that the service is stopped when work has completed (need to verify this!)&lt;br /&gt;&lt;br /&gt;CommonsWare (http://commonsware.com) has released a really nice implementation of WakefulIntentService which makes it a snap to do work while retaining a WakeLock on the device so the CPU is available.  Get it here: https://github.com/commonsguy/cwac-wakeful (Thanks, Mark -- I make it a point to read all of your posts as I'm bound to learn something new!)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;BroadcastReceivers/Alarms&lt;/span&gt;&lt;br /&gt;Of course, the biggest building block/foundation of Android is the use of Intents and BroadcastReceivers.  The thing to consider when processing an intent in onReceive(), is that the CPU might not be available upon exiting from the onReceive() method.  Therefore, if you are staring a background Thread or AsyncTask, you may be hosed!  You will need to acquire a wake lock yourself, or, better yet, start a background service that does the processing and then shuts down.  Check out the WakefulIntentService as it makes things really easy:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.commonsware.cwac.wakeful.WakefulIntentService;&lt;br /&gt;&lt;br /&gt;public class MyTestService extends WakefulIntentService {&lt;br /&gt;&lt;br /&gt;    public MyTestService(String name) {&lt;br /&gt;        super(name);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void doWakefulWork(Intent intent) {&lt;br /&gt;        try {&lt;br /&gt;          // do something&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;          Log.e(C.TAG, "Evil.", e);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and, to start the service from anywhere in your code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;WakefulIntentService.sendWakefulWork(context, MyTestService.class);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-5505854903298979789?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/5505854903298979789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=5505854903298979789' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5505854903298979789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5505854903298979789'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2011/03/android-background-processing.html' title='Android Background Processing'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-5941312291768424758</id><published>2009-12-16T14:08:00.009-07:00</published><updated>2009-12-16T15:41:15.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='listview'/><category scheme='http://www.blogger.com/atom/ns#' term='colors'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='alternating'/><title type='text'>Creating a ListView with Alternating Colors in Android</title><content type='html'>I've seen a lot of posts, and have done a lot of googling to figure out how to create a listview in Android with alternating colors.  For example, row 1 light gray, row 2 dark gray, etc.&lt;br /&gt;&lt;br /&gt;Here's a very easy way to accomplish this.  It just involves creating a super-simple custom adapter.&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://sites.google.com/site/dustinbreese/home/AlternatingListView.tar?attredirects=0&amp;d=1"&gt;source code/Eclipse project&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;This example walks you through creating the project from scratch using eclipse and is valid for at least Android 1.5.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 1)&lt;/span&gt; Create a new android project&lt;br /&gt;- Give it a name and location&lt;br /&gt;- Select Build Target of 1.5&lt;br /&gt;- Give it a unique application name&lt;br /&gt;- For this example, package name should be set to com.db.alternatinglistview&lt;br /&gt;- Create activity is checked and name is MainActivity&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 2)&lt;/span&gt; Open up main.xml and modify it to have a listview as follows&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"&lt;br /&gt;    android:orientation="vertical"&lt;br /&gt;    android:layout_width="fill_parent"&lt;br /&gt;    android:layout_height="fill_parent"&lt;br /&gt;    &amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;ListView android:id="@android:id/list" android:layout_width="fill_parent"&lt;br /&gt;  android:layout_height="fill_parent" android:visibility="visible"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 3)&lt;/span&gt; Open up MainActivity and have it extend ListActivity&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class MainActivity extends ListActivity {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 4)&lt;/span&gt; Let's create a list of cars, so create a Car class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Car {&lt;br /&gt;  public String make;&lt;br /&gt;  public String model;&lt;br /&gt;&lt;br /&gt;  public Car(String make, String model) {&lt;br /&gt;    this.make = make;&lt;br /&gt;    this.model = model;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 5)&lt;/span&gt; Have your Car.java model class extend HashMap&lt;String,String&gt; and override get().  This is required because the SimpleAdapter will map fields from your list of Cars to widget ids in the layout (this should make more sense in the steps following).&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Car extends HashMap&lt;String, String&gt; {&lt;br /&gt;...&lt;br /&gt;public static String KEY_MODEL = "model";&lt;br /&gt;public static String KEY_MAKE = "make";&lt;br /&gt;@Override&lt;br /&gt;public String get(Object k) {&lt;br /&gt;  String key = (String) k;&lt;br /&gt;  if (KEY_MAKE.equals(key))&lt;br /&gt;    return make;&lt;br /&gt;  else if (KEY_MODEL.equals(key))&lt;br /&gt;    return model;&lt;br /&gt;  return null;&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 6)&lt;/span&gt; Create a new SimpleAdapter which extends SimpleAdapter and extends the getView() method.  This will allow us to call super.getView() and then modify the view before it is returned:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class CarListAdapter extends SimpleAdapter {&lt;br /&gt;&lt;br /&gt;private List&amp;lt;Car&amp;gt; cars;&lt;br /&gt;/*&lt;br /&gt;* Alternating color list -- you could initialize this from anywhere.&lt;br /&gt;* Note that the colors make use of the alpha here, otherwise they would be&lt;br /&gt;* opaque and wouldn't give good results!&lt;br /&gt;*/&lt;br /&gt;private int[] colors = new int[] { 0x30ffffff, 0x30808080 };&lt;br /&gt;&lt;br /&gt;@SuppressWarnings("unchecked")&lt;br /&gt;public CarListAdapter(Context context, &lt;br /&gt;        List&amp;lt;? extends Map&amp;lt;String, String&amp;gt;&amp;gt; cars, &lt;br /&gt;        int resource, &lt;br /&gt;        String[] from, &lt;br /&gt;        int[] to) {&lt;br /&gt;  super(context, cars, resource, from, to);&lt;br /&gt;  this.cars = (List&amp;lt;Car&amp;gt;) cars;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;  View view = super.getView(position, convertView, parent);&lt;br /&gt;&lt;br /&gt;  int colorPos = position % colors.length;&lt;br /&gt;  view.setBackgroundColor(colors[colorPos]);&lt;br /&gt;  return view;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 7)&lt;/span&gt; Lastly, in your MainActivity, instantiate the new custom list adapter and set it on your activity:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class MainActivity extends ListActivity {&lt;br /&gt;  @Override&lt;br /&gt;  public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;    super.onCreate(savedInstanceState);&lt;br /&gt;    setContentView(R.layout.main);&lt;br /&gt;&lt;br /&gt;    // Create our own version of the list adapter&lt;br /&gt;    List&amp;lt;Car&amp;gt; cars = getData();&lt;br /&gt;    ListAdapter adapter = new CarListAdapter(this, cars,&lt;br /&gt;        android.R.layout.simple_list_item_2, new String[] {&lt;br /&gt;          Car.KEY_MODEL, Car.KEY_MAKE }, new int[] {&lt;br /&gt;          android.R.id.text1, android.R.id.text2 });&lt;br /&gt;    this.setListAdapter(adapter);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private List&amp;lt;Car&amp;gt; getData() {&lt;br /&gt;    List&amp;lt;Car&amp;gt; cars = new ArrayList&amp;lt;Car&amp;gt;();&lt;br /&gt;    cars.add(new Car("Dodge", "Viper"));&lt;br /&gt;    cars.add(new Car("Chevrolet", "Corvette"));&lt;br /&gt;    cars.add(new Car("Aston Martin", "Vanquish"));&lt;br /&gt;    cars.add(new Car("Lamborghini", "Diablo"));&lt;br /&gt;    cars.add(new Car("Ford", "Pinto"));&lt;br /&gt;    return cars;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here's an example using the above code:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MWOG3-CM30I/SyleThDa6AI/AAAAAAAACHk/REq6zrBDcQY/s1600-h/device-1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://4.bp.blogspot.com/_MWOG3-CM30I/SyleThDa6AI/AAAAAAAACHk/REq6zrBDcQY/s320/device-1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5415963716272973826" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;STEP 8)&lt;/span&gt;) Run the app and see the results.  Play with the colors &amp; alpha to control the look-n-feel.  For example, modifying the &lt;pre&gt;int[] colors&gt;&lt;/pre&gt; in CarListAdapter.java to the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;private int[] colors = new int[] { 0x30ffffff, 0x30ff2020, 0x30808080 };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Yields the following results (goofy, but it makes the point!):&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MWOG3-CM30I/SylfbGAJQBI/AAAAAAAACHs/3CbmvyfPYq0/s1600-h/device.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://1.bp.blogspot.com/_MWOG3-CM30I/SylfbGAJQBI/AAAAAAAACHs/3CbmvyfPYq0/s320/device.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5415964945962057746" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-5941312291768424758?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/5941312291768424758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=5941312291768424758' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5941312291768424758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5941312291768424758'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2009/12/creating-listview-with-alternating.html' title='Creating a ListView with Alternating Colors in Android'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MWOG3-CM30I/SyleThDa6AI/AAAAAAAACHk/REq6zrBDcQY/s72-c/device-1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-3606143916957691609</id><published>2009-04-19T22:11:00.005-06:00</published><updated>2009-04-19T22:53:37.825-06:00</updated><title type='text'>Android: Controlling Airplane Mode</title><content type='html'>I've spent a lot of time looking for how to programatically enable and disable Airplane Mode.  It doesn't appear that the 1.1 Android SDK exposes it yet.&lt;br /&gt;&lt;br /&gt;Here're some code snippets to help with that.&lt;br /&gt;&lt;br /&gt;Check to see if it is enabled or not:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;boolean isEnabled = Settings.System.getInt(&lt;br /&gt;      context.getContentResolver(), &lt;br /&gt;      Settings.System.AIRPLANE_MODE_ON, 0) == 1;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To toggle it:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// toggle airplane mode&lt;br /&gt;Settings.System.putInt(&lt;br /&gt;      context.getContentResolver(),&lt;br /&gt;      Settings.System.AIRPLANE_MODE_ON, isEnabled ? 0 : 1);&lt;br /&gt;&lt;br /&gt;// Post an intent to reload&lt;br /&gt;Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);&lt;br /&gt;intent.putExtra("state", !isEnabled);&lt;br /&gt;sendBroadcast(intent);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To get notifications on state change:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;IntentFilter intentFilter = new IntentFilter("android.intent.action.SERVICE_STATE");&lt;br /&gt;&lt;br /&gt;BroadcastReceiver receiver = new BroadcastReceiver() {&lt;br /&gt;      @Override&lt;br /&gt;      public void onReceive(Context context, Intent intent) {&lt;br /&gt;            Log.d("AirplaneMode", "Service state changed");&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;context.registerReceiver(receiver, intentFilter);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Please share if there's an easier way!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-3606143916957691609?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/3606143916957691609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=3606143916957691609' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/3606143916957691609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/3606143916957691609'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2009/04/andoid-controlling-airplane-mode.html' title='Android: Controlling Airplane Mode'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-3475018368066297593</id><published>2008-09-25T09:36:00.027-06:00</published><updated>2008-09-25T12:19:43.064-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='monodevelop'/><category scheme='http://www.blogger.com/atom/ns#' term='astyle'/><category scheme='http://www.blogger.com/atom/ns#' term='mono'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='code formatter'/><title type='text'>Auto formatting code in MonoDevelop 1.0</title><content type='html'>I struggled with keeping my code formatted correctly, especially for C# formatting standards (I'm a long-time Java developer).  &lt;a href="http://astyle.sourceforge.net/"&gt;Artistic Style&lt;/a&gt; is an opensource code-formatter.&lt;br /&gt;&lt;br /&gt;Here's how I was able to get MonoDevelop to auto-format my C# code.  For MonoDevelop 1.0, it requires patching the source due to a &lt;a href="http://stackoverflow.com/questions/85139/c-code-formatter-for-linux-andor-monodevelop"&gt;Mono bug&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This patch will work easily on the MonoDevelop 1.0 sources.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Getting and Patching MonoDevelop Source&lt;/span&gt;&lt;br /&gt;This is really just a workaround -- the real issue appears to be a problem with the Mono compiler, not with MonoDevelop.  However, by adding a simple cast to an anonymous delegate, the compiler works fine.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Get the MonoDevelop 1.0 Source Tar Ball&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;$ wget http://go-mono.com/sources/monodevelop/monodevelop-1.0.tar.bz2&lt;br /&gt;$ tar xfvj monodevelop-1.0.tar.bz2&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Compile and run MonoDevelop&lt;/span&gt;&lt;br /&gt;For me on Ubuntu, I had to install some dependencies.  Most all of them were lib*-dev packages.  Just run "./configure" and fix the dependencies until configure reports no errors.  Once dependencies were sorted out, here's how I built and run it before making changes:&lt;br /&gt;&lt;pre&gt;$ cd monodevelop-1.0&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;$ make run&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Apply the Patch and Recompile&lt;/span&gt;&lt;br /&gt;The following patch simply adds a cast to the anonymous delegate as a work-around to the mono bug.&lt;br /&gt;&lt;br /&gt;You can easily manually apply the patch by editing line 79 of src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs and just casting the anonymous delegate to a GenerateString type:&lt;br /&gt;&lt;pre&gt;stringGenerators [providedTag.ToUpper ()] = &lt;span style="font-weight: bold;"&gt;(GenerateString)&lt;/span&gt;delegate (string tag) {&lt;br /&gt;&lt;/pre&gt;Here's a patch file if you want to apply it automatically:&lt;br /&gt;&lt;div class="divScrollAuto" style="height:265px;width:640px;overflow:auto;white-space:nowrap;"&gt;&lt;br /&gt;&lt;pre&gt;--- src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs 2008-03-10 20:21:08.000000000 -0600&lt;br /&gt;+++ src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs 2008-09-25 10:42:48.000000000 -0600&lt;br /&gt;@@ -76,7 +76,7 @@&lt;br /&gt;  public static void RegisterStringTagProvider (IStringTagProvider tagProvider)&lt;br /&gt;  {&lt;br /&gt;   foreach (string providedTag in tagProvider.Tags) {&lt;br /&gt;-    stringGenerators [providedTag.ToUpper ()] = delegate (string tag) {&lt;br /&gt;+    stringGenerators [providedTag.ToUpper ()] = (GenerateString)delegate (string tag) {&lt;br /&gt;     return tagProvider.Convert (tag);&lt;br /&gt;    };&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt; &lt;br /&gt;Apply the patch with the following commands (assuming patchfile.txt contains the above text!)&lt;br /&gt;&lt;pre&gt;$ cd monodevelop-1.0&lt;br /&gt;$ patch -p0 &lt; patchfile.txt&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Rebuild and Run MonoDevelop&lt;/span&gt;&lt;br /&gt;Once you have MonoDevelop building, we can run it and hook astyle up to it.&lt;br /&gt;&lt;pre&gt;$ make run&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight:bold;"&gt;Artistic Style -- Astyle&lt;/span&gt;&lt;br /&gt;The astyle executable must be installed, of course.  On Ubuntu, I just installed the "astyle" package via "sudo apt-get install astyle".  From the &lt;a href="http://astyle.sourceforge.net/"&gt;Artistic Style web site&lt;/a&gt; you can get whatever distribution you want, or build it from source.&lt;br /&gt;&lt;br /&gt;Once it is installed on your system, make sure it is in your command path.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Configure MonoDevelop External Tool&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt; In MonoDevelop, go to Edit-&gt;Preferences...&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Drill down to Tools-&gt;External Tools (a minor bug in MonoDevelop forces you to select another node before you select "External Tools")&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Click the "Add" button and fill in the following information:&lt;br /&gt;&lt;pre&gt;Title: _Format with AStyle&lt;br /&gt;Command: astyle&lt;br /&gt;Arguments: -b -n -N ${ItemPath}&lt;br /&gt;Working Directory: ${ItemDir}&lt;br /&gt;Click "Save Current File"&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt; Click OK&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MWOG3-CM30I/SNvQLmoW2uI/AAAAAAAABQE/fGjckV3H9ss/s1600-h/ExternalTools.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_MWOG3-CM30I/SNvQLmoW2uI/AAAAAAAABQE/fGjckV3H9ss/s400/ExternalTools.png" alt="" id="BLOGGER_PHOTO_ID_5250018688397400802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You may want to add additional cmd line options. Please let me know if there are any others that should be used for C#!&lt;br /&gt;&lt;br /&gt;Now, when editing a file, you can use Tools-&gt;Format with AStyle (or Alt-T, F).  You will be prompted to re-load the changed file at the top of the editor window.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-3475018368066297593?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/3475018368066297593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=3475018368066297593' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/3475018368066297593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/3475018368066297593'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/09/auto-formatting-code-in-monodevelop-10.html' title='Auto formatting code in MonoDevelop 1.0'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MWOG3-CM30I/SNvQLmoW2uI/AAAAAAAABQE/fGjckV3H9ss/s72-c/ExternalTools.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-2564697670445482026</id><published>2008-09-16T07:45:00.000-06:00</published><updated>2008-09-16T13:45:05.723-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='stunel'/><category scheme='http://www.blogger.com/atom/ns#' term='https'/><category scheme='http://www.blogger.com/atom/ns#' term='tls'/><category scheme='http://www.blogger.com/atom/ns#' term='netcat'/><title type='text'>Stunnel</title><content type='html'>I mentioned stunnel in my Netcat post before.  Stunnel is short for "universal SSL tunnel".  It is a great utility for securing TCP/IP and HTTP(s) connections when an application doesn't have the ability (or doesn't want to deal with) secure transport layer security.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.stunnel.org/"&gt;http://www.stunnel.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I use stunnel frequently when I want to trap an HTTPS request then replay it to another server.  I can't just trap the HTTPS data as it is encrypted.  Therefore, I modify my client to use HTTP, trap the plain-text HTTP request, then use stunnel to do the HTTPS for me.&lt;br /&gt;&lt;br /&gt;Stunnel is available for immediate download for *nix, Cygwin and a native Windows port.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Configuring Stunnel&lt;/span&gt;&lt;br /&gt;Stunnel 4.x is configured via a conf file which is specified as the main parameter on the command line (stunnel 3.x uses cmd-line options to configure it.)&lt;br /&gt;&lt;blockquote&gt;$ stunnel my.conf&lt;br /&gt;&lt;/blockquote&gt;The configuration file stunnel uses is broken into two main parts -- Global Options and Service-Level Options.&lt;br /&gt;&lt;br /&gt;Global Options dictate how stunnel behaves such as forked or not, logging location, logging levels, etc.  Common Global options are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;debug = 0-7, where 0=[emergency], 7=[debug] . The default is 5, [notice]&lt;/li&gt;&lt;li&gt;foreground = yes|no.  This dictates whether or not stunnel will fork the process into the background or stay in the foreground.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;output = somefile.  This is where output goes.  /dev/stdout indicates to just output to STDOUT.&lt;/li&gt;&lt;li&gt;pid = somefile.  If present, the name of the file to write the background process' pid.&lt;/li&gt;&lt;li&gt;taskbar=yes|no.  Win32 only -- shows a taskbar icon you can use to control the running instance.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Service-Level options are for individual protocols such as https, imap, etc, and control the way the forwarding/proxying behave.  Common service-level options are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;accept=port #.  This is what port incoming connections will be accepted on.  Only a single value can be given, but you are free to create multiple services as the following incomplete example shows:&lt;blockquote&gt;[https1]&lt;br /&gt;accept=9000&lt;br /&gt;connect=someserver:90&lt;br /&gt;&lt;br /&gt;[https2]&lt;br /&gt;accept=9001&lt;br /&gt;connect=someserver:91&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt; cert=somecert.pem.  This specifies where your certificate resides.  In client mode (client=yes), this cert will be used for 2-way SSL.&lt;/li&gt;&lt;li&gt;connect=[host:]port.  Where the backend resides.&lt;/li&gt;&lt;li&gt;key=keyfile.pem.  This is the private key to be used for serving up SSL connections.&lt;/li&gt;&lt;/ul&gt;These are the only options we'll use in the examples below. RTFM for the other options.  :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Examples&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;1) Proxying Plain Text HTTP client Traffic to HTTPS Server&lt;/span&gt;&lt;br /&gt;I use this feature a lot to debug client-side HTTP issues and to see the exact HTTP message on-the-wire.  Basically, this is handy to do HTTP from your client, but convert to HTTPS before hitting the server.&lt;br /&gt;&lt;br /&gt;All this entails is doing "pseudo-https" with the following stunnel configuration:&lt;br /&gt;&lt;blockquote&gt;$ cat https.conf&lt;br /&gt;foreground = yes&lt;br /&gt;output     = /dev/stdout&lt;br /&gt;debug      = 7&lt;br /&gt;&lt;br /&gt;[psuedo-https]&lt;br /&gt;accept  = 9443&lt;br /&gt;connect = localhost:443&lt;br /&gt;client  = yes&lt;br /&gt;&lt;/blockquote&gt;Then, your client can hit http://localhost:9443 which will be proxied to localhost:443 over SSL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;2) Creating an HTTPS Listener which Proxies to non-HTTP server&lt;/span&gt;&lt;br /&gt;Requirement -- PEM-encoded file private key with signed certificate.  The private key should not have a password on it.  Both the private key AND the cert should be in the PEM-encoded file.&lt;br /&gt;&lt;br /&gt;The stunnel conf looks like this to proxy incoming HTTPS requests to your local JBoss/Jetty/Tomcat service:&lt;br /&gt;&lt;blockquote&gt;$ cat accept-https.conf&lt;br /&gt;debug=7&lt;br /&gt;output=/dev/stdout&lt;br /&gt;foreground=yes&lt;br /&gt;&lt;br /&gt;[stunnel]&lt;br /&gt;cert=MyKeyFileWithCert.pem&lt;br /&gt;accept=443&lt;br /&gt;connect=8080&lt;br /&gt;&lt;/blockquote&gt;When you start stunnel with "stunnel accept-https.conf", you can test it with:&lt;br /&gt;&lt;blockquote&gt;$curl --insecure https://localhost&lt;br /&gt;&lt;/blockquote&gt;Note that the "--insecure" option may be needed if the stunnel.pem file contains a cert signed by a non-trusted certificate authority.  Likewise, in IE or Firefox, you'll need to add a security exception in order to test.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;3) Load Balancing Incoming Connections&lt;/span&gt;&lt;br /&gt;If multiple "connect" options are given for a service, then a round-robin algorithm is used to load-balance the back-end requests.&lt;br /&gt;&lt;br /&gt;The following configuration will load balance incoming HTTP connects on port 80 to HTTPS ports 9080 and 9081.&lt;br /&gt;&lt;blockquote&gt;$ cat loadbalance.conf&lt;br /&gt;foreground=yes&lt;br /&gt;output = /dev/stdout&lt;br /&gt;debug = 7&lt;br /&gt;&lt;br /&gt;[load-balance]&lt;br /&gt;client=yes&lt;br /&gt;accept  = 80&lt;br /&gt;connect = localhost:9080&lt;br /&gt;connect = localhost:9081&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-2564697670445482026?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/2564697670445482026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=2564697670445482026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/2564697670445482026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/2564697670445482026'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/09/stunnel.html' title='Stunnel'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-1910782229007357811</id><published>2008-09-10T11:36:00.000-06:00</published><updated>2008-09-10T11:36:07.965-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='netcat'/><category scheme='http://www.blogger.com/atom/ns#' term='stunnel'/><title type='text'>Debugging with Netcat</title><content type='html'>Wanted to spotlight one of my favorite utlities -- &lt;a href="http://netcat.sourceforge.net/"&gt;NETCAT&lt;/a&gt;.  It's probably my most favorite of utilities.  I've used it for years in debugging network issues, especially web issues.  It's been described as the "The TCP/IP Swiss Army Knife."  It's very powerful.  &lt;br /&gt;&lt;br /&gt;I use it frequently to grab and send http requests.  It allows you to see the exact bytes sent/received on the wire from your browser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using netcat to grab an http request&lt;/span&gt;&lt;br /&gt;1) Start netcat in listen mode on a port and save the request.&lt;br /&gt;&lt;blockquote&gt;$ nc -l -p 9999 | tee somerequest.http&lt;/blockquote&gt;&lt;br /&gt;2) Perform a sample HTTP request using browser: http://localhost:9999/index.html&lt;br /&gt;3) View the request -- you'll see the entire http request payload (headers &amp; content)&lt;br /&gt;&lt;blockquote&gt;GET /index.html HTTP/1.1&lt;br /&gt;Host: localhost:9999&lt;br /&gt;User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1&lt;br /&gt;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;Accept-Language: en-us,en;q=0.5&lt;br /&gt;Accept-Encoding: gzip,deflate&lt;br /&gt;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;Keep-Alive: 300&lt;br /&gt;Connection: keep-alive&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using netcat to play back an http request&lt;/span&gt;&lt;br /&gt;Easy as capturing a request -- just redirect the saved HTTP request using:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ nc www.google.com 80 &lt; somerequest.http &gt; someresponse.http&lt;/blockquote&gt;&lt;br /&gt;You may notice that the response looks garbled -- this is probably due to the fact that it is GZipped-encoded.  Look for a header such as "Content-Encoding: gzip".  You could re-submit the request after removing the "Accept-Encoding:" header and it will no longer be in gzip format.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Cool Things to Do to Impress Your Friends&lt;/span&gt;&lt;br /&gt;1) Copy a file  from 1 server to another&lt;br /&gt;Netcat just reads &amp; dumps byts to and from ports.  Very simple.  To copy a file from one server to another without using SSH/FTP/RCP/etc, just do this:&lt;br /&gt;On the source server, just redirect a file to a port:&lt;br /&gt;&lt;blockquote&gt;$ nc -l -p 9999 &lt; somefile.txt &lt;/blockquote&gt;&lt;br /&gt;On the destination server, just connect to that port and redirect the bytes to a local file:&lt;br /&gt;&lt;blockquote&gt;$ nc source.server.com 9999 &gt; somefile.txt&lt;/blockquote&gt;&lt;br /&gt;You may want to do a checksum on the file to ensure contents were not modified or somehow broken.&lt;br /&gt;&lt;br /&gt;2) Copy segments of a file (i.e., restarting a transfer)&lt;br /&gt;If you are doing the above transfer and something occurred which caused network to fail, you can simply send just parts of the file and concatenate the new segments to the old file.  You just need to know how may bytes the destination file already has, then use "dd" to strip them off.  In the following example, the destination already had the first 12,000,150 bytes, so we will skip those.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ dd bs=1 skip=12,000,150 if=somefile.txt | nc -l -p 9999&lt;/blockquote&gt;&lt;br /&gt;Then, just simply append the new contents to what you already have on the destination:&lt;br /&gt;&lt;blockquote&gt;$ nc source.server.com 9999 &gt;&gt; somefile.txt&lt;/blockquote&gt;&lt;br /&gt;3) Give shell access&lt;br /&gt;Netcat can be used to pipe STDIN/STDOUT to a process, too.  This can be dangerous, but also powerful.  :)&lt;br /&gt;&lt;br /&gt;This example creates a network pipe to bash, so anyone connecting to the listener port will have the users bash command access:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ nc -l -p 9999 -e /bin/bash&lt;/blockquote&gt;&lt;br /&gt;Probably, a better way to utilize this feature is to perform a quick backup of a directory.  On the source server, type (the -q 5 options tells netcat to close the connection 5 seconds after reaching the EOF)&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ tar zcfv - somedir | nc -q 5 -l -p 9999 &lt;/blockquote&gt;&lt;br /&gt;Then, on the destination server, type:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ nc myserver.com 9999 &gt; somedir.tar.gz &lt;/blockquote&gt;&lt;br /&gt;3b) If you have the "pv" utility installed, you can get progress information displayed to your terminal.  Pv just displays information about the bytes traveling through a network pipe.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;tar zcf - somedir | pv | nc -l -p 9999&lt;br /&gt;61.3MB 0:00:30 [   2MB/s] [   &lt;=&gt;   ]&lt;/blockquote&gt;&lt;br /&gt;4) Port scanning&lt;br /&gt;Netcat can act as a port-scanner, too.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$ nc -v -z localhost 1-100&lt;br /&gt;localhost [127.0.0.1] 80 (www) open&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What about HTTPS?&lt;/span&gt;&lt;br /&gt;Stunnel is another one of my favorite utilities.  It allows you to tunnel TCP/IP connections over SSL.  It also can act as an HTTPS proxy so that you can stick with HTTP traffic locally, but switch to HTTPS when you put it on the wire.&lt;br /&gt;&lt;br /&gt;This is very handy when you don't have control over the server and it only requests https, but you want to take a look at packets/http messages b/w your client and the server.&lt;br /&gt;&lt;br /&gt;I'll do another post soon on how to use stunnel to handle https.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Alternatives&lt;/span&gt;&lt;br /&gt;WireShark/Tcpdump -- Packet analyzer.  Very nice and powerful (wireshark used to be called Ethereal)&lt;br /&gt;TcpMon -- was bundled with earlier version of Axis 1.x, but not sure where it went now? -- just sat in the middle b/w TCP/IP connections and listened, logged, and fwded in real time.&lt;br /&gt;Firebug Firefox plugin -- Nice for HTTP debugging.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-1910782229007357811?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/1910782229007357811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=1910782229007357811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1910782229007357811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1910782229007357811'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/09/debugging-with-netcat.html' title='Debugging with Netcat'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-5607840092347121464</id><published>2008-09-09T08:42:00.003-06:00</published><updated>2008-09-09T09:22:57.468-06:00</updated><title type='text'>RXVT and Cygwin</title><content type='html'>I don't like the dos-window that Cygwin launches in by default.  Instead, I install the RXVT package.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Benefits:&lt;/span&gt;&lt;br /&gt;1) Copy and paste doesn't break lines.&lt;br /&gt;2) Completely customizable xterm-like window (scrollbars, colors, sizes, etc)&lt;br /&gt;3) Completely resizable to almost your entire screen (nice for tailing log files, looking at exception stack traces, etc)&lt;br /&gt;4) More pleasing&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Dislikes:&lt;/span&gt;&lt;br /&gt;1) About the only thing I have found that I don't like about RXVT (which I bet there is a solution for) is that it uses middle-mouse to paste.  Since I use Putty a lot, and Putty uses right-mouse to paste, I always get them mixed up and end up doing the wrong darn thing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Installation and Configuration:&lt;/span&gt;&lt;br /&gt;1) Run the Cygwin setup app -- &lt;a href="http://cygwin.com/setup.exe"&gt;http://cygwin.com/setup.exe&lt;/a&gt;&lt;br /&gt;2) Install the RXVT package&lt;br /&gt;3) Create a new shortcut for "E:\cygwin\bin\rxvt.exe -e /bin/bash -login"&lt;br /&gt;4) Create .Xresources file in your Cygwin $HOME dir:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;rxvt.font:            Lucida Console-12&lt;br /&gt;rxvt.boldFont:        Lucida Console-12&lt;br /&gt;rxvt.scrollBar:       True&lt;br /&gt;rxvt.visualBell:      True&lt;br /&gt;rxvt.loginShell:      True&lt;br /&gt;rxvt.background:      Black&lt;br /&gt;rxvt.foreground:      White&lt;br /&gt;rxvt.saveLines:       3000&lt;br /&gt;rxvt.cursorColor:     Green&lt;br /&gt;rxvt.scrollBar_right: True&lt;br /&gt;rxvt.geometry:        125x50&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;That's it.  An alternative option is to specify all the options on the rxvt cmd line.&lt;br /&gt;&lt;br /&gt;Update: I was curious to see if there was an easy way to change PASTE from middle-click to right-click.  Found this posting, but it requires you to compile RXVT from source: http://mpuentes.blogspot.com/2007/11/cygwin-rxvt.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-5607840092347121464?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/5607840092347121464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=5607840092347121464' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5607840092347121464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5607840092347121464'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/09/rxvt-and-cygwin.html' title='RXVT and Cygwin'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-1004072164488136829</id><published>2008-09-04T10:33:00.006-06:00</published><updated>2008-09-08T11:13:00.953-06:00</updated><title type='text'>Necessary Software</title><content type='html'>Here's a quick list of the software I use on an everyday basis.  These are the "necessities" I quickly grab when I re-install a new host or guest OS:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Windows&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; Firefox&lt;br /&gt;  &lt;ul&gt; Plugins:&lt;br /&gt;    &lt;li&gt; Firebug&lt;br /&gt;    &lt;li&gt; Foxmarks&lt;br /&gt;    &lt;li&gt; FoxyProxy&lt;br /&gt;  &lt;/ul&gt;&lt;br /&gt;&lt;li&gt; 7-zip&lt;br /&gt;&lt;li&gt; Putty&lt;br /&gt;&lt;li&gt; TortoiseSVN&lt;br /&gt;&lt;li&gt; Wireshark&lt;br /&gt;&lt;li&gt; JDK&lt;br /&gt;&lt;li&gt; Eclipse&lt;br /&gt;&lt;li&gt; Launchy&lt;br /&gt;&lt;li&gt; NotePad++&lt;br /&gt;&lt;li&gt; SysExplorer (and other sysinternals utils such as tcpview and tcpvcon)&lt;br /&gt;&lt;li&gt; LDAP Browser&lt;br /&gt;&lt;li&gt; Cygwin&lt;br /&gt;  &lt;ul&gt; Packages:&lt;br /&gt;     &lt;li&gt; Netcat&lt;br /&gt;     &lt;li&gt; wget&lt;br /&gt;     &lt;li&gt; curl&lt;br /&gt;     &lt;li&gt; Perl (and perl_manpages)&lt;br /&gt;     &lt;li&gt; chere&lt;br /&gt;     &lt;li&gt; rxvt&lt;br /&gt;     &lt;li&gt; git and subversion&lt;br /&gt;     &lt;li&gt; openssh&lt;br /&gt;     &lt;li&gt; openssl&lt;br /&gt;     &lt;li&gt; rsync&lt;br /&gt;     &lt;li&gt; screen&lt;br /&gt;     &lt;li&gt; stunnel&lt;br /&gt;     &lt;li&gt; vim&lt;br /&gt;     &lt;li&gt; wtf&lt;br /&gt;  &lt;/ul&gt;&lt;br /&gt;  &lt;li&gt; VirtualCD (from Microsoft MSDN)&lt;br /&gt;  &lt;li&gt; Synergy (as client)&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Linux&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; VirtualBox&lt;br /&gt;&lt;li&gt; All of the cygwin packages above, if not already installed.&lt;br /&gt;&lt;li&gt; Firefox&lt;br /&gt;&lt;li&gt; Synergy (as server)&lt;br /&gt;&lt;li&gt; Pidgin&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-1004072164488136829?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/1004072164488136829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=1004072164488136829' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1004072164488136829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1004072164488136829'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/09/necessary-software.html' title='Necessary Software'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-5838147987733262209</id><published>2008-05-01T12:40:00.005-06:00</published><updated>2009-08-24T09:42:23.291-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WEB21C'/><category scheme='http://www.blogger.com/atom/ns#' term='BT SDK'/><category scheme='http://www.blogger.com/atom/ns#' term='visual studio express 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='sms'/><title type='text'>Using VisualStudio Express and BTs SDK</title><content type='html'>I've seen a lot of posts regarding BT's Web21C SDK and using it with VisualStudio Express.  Here's a quick "how-to" to get an example running.&lt;br /&gt;&lt;br /&gt;Here's a working solution I used to do the following steps (may even work in VisualStudio Pro): &lt;a href="http://dustin.breese.googlepages.com/SampleVisualStudioExpress.zip"&gt;http://dustin.breese.googlepages.com/SampleVisualStudioExpress.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1) Download and install VSExpress Edition 2008 from &lt;a href="http://www.microsoft.com/express/download/default.aspx"&gt;http://www.microsoft.com/express/download/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) Download and extract latest .NET SDK (5.2.1 in this example) from &lt;a href="http://web21c.bt.com"&gt;http://web21c.bt.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3) Create a new Visual Studio Project (File-&gt;New Project...).  Make it a Console Application.&lt;br /&gt;&lt;br /&gt;4) Right click on "References" and select "Add reference...". &lt;br /&gt;&lt;br /&gt;5) Select the Browse tab and browse to where you extracted the BT SDK and drill down to the libraries folder.&lt;br /&gt;&lt;br /&gt;6) Select the "BT.Sdk.Core*" and whatever else library you want to use.  In this example, I just selected "BT.Sdk.MessagingOneWayCapability" which brings in the code to send an SMS text message.&lt;br /&gt;&lt;br /&gt;7) Go to web21c.bt.com and generate a new certificate and keypair via &lt;a href="https://web21c.bt.com/registered_applications/new"&gt;https://web21c.bt.com/registered_applications/new&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;8) Copy the pfx file (don't forget your pwd!) into the project.  Right click and "Include in project". Make sure it's properties are set to "Copy To Output Directory = Always"&lt;br /&gt;&lt;br /&gt;9) Copy in the *.cer files from the directory where you extracted the SDK.  They are located under the "certs" directory.  Right click and "Include in Project".  Also make sure that the properties are set to "Copy to Output Directory = Always"&lt;br /&gt;&lt;br /&gt;10) Right click the Project and select "Add-&gt;New Item...".  Select "Application Configuration and name the file App.config&lt;br /&gt;&lt;br /&gt;11) Add the following content, making sure to set certFile and certPassword to YOUR values (see next step).  To access "Oaktree/Production", you will also need to top-up your account with credits from the portal.  To access "Acorn/Sandbox", you can only send limited messages and do limited things.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;appSettings&amp;gt;&lt;br /&gt;    &amp;lt;add key="certFile" value="mycert.pfx"/&amp;gt;&lt;br /&gt;    &amp;lt;add key="certPassword" value="yourpwd"/&amp;gt;&lt;br /&gt;    &amp;lt;add key="serverCertFile" value="btsdkservercert-oaktree.cer"/&amp;gt;&lt;br /&gt;    &amp;lt;add key="Web21c_Environment" value="production"/&amp;gt;&lt;br /&gt;  &amp;lt;/appSettings&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;system.web&amp;gt;&lt;br /&gt;    &amp;lt;webServices&amp;gt;&lt;br /&gt;      &amp;lt;soapExtensionTypes&amp;gt;&lt;br /&gt;        &amp;lt;add type="BT.Sdk.Core.Web21cSoapExtension, BT.Sdk.Core"/&amp;gt;&lt;br /&gt;      &amp;lt;/soapExtensionTypes&amp;gt;&lt;br /&gt;    &amp;lt;/webServices&amp;gt;&lt;br /&gt;  &amp;lt;/system.web&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;12) Now, open up Program.cs and enter the following for the Main method:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            BT.Sdk.Messaging.OneWayCapability.MessagingOneWayManager mgr = new BT.Sdk.Messaging.OneWayCapability.MessagingOneWayManager();&lt;br /&gt;            mgr.SendMessage("tel:+yourNBRincludingcountrycode", "Testing from VS Express!");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;13) There is no step 13 as that is unlucky.&lt;br /&gt;&lt;br /&gt;13.5) Expand the References and remove and re-add the BT* references by right clicking and drilling down to the Libraries subdirectory in the location where you installed the Web21CSDK.&lt;br /&gt;&lt;br /&gt;14) Run and it should work.  If an exception occurs, cd into the Bin/Debug directory and run your .exe from a cmd prompt.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;Dustin&lt;br /&gt;&lt;a href="http://dustinbreese.blogspot.com/"&gt;http://dustinbreese.blogspot.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-5838147987733262209?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/5838147987733262209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=5838147987733262209' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5838147987733262209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/5838147987733262209'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/05/using-visualstudio-express-and-bts-sdk.html' title='Using VisualStudio Express and BTs SDK'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-7784680643248649042</id><published>2008-02-14T08:32:00.004-07:00</published><updated>2008-02-14T09:01:34.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sun'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='innotek'/><title type='text'>Virtualbox Being Purchased By Sun</title><content type='html'>Not sure yet if this is good or bad, but Innotek, the developer brains behind &lt;a href="http://virtualbox.org/"&gt;VirtualBox&lt;/a&gt;, just &lt;a href="http://www.sun.com/aboutsun/pr/2008-02/sunflash.20080212.1.xml"&gt;announced that Sun Microsystems is purchasing them&lt;/a&gt;.  I'm betting its a GOOD thing.  I've been a _very_ happy user of VirtualBox for over a year now.  I use it on Ubuntu.  I've found that it has outperformed VMWare Server/Player/Workstation in most of my observations.  In the press release, Sun's intentions are that VirtualBox will continue to be aimed at the developer workstation.&lt;br /&gt;&lt;br /&gt;Sun already has [recently] entered the server virtualization market with their &lt;a href="http://www.sun.com/xvm"&gt;xVM product&lt;/a&gt;.  xVM is aimed at server virtualization and I'd bet good money it isn't cheap.&lt;br /&gt;&lt;br /&gt;I'm anxious to find out how Sun will market VirtualBox to additional developers.&lt;br /&gt;&lt;br /&gt;Things I like about VirtualBox --&lt;br /&gt;1) User experience.  Fast.  I have no issues with Virtual Box's performance.  I recall the last time I rebuilt my virtual machine, I was able to re-install WinXP in about 30 minutes.  Seems that for VMWare Workstation 5.5, it always took 2 hours.&lt;br /&gt;&lt;br /&gt;2) Shared folders.  Fast. Easy.  VMWare drives me nuts -- there is a 10 second pause the first time you access a shared folder.  That 10 seconds doesn't seem like a lot, but I always catch myself thinking -- "What is faster? Copy to a USB disk or shared folders?"  VirtualBox is fast and without delay.&lt;br /&gt;&lt;br /&gt;3) Stability.  I've had a few BSOD using VirtualBox, but is that because of Windoze or VirtualBox?  I'll never know.&lt;br /&gt;&lt;br /&gt;4) Free.  VMWare has Server and Player versions which are free, but, especially in the case of Player, they are very stripped down.  VirtualBox is free.  Please keep it that way, Sun.&lt;br /&gt;&lt;br /&gt;Anyways, I surely appreciate the developers at Innotek. They've done a fantastic job and I hope Sun treats them well!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-7784680643248649042?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/7784680643248649042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=7784680643248649042' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/7784680643248649042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/7784680643248649042'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/02/virtualbox-being-purchased-by-sun.html' title='Virtualbox Being Purchased By Sun'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-1045009585182834600</id><published>2008-02-08T12:23:00.009-07:00</published><updated>2008-02-14T15:49:06.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WEB21C'/><category scheme='http://www.blogger.com/atom/ns#' term='BT SDK'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='web services'/><category scheme='http://www.blogger.com/atom/ns#' term='enunciate'/><category scheme='http://www.blogger.com/atom/ns#' term='BT'/><title type='text'>Enunciate and REST (with the BT SDK)</title><content type='html'>In my earlier post, I briefly took a look at enunciate.  I was impressed about Ryan's quick comments -- thanks, Ryan! &lt;br /&gt;&lt;br /&gt;In this post, I want to further explore how one can use enunciate to provide a RESTful API.  To explore, I'm going to use enunciate to put a quick RESTful api for sending a text message on top of the &lt;a href="http://web21c.bt.com"&gt;easy-to-use BT SDK&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The BT SDK is a toolkit you can use to interact with BT's global telecom network.  It boasts doing things with a single line of code -- sending text sms messages, creating point-to-point calls (both SIP and traditional land lines), conference calls with multiple participants, call-flow/IVR functionality, and more.  The SDK is available for Java, .NET, PHP, Python (and a PERL and Ruby version is available if you ask nicely :)  It literally should take no more than 15 minutes to get up and running.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; First, go and download the Java BT SDK (you'll have to register which takes 1 minute or less)&lt;br /&gt;&lt;li&gt; Unzip the SDK into a directory (BTSDK_HOME)&lt;br /&gt;&lt;li&gt; Create a project skeleton in Eclipse with a "lib" directory which contains all of the BTSDK_HOME/lib/*.jar files as well as the BTSDK_HOME/Web21C-JavaSDK-5.0.jar.&lt;br /&gt;&lt;li&gt; Copy in ENUNCIATE_HOME/enunciate-full-1.6.jar into the lib directory.&lt;br /&gt;&lt;li&gt; Add all jars in the lib directory to your classpath in Eclipse.&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Create an "api" and "impl" package in your source folder.  In the api package, create the interface as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.db.btsdkexamples.api;&lt;br /&gt;&lt;br /&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.Adjective;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.Noun;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.RESTEndpoint;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.Verb;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.VerbType;&lt;br /&gt;&lt;br /&gt;@RESTEndpoint&lt;br /&gt;@WebService&lt;br /&gt;public interface MessagingInterface {&lt;br /&gt;    @Verb ( VerbType.update )&lt;br /&gt;    @Noun ( "message" )&lt;br /&gt;    public void sendMessage(&lt;br /&gt;      @Adjective(name="endpoint") String endpoint,&lt;br /&gt;      @Adjective(name="message")  String message);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To tell enunciate to produce a RESTful api, all it takes is to put the @RESTEndpoint annotation on the interface and the impl.  This annotation just tells enunciate that the methods will be exposed as REST endpoints.  The additional method and parameter annotations dictates HOW enunciate exposes the api.  Note, that even though I am not interested in creating a SOAP-based web service, I still had to put the @WebService annotation on the interface and the impl class.&lt;br /&gt;&lt;br /&gt;The other annotations we need to discuss are on the method and the parameters.&lt;br /&gt;&lt;br /&gt;The @Verb annotation dictates what &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html"&gt;HTTP METHODs&lt;/a&gt; must be used.  REST is based exclusively upon the HTTP protocol and heavily uses HTTP GETs and POSTs.  GET and POST is the most heavily utilized where POST is typically overloaded to also provide PUT and DELETE functionality.  This is traditionally due to lack of browser and firewall support for anything other than GET and POST.  The @Verb parameter just dictates what HTTP METHOD value will be used to interact with this service.  In our example, VerbType.update means an HTTP POST must be used versus an HTTP GET.&lt;br /&gt;&lt;br /&gt;The @Noun annotation effectively dictates what "resource" will appear in the URL.  For example, a value of "Customer" would indicate the URL will be in the form of "http://localhost/rest/Customer".&lt;br /&gt;&lt;br /&gt;Together with a @Verb of VerbType.update and @Noun of "message", this indicates that an HTTP POST to "http://localhost/rest/message" will be mapped to this method.&lt;br /&gt;&lt;br /&gt;Next question, how do we map HTTP parameters to method parameters?  There are two ways -- a Named Resource (ProperNoun) or standard HTTP query string.  I wish there was a third way -- URL Mapping to parameters (maybe there is a way?)&lt;br /&gt;&lt;br /&gt;ProperNoun works by taking the last part of the URL to map to a single method parameter.  For example, http://localhost/rest/message/17195551212 could map the "17195551212" part of the URL to the "endpoint" parameter.  The "message text" would need to be passed as a query parameter.  This approach is handled by the @ProperNoun annotation.  Note, however, that only a single @ProperNoun annotation can be specified.  &lt;br /&gt;&lt;br /&gt;HTTP Query parameters (or post data) is the second approach.  This is the approach I used in the example above.  It effectively means that the named query parameters will be mapped to the given method parameters.  The names do not need to match.  In my example above, an HTTP POST to http://localhost/rest/message with post data containing "endpoint=17195551212&amp;message=some+message+text" would be necessary to invoke the method. Invoking from cmd line looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ curl -d 'endpoint=17195551212&amp;message=test' http://localhost:8080/btsdkexample/rest/message&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Similarly, if I had used a @Verb of VerbType.read, then I would be able to just tack on the query-string parameters to the end of the URL and do a simple HTTP GET:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ curl http://localhost:8080/btsdkexample/rest/message?endpoint=17195551212&amp;message=test&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I haven't noticed if there is a way to map a more complex URL to multiple query parameters.  For example, I'd like to be able to map customer-id AND order-id to corresponding method params for something like this: http://localhost/rest/customer/custid123/orders/ord9988.  Please tell me if this breaks your idea of a REST uri.&lt;br /&gt;&lt;br /&gt;Next, we need to create the implementation class as follows in the impl package:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.db.btsdkexamples.impl;&lt;br /&gt;&lt;br /&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;import org.codehaus.enunciate.rest.annotations.RESTEndpoint;&lt;br /&gt;&lt;br /&gt;import com.db.btsdkexamples.api.MessagingInterface;&lt;br /&gt;&lt;br /&gt;@RESTEndpoint&lt;br /&gt;@WebService&lt;br /&gt;&lt;br /&gt;public class MessagingImpl implements MessagingInterface {&lt;br /&gt;&lt;br /&gt; public void sendMessage(String endpoint, String message) {&lt;br /&gt;  System.err.println("Sending message to " + endpoint + " == " + message);&lt;br /&gt;  new com.bt.sdk.capabilities.messaging.oneway.MessagingOneWayManager().sendMessage(endpoint, message);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now that we have [almost] everything done, we need to enable the BT SDK.  To do this requires a simple properties file and a private key/certificate.  You can obtain the the key and certificate by using the &lt;a href="https://web21c.bt.com/registered_applications/new"&gt;Certificate Tool at https://web21c.bt.com/registered_applications/new&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Go ahead and just generate one for the Sandbox environment (it's free, but you can only have 5 sandbox certs which are valid for 1 month each, plus you have limited number of messages you can send in a single day).&lt;br /&gt;&lt;br /&gt;Save the generated PKCS12/PFX file to your "src" directory.  Don't forget your password!&lt;br /&gt;&lt;br /&gt;Now, create security.properties in the "src" directory as follows and plug in the value for your password below and the name of your key file.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;org.apache.ws.security.crypto.provider=com.bt.security.PKCS12Crypto&lt;br /&gt;org.apache.ws.security.crypto.merlin.keystore.type=pkcs12&lt;br /&gt;org.apache.ws.security.crypto.merlin.keystore.password=yourpass&lt;br /&gt;org.apache.ws.security.crypto.merlin.alias.password=yourpass&lt;br /&gt;org.apache.ws.security.crypto.merlin.file=YourPrivateKey_in_src_folder.pfx&lt;br /&gt;&lt;br /&gt;#constants.provider=com.bt.sdk.common.ProductionConstants&lt;br /&gt;constants.provider=com.bt.sdk.samples.SandboxEndpoints&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You are literally minutes away from testing!&lt;br /&gt;&lt;br /&gt;Now, we just need to create a special enunciate.xml config file that tells enunciate to bundle up your security.properties file and key file into the WAR in the WEB-INF/classes directory.&lt;br /&gt;&lt;br /&gt;Create enunciate.xml in the project root:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;enunciate label="btsdkexamples"&amp;gt;&lt;br /&gt; &amp;lt;modules&amp;gt;&lt;br /&gt;    &amp;lt;spring-app compileDebugInfo="true"&amp;gt;&lt;br /&gt;        &amp;lt;copyResources dir="src" pattern="*.properties"/&amp;gt;&lt;br /&gt;        &amp;lt;copyResources dir="src" pattern="*.pfx"/&amp;gt;&lt;br /&gt;    &amp;lt;/spring-app&amp;gt;&lt;br /&gt;  &amp;lt;/modules&amp;gt;&lt;br /&gt;&amp;lt;/enunciate&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, you will need your build.xml, so here it is, pretty much identical to my last post:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;project name="btsdkexample" default="package"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="init"&amp;gt;&lt;br /&gt;  &amp;lt;property name="enunciate.home" value="/home/dbreese/bin/enunciate-1.6" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="jdk.home" value="/opt/java/" /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;path id="enunciate.classpath"&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${enunciate.home}/lib"&amp;gt;&lt;br /&gt;    &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${enunciate.home}"&amp;gt;&lt;br /&gt;    &amp;lt;include name="enunciate-full-*.jar" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${jdk.home}/lib"&amp;gt;&lt;br /&gt;    &amp;lt;include name="tools.jar"/&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="lib"&amp;gt;&lt;br /&gt;    &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask"&amp;gt;&lt;br /&gt;   &amp;lt;classpath refid="enunciate.classpath" /&amp;gt;&lt;br /&gt;  &amp;lt;/taskdef&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="clean"&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="dist"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="package" depends="clean,init"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="dist"/&amp;gt;&lt;br /&gt;  &amp;lt;enunciate basedir="src" configFile="enunciate.xml"&amp;gt;&lt;br /&gt;   &amp;lt;include name="**/*.java" /&amp;gt;&lt;br /&gt;   &amp;lt;classpath refid="enunciate.classpath" /&amp;gt;&lt;br /&gt;   &amp;lt;export artifactId="spring.war.file" destination="dist/${ant.project.name}.war" /&amp;gt;&lt;br /&gt;  &amp;lt;/enunciate&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Run the build, copy the war file to your container (for me it's JBOSS_HOME/server/default/deploy), and test with the following.  The format of "endpoint" is "tel:+" + 2 digit country code + tn.  (%2B is urlencoding for a plus sign!)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;curl -d 'endpoint=tel:%2B17195551212&amp;message=test' http://localhost:8080/btsdkexample/rest/message&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Returning more complex data types&lt;/h2&gt;&lt;br /&gt;In the above example, our method return type was void.  What about returning a complex data type?  This is also easy using JAXB 2.0 annotations.  The only requirement is that the return type must be annotated with @XmlRootElement.&lt;br /&gt;&lt;br /&gt;Let's return a simple data type called "MyMessageStatus" which simply contains the telephone nbr, the message, and the message id returned from the BT SDK. (Yeah, I know my naming conventions suck.)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.db.btsdkexamples.business;&lt;br /&gt;&lt;br /&gt;import javax.xml.bind.annotation.XmlRootElement;&lt;br /&gt;&lt;br /&gt;@XmlRootElement&lt;br /&gt;public class MyMessageStatus {&lt;br /&gt; public String endpoint;&lt;br /&gt; public String message;&lt;br /&gt; public String btMessageId;&lt;br /&gt;&lt;br /&gt; public MyMessageStatus(String endpoint, String message, String messageId) {&lt;br /&gt;  this.endpoint = endpoint;&lt;br /&gt;  this.message = message;&lt;br /&gt;  this.btMessageId = messageId;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public MyMessageStatus() {&lt;br /&gt;  // satisfy no-arg requirement&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And modify the interface and impl class to return an object instead of void (only IMPL class method shown here):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; public MyMessageStatus sendMessage(String endpoint, String message) {&lt;br /&gt;  System.err.println("Sending message to " + endpoint + " == " + message);&lt;br /&gt;  Message msg = new com.bt.sdk.capabilities.messaging.oneway.MessagingOneWayManager().sendMessage(endpoint, message);&lt;br /&gt;  return new MyMessageStatus(endpoint,message,msg.getMessageId());&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Run the build, deploy, and test:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ curl -d 'endpoint=tel:%2B17192137681&amp;message=test' http://localhost:8080/btsdkexample/rest/message&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;br /&gt;&amp;lt;myMessageStatus&amp;gt;&lt;br /&gt; &amp;lt;endpoint&amp;gt;tel:+17192137681&amp;lt;/endpoint&amp;gt;&lt;br /&gt; &amp;lt;message&amp;gt;test&amp;lt;/message&amp;gt;&lt;br /&gt; &amp;lt;btMessageId&amp;gt;e385b6e38eac4de9567a3c2e76b51729at&amp;lt;/btMessageId&amp;gt;&lt;br /&gt;&amp;lt;/myMessageStatus&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some restrictions I've run across with the return types:&lt;br /&gt;1) It is not possible to have a complex class type as a method parameter;  therefore, I had to modify my method signatures to use only Strings and simple data types.&lt;br /&gt;&lt;br /&gt;2) enunciate does not [yet] support returning collections, so to return a collection, it appears, you'd need to wrap it with a class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-1045009585182834600?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/1045009585182834600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=1045009585182834600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1045009585182834600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/1045009585182834600'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/02/enunciate-and-rest-with-bt-sdk.html' title='Enunciate and REST (with the BT SDK)'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-7403199202134618254</id><published>2008-01-31T18:30:00.000-07:00</published><updated>2008-02-01T07:32:00.410-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='example'/><category scheme='http://www.blogger.com/atom/ns#' term='web services'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='enunciate'/><title type='text'>Enunciate!</title><content type='html'>&lt;span style="font-size:130%;"&gt;Overview&lt;/span&gt;&lt;br /&gt;Starting from scratch to write a web service, getting a WAR built, deployed into JBoss or your favorite container can be a pain.  I always start with an existing ant script and project, remove all the existing artifacts, then start fresh.  This means, typically, an hour or so of deleting unneeded jars/classes/relics, search-n-replacing, fixing built script to remove any references to the old project-specific crud, deploying to my container to test a simple hello-world-ish app.&lt;br /&gt;&lt;br /&gt;I hate doing this "setup" type work.  It's boring and lame.  .NET makes it really easy to startup a new project, so why do I hate doing it in Java?&lt;br /&gt;&lt;br /&gt;So, what options are there for Java?  One I have recently run across is &lt;a href="http://enunciate.codehaus.org/"&gt;Enunciate&lt;/a&gt; from our XFire friends at CodeHaus.&lt;br /&gt;&lt;br /&gt;Enunciate appears to solve a nice little java pain point -- "How can I rapidly deploy a webservice without bothering with all the infrastructure crud?"&lt;br /&gt;&lt;br /&gt;With a few simple &lt;a href="http://jcp.org/aboutJava/communityprocess/pfd/jsr181/index.html"&gt;JSR 181&lt;/a&gt; annotations, and using enunciate, you can quickly wrap up a complete, deployable WAR which contains a &lt;a href="http://en.wikipedia.org/wiki/WS-I_Basic_Profile"&gt;WS-I Basic Profile&lt;/a&gt; compliant web service, nice browsable service documentation, client code in the form of a JAR, WSDL, etc.&lt;br /&gt;&lt;br /&gt;If it sounds like a lot of effort, don't be fooled.  I loosely followed the &lt;a href="http://enunciate.codehaus.org/getting_started.html"&gt;enunciate Quick Start&lt;/a&gt; and had my own simple web service up and running within a few minutes.  This included setting up the eclipse project, downloading and unpacking enunciate, creating the ant build script, deploying to JBoss, and playing with the created application.&lt;br /&gt;&lt;br /&gt;Let's go through a quick example on setting up enunciate, building a sample project, and deploying it to JBoss.&lt;br /&gt;&lt;br /&gt;Enunciate is very module.  In fact, all of the default functionality is provided via a set of modules that come with enunciate out of the box.  If there is a deployable artifact that you want and there isn't a module for your desired functionality, then you are free to create your own module and donate it back to the project.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Getting Set Up&lt;/span&gt;&lt;br /&gt;I'll assume you already have a JDK, IDE, and a container installed.  Download enunciate from &lt;a href="http://enunciate.codehaus.org/downloads.html"&gt;http://enunciate.codehaus.org/downloads.html.&lt;/a&gt;  The latest at the time of this post is 1.6, release on January 8, 2008.  The download is only 9.2 megs.&lt;br /&gt;&lt;br /&gt;Extract the archive to some location.  I extracted it to $HOME/bin.&lt;br /&gt;&lt;br /&gt;If you want to run enunciate from cmd line versus ant script, then add enunciate/bin to your path.   I'm going to walk through setting up enunciate as an ant task.&lt;blockquote&gt;PATH=$PATH:$HOME/bin/enunciate-1.6/bin&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;Example Project&lt;br /&gt;&lt;/span&gt;My sample project doesn't vary much from the enunciate Quick Start.  I just like to try things myself in hopes that I hit something new.  The example project I quickly thought of is a music service which will have admin and search capabilities for artists, albums, and songs.  It is pretty simple, but just to illustrate the simplicity of enunciate and how it can handle some complexities of a "real-world" example.&lt;br /&gt;&lt;br /&gt;My example will have artists who can have zero-or-more albums which can have zero-or-more songs.  The service will allow adding relationships and searching.&lt;br /&gt;&lt;br /&gt;First, I created the project structure and created the simple directory structure:&lt;br /&gt;&lt;blockquote&gt;src&lt;br /&gt;|----build.xml (I'll be using ant)&lt;br /&gt;|----com&lt;br /&gt;........|----music&lt;br /&gt;................|----api&lt;br /&gt;................|----domain&lt;br /&gt;................|----impl&lt;br /&gt;&lt;/blockquote&gt;api -- contains interfaces and exceptions which define the exposed service&lt;br /&gt;model -- contains business models and relationships&lt;br /&gt;impl -- implementation classes for the interfaces&lt;br /&gt;&lt;br /&gt;Next, I defined the interface for the service. The service will be simple and define the following operations.  Note the @WebService annotation (&lt;a href="http://jcp.org/aboutJava/communityprocess/pfd/jsr181/index.html"&gt;from jsr-181&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;import com.music.model.Album;&lt;br /&gt;import com.music.model.Artist;&lt;br /&gt;import com.music.model.Song;&lt;br /&gt;&lt;br /&gt;@WebService&lt;br /&gt;public interface MusicServiceInterface {&lt;br /&gt;public Artist addArtist(Artist artist) throws AlreadyExistsException;&lt;br /&gt;public Album addAlbum(Artist artist, Album album) throws AlreadyExistsException;&lt;br /&gt;public Song addSong(Album album, Song song) throws AlreadyExistsException;&lt;br /&gt;public Song[] searchSongs(String someSearchText);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Now create skeletons for Album, Artist, and Song as well as AlreadyExistsException, just to get things to compile.  For this example, I'm NOT interested in implementing the actual functionality of a music search service; instead, I am only interested in how we expose a service quickly using enunciate.&lt;br /&gt;&lt;br /&gt;Next up is to define the implementation class as follows.  Note the reference to the implementation class in the @WebService annotation.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;import com.music.api.AlreadyExistsException;&lt;br /&gt;import com.music.api.MusicServiceInterface;&lt;br /&gt;import com.music.model.Album;&lt;br /&gt;import com.music.model.Artist;&lt;br /&gt;import com.music.model.Song;&lt;br /&gt;&lt;br /&gt;@WebService (&lt;br /&gt;   endpointInterface = "com.music.api.MusicServiceInterface"&lt;br /&gt; )&lt;br /&gt;public class MusicServiceImpl implements MusicServiceInterface {&lt;br /&gt;&lt;br /&gt;public Album addAlbum(Artist artist, Album album)&lt;br /&gt;     throws AlreadyExistsException {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Artist addArtist(Artist artist) throws AlreadyExistsException {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Song addSong(Album album, Song song) throws AlreadyExistsException {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Song[] searchSongs(String someSearchText) {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Now I have a compilable, but not-yet-functional application.  Let's go ahead and see what happens when we use enunciate to create the WAR artifact and deploy it to JBoss.&lt;br /&gt;&lt;br /&gt;I want to use ant for this example, so here's a sample build.xml file that you can modify to meet your needs:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;    &amp;lt;project name="music-enunciate-example" default="package"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="init"&amp;gt;&lt;br /&gt;     &amp;lt;property name="enunciate.home" value="/home/dbreese/bin/enunciate-1.6" /&amp;gt;&lt;br /&gt;     &amp;lt;property name="jdk.home" value="/opt/java/" /&amp;gt;&lt;br /&gt;&lt;br /&gt;     &amp;lt;path id="enunciate.classpath"&amp;gt;&lt;br /&gt;         &amp;lt;fileset dir="${enunciate.home}/lib"&amp;gt;&lt;br /&gt;             &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt;         &amp;lt;/fileset&amp;gt;&lt;br /&gt;         &amp;lt;fileset dir="${enunciate.home}"&amp;gt;&lt;br /&gt;             &amp;lt;include name="enunciate-full-*.jar" /&amp;gt;&lt;br /&gt;         &amp;lt;/fileset&amp;gt;&lt;br /&gt;         &amp;lt;fileset dir="${jdk.home}/lib"&amp;gt;&lt;br /&gt;             &amp;lt;include name="tools.jar"/&amp;gt;&lt;br /&gt;         &amp;lt;/fileset&amp;gt;&lt;br /&gt;     &amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt;     &amp;lt;taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask"&amp;gt;&lt;br /&gt;         &amp;lt;classpath refid="enunciate.classpath" /&amp;gt;&lt;br /&gt;     &amp;lt;/taskdef&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="clean"&amp;gt;&lt;br /&gt;     &amp;lt;delete dir="dist"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="package" depends="clean,init"&amp;gt;&lt;br /&gt;     &amp;lt;mkdir dir="dist"/&amp;gt;&lt;br /&gt;     &amp;lt;enunciate basedir="src"&amp;gt;&lt;br /&gt;         &amp;lt;include name="**/*.java" /&amp;gt;&lt;br /&gt;         &amp;lt;classpath refid="enunciate.classpath" /&amp;gt;&lt;br /&gt;         &amp;lt;export artifactId="spring.war.file" destination="dist/${ant.project.name}.war" /&amp;gt;&lt;br /&gt;     &amp;lt;/enunciate&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;NOTE: I ran into an issue where it was complaining about "java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory".  To fix, I had to add jdk.home/lib/tools.jar to my classpath.  I literally spent 50% of my time on this sample project trying to fix this stupid little error!&lt;br /&gt;&lt;br /&gt;Notice the "artifactId" which is "spring.war.file".  This indicates that a fully functional WAR FILE will be created.  Another possible value is "spring.war.dir" which is an exploded WAR directory. &lt;br /&gt;&lt;br /&gt;Enunciate can also produce FLEX-compatible artifacts.&lt;br /&gt;&lt;br /&gt;Build the project by running "ant package".&lt;br /&gt;&lt;br /&gt;Once it is successfully built, deploy dist/music-enunciate-example.war to your container.  Since I'm using a default instance of jboss, I just copy it into $JBOSS_HOME/server/default/deploy and JBoss will deploy it.&lt;br /&gt;&lt;br /&gt;Now, open your browser and hit "http://localhost:8080/music-enunciate-example".  You should see the following sample page:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_MWOG3-CM30I/R6KM9OWcsUI/AAAAAAAABLU/wFp9zYmtVe4/s1600-h/music-enunciate-example-home.png"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_MWOG3-CM30I/R6KM9OWcsUI/AAAAAAAABLU/wFp9zYmtVe4/s320/music-enunciate-example-home.png" alt="" id="BLOGGER_PHOTO_ID_5161843106372170050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The web page has all the complete documentation, wsdl, and even includes a downloadable client.&lt;br /&gt;&lt;br /&gt;Docu&lt;span style="font-size:100%;"&gt;mentation is generated directly from javadocs,  so as long as you follow good javadoc practices, the html documentation generated by enunciate will be great.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Customization and Modules&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can provide a configuration file that allows you to personalize URLs, namespaces, package names, documentation pages, etc. The configuration file can be provided in the enunciate ant task with the configFile attribute, or the "-f" cmd line option. It appears enunciate also makes use of a "package-info.java" class for annotations which will drive namespaces, documentation, etc.&lt;br /&gt;&lt;br /&gt;Enunciate can be extended with modules. The core functionality of enunciate is implemented with modules. For example, the xfire-client module is responsible for generating the downloadable xfire client. The enunciate configuration file has a section which is used to configure each module. Check out this link for information on the core modules that come with enunciate.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;REST&lt;/span&gt;&lt;br /&gt;Enunciate can also generate restful services for you.  This is accomplished using the "rest" module.  (&lt;a href="http://enunciate.codehaus.org/module_rest.html#constraints"&gt;See Constraints enunciate places on exposing REST models&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;I want to dive more into how enunciate can help with REST APIs in a future article.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Misc Questions&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;WTF is "artifactId" in the enunciate ant target? &lt;a href="http://enunciate.codehaus.org/artifacts.html"&gt;Here's a good link which articulates what is available.&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Some things I still want to investigate:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;How easily is it incorporated into existing projects?&lt;br /&gt;It seems that you can easily incorporate enunciate into existing projects, but you'd then have multiple ways of exposing your web services which adds project complexity.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Can it handle WSDL/contract-first development?&lt;br /&gt;Enunciate is more aimed at code-first approach.  Still trying to get mind around it and see if WSDL-First is possible.&lt;/li&gt;&lt;li&gt;How does it incorporate into ant/maven?  &lt;a href="http://enunciate.codehaus.org/executables.html"&gt;Easy.&lt;/a&gt;  Plus, see above for a working ant script using the enunciate task.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-7403199202134618254?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/7403199202134618254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=7403199202134618254' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/7403199202134618254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/7403199202134618254'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/01/enunciate.html' title='Enunciate!'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_MWOG3-CM30I/R6KM9OWcsUI/AAAAAAAABLU/wFp9zYmtVe4/s72-c/music-enunciate-example-home.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-6552903632829631411</id><published>2008-01-04T08:48:00.000-07:00</published><updated>2008-01-04T11:00:22.644-07:00</updated><title type='text'>Synergy -- Sharing a single keyboard and mouse</title><content type='html'>&lt;a href="http://synergy2.sourceforge.net/"&gt;Synergy&lt;/a&gt; is a nifty little software package I just started using.  It hasn't been very active for over a year, but what it provides is EXACTLY what I've needed for a long, long time.&lt;br /&gt;&lt;br /&gt;My office desk at home is a corner/L-shaped desk with "hidden" drawers for the keyboard.  I hate these hidden keyboards (or at least mine!)  because my hand can't fit into the crack to grab the mouse to use it effectively.  I do consider myself a fast and efficient typer, but I don't really follow a good form; therefore, reaching into a crevice at an odd angle and trying to get my bearing on a hidden keyboard is quite a challenge.&lt;br /&gt;&lt;br /&gt;About the only thing I use my desktop for is for editing my digital photos (Canon 40D, in case you were wondering), editing some simple video of the family, and of course, playing my music from iTunes.&lt;br /&gt;&lt;br /&gt;I work at home about 60% of the time and have a nice laptop.  There are many times when I want to switch over to my desktop and do a simple quick task such as just changing the song, etc.  But I'm lazy and dread scooting back my chair, pulling out the keyboard and mouse, changing the song, and then putting everything back into place.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; &lt;a href="http://synergy2.sourceforge.net/"&gt;Synergy&lt;/a&gt;!  Synergy allows you to set up screen edges to control multiple other computers.  You specify one keyboard and mouse that controls them all.  Best of all, it runs on just about any OS, including Mac OS 10.2+.&lt;br /&gt;&lt;br /&gt;I run Ubuntu 7.10 Gutsy Gibbon on laptop and Windows, so these steps are more tailored for a linux server, but it looks very trivial to set up a Windows Synergy server, too.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1&lt;/span&gt;: Determine which computer will act as the controller ("server" in Synergy)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2&lt;/span&gt;: Download and install Synergy on all computers you want to control.&lt;br /&gt;For Ubuntu, it is as easy as "sudo apt-get install synergy"&lt;br /&gt;&lt;br /&gt;For Windows, just run the executable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3&lt;/span&gt;: Configure the server&lt;br /&gt;My server will be Ubuntu.  The config file is located in my $HOME directory:&lt;br /&gt;$ cat .synergy.conf&lt;br /&gt;section: screens&lt;br /&gt;        ulaptop:&lt;br /&gt;        desktop:&lt;br /&gt;end&lt;br /&gt;section: links&lt;br /&gt;        ulaptop:&lt;br /&gt;                right = desktop&lt;br /&gt;        desktop:&lt;br /&gt;                left = ulaptop&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;What the config file shows is 1) what servers/clients you have and 2) how they fit together.&lt;br /&gt;&lt;br /&gt;"section:screens" shows that I have only two computers: my server (ulaptop) and one client (desktop).&lt;br /&gt;&lt;br /&gt;"section:links" shows where the displays are located in respect to each other.  For example, for my laptop, the desktop is on the right.  Vice versa, for my desktop, my laptop is on the left. &lt;br /&gt;&lt;br /&gt;To configure a Windows Synergy server, launch Synergy and select the "Share this computer's keyboard and mouse (server)" option and then click the "Configure..." button.&lt;br /&gt;&lt;br /&gt;These settings just tell Synergy which edges of which screens will cause transfer of the mouse and keyboard to the other computer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4&lt;/span&gt;: Start the server&lt;br /&gt;For linux, $ synergys&lt;br /&gt;&lt;br /&gt;For Windows, launch Synergy and select "Share this computer's keyboard and mouse (server)" option.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 5&lt;/span&gt;: Start the clients&lt;br /&gt;Specify the IP address of the Synergy server.  There is a test mode on the Windows client which will indicate if a successful connection is made. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 6:&lt;/span&gt; Install synergy client as a service&lt;br /&gt;Optionally, you can click the "AutoStart..." button and configure Synergy as either a log-in service or a system service for Windows clients.&lt;br /&gt;&lt;br /&gt;That's it!  Took me about 10 minutes the first time I tried it and now LOVE it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-6552903632829631411?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/6552903632829631411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=6552903632829631411' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/6552903632829631411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/6552903632829631411'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/01/synergy-sharing-single-keyboard-and.html' title='Synergy -- Sharing a single keyboard and mouse'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-8348359469029583236</id><published>2008-01-04T08:46:00.000-07:00</published><updated>2008-01-04T11:02:06.330-07:00</updated><title type='text'>Blogging New Year!</title><content type='html'>I'm promising myself I'm going to do a better job at blogging and putting some useful, thought-inspiring content out here in 2008.&lt;br /&gt;&lt;br /&gt;Gotta get into the practice of doing what I should have been doing for years!&lt;br /&gt;&lt;br /&gt;Prior to this posting, you'll find a lot of useless crap; mainly just some notes I took while figuring out things in Linux, Development, etc.  I figured I'd jot it down on my personal BLOG.  From time-to-time I get an email letting me know it helped someone, but you'll probably find it useless.&lt;br /&gt;&lt;br /&gt;We'll start with a quick technical note about Synergy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-8348359469029583236?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/8348359469029583236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=8348359469029583236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/8348359469029583236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/8348359469029583236'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2008/01/blogging-new-year.html' title='Blogging New Year!'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-114082297340390332</id><published>2006-02-24T16:16:00.000-07:00</published><updated>2006-02-24T16:16:13.436-07:00</updated><title type='text'></title><content type='html'>Subversion Configuration and Install&lt;br /&gt;&lt;p&gt;1) Install packages&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ apt-get install subversion&lt;/p&gt;&lt;p&gt;&lt;br /&gt;2) Create sample repos:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ svnadmin create /var/svn/home&lt;/p&gt;&lt;p&gt;&lt;br /&gt;3) Run as a service:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;a) make sure inted is installed and configured&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ apt-get install inetd&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ vi /etc/services and insert:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;svn           3690/tcp   # Subversion&lt;/p&gt;&lt;p&gt;&lt;br /&gt;svn           3690/udp   # Subversion&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ vi /etc/inetd.conf&lt;/p&gt;&lt;p&gt;&lt;br /&gt;svn stream tcp nowait svn /usr/bin/svnserve svnserve -i -r /var/svn&lt;/p&gt;&lt;p&gt;&lt;br /&gt;{the svnowner is the userid, so make sure it exists}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;4) Make sure your user-id has write perms to the repos created above by the svn user&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-114082297340390332?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/114082297340390332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=114082297340390332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/114082297340390332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/114082297340390332'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2006/02/subversion-configuration-and-install-1.html' title=''/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-114075788440718750</id><published>2006-02-23T22:11:00.000-07:00</published><updated>2006-03-08T23:02:24.623-07:00</updated><title type='text'></title><content type='html'>SSHFS and Fuse&lt;br /&gt;&lt;p&gt;Great way to have a secure remote filesystem at home and be able to mount it locally while at coffee shop or at work.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;1) Download and install fuse and sshfs from Sourceforge.net&lt;/p&gt;&lt;p&gt;&lt;br /&gt;2) ./configure, make, and sudo make install for both fuse and sshfs&lt;/p&gt;&lt;p&gt;&lt;br /&gt;3) fuse will install libs under /usr/local/lib, so you must give kernel information on where to find the information by adding "/usr/local/lib" to the end of /etc/ld.so.conf.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;4) Update ld cache: sudo ldconfig&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5) I had to update /etc/modules to include "fuse" so that udev will re-create /dev/fuse when the module is loaded.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;6) mount your remote directory:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ mkdir thisdir&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ sshfs dbreese@192.168.1.200:  thisdir&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ mount&lt;/p&gt;&lt;p&gt;&lt;br /&gt;7) Unmount it:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;$ fusermount -u thisdir&lt;/p&gt;&lt;p&gt;8) If /dev/fuse issues arrise (doesn't exist or can't write to it):&lt;/p&gt;&lt;pre class="tightenable"&gt;# mknod /dev/fuse c 10 229&lt;br /&gt;# chmod o+rw /dev/fuse&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-114075788440718750?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/114075788440718750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=114075788440718750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/114075788440718750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/114075788440718750'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2006/02/sshfs-and-fuse-great-way-to-have.html' title=''/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113532344697338558</id><published>2005-12-23T00:36:00.000-07:00</published><updated>2005-12-23T00:37:56.106-07:00</updated><title type='text'>DNS and the ActionTec Modem</title><content type='html'>he dhclient3 client runs /etc/dhcp3/dhclient-script can be extended by simply creating your own scripts under /etc/dhcp3/dhclient-*-hooks.d/. Check out the man pages for dhclient-script ($ man 8 dhclient-script) and read the HOOKS section.&lt;br /&gt;&lt;br /&gt;What I did was just dropped the following script in as an exit hook, so it is executed after the /etc/resolv.conf is updated.&lt;br /&gt;&lt;br /&gt;All this hack does is strip out the 192.168.1.1 crap that really doesn't work anyways.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ cat /etc/dhcp3/dhclient-exit-hooks.d/check_actiontec_dns&lt;br /&gt;BAD_IP=192.168.1.1&lt;br /&gt;echo `date`: checking dns ordering for actiontec woes&lt;br /&gt;grep ${BAD_IP} /etc/resolv.conf &gt; /dev/null&lt;br /&gt;if [ $? == 0 ]; then&lt;br /&gt;        echo removing actiontec dns entry&lt;br /&gt;        grep -v ${BAD_IP}  /etc/resolv.conf &gt; /tmp/resolv.conf&lt;br /&gt;        mv /tmp/resolv.conf /etc/resolv.conf&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;One thing that may break for you is if you go to another wifi access point that is NOT actiontec and it only has a single 192.168.1.1 dns entry. If it did, then you'd end up with an empty /etc/resolv.conf file! Just use this script as a base....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113532344697338558?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113532344697338558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113532344697338558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113532344697338558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113532344697338558'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/dns-and-actiontec-modem.html' title='DNS and the ActionTec Modem'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113407617284115807</id><published>2005-12-08T14:08:00.000-07:00</published><updated>2006-01-27T10:39:58.250-07:00</updated><title type='text'>QEMU -- Likes and Dislikes</title><content type='html'>Here are some things I'm starting to notice about QEMU:&lt;br /&gt;&lt;br /&gt;COOLNESS:&lt;br /&gt;- Loading and saving state -- CTRL-ALT-2 and use loadvm and savevm&lt;br /&gt;- Snapshots -- Use snapshot mode for when you are ready to do some major testing or upgrading.  If all goes well, go to the console and commit changes.&lt;br /&gt;&lt;br /&gt;NEEDS-SOME-WORK:&lt;br /&gt;- Clipboard integration b/w host and guest.  Doesn't seem to be any at all.&lt;br /&gt;- Mouse captured by the guest.  Only way to get out is to hit CTRL-ALT.  Minor, but I really liked the way VPC and VMWare integrated after you installed the add-ons.&lt;br /&gt;&lt;br /&gt;NOTES:&lt;br /&gt;1) $ qemu -localtime -user-net -m 384 -hda -smb /home/dbreese -loadvm tempsave winxppro.img&lt;br /&gt;Could not open '/dev/kqemu' - QEMU acceleration layer not activated&lt;br /&gt;&lt;br /&gt;To fix (http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/QemuCompilation)&lt;br /&gt;# /sbin/modprobe kqemu&lt;br /&gt;# mknod /dev/kqemu c 250 0  # Create the KQEMU device&lt;br /&gt;# chmod 666 /dev/kqemu      # Make it accessible to all users&lt;br /&gt;&lt;br /&gt;If modprobe gives error, then you may be able to:&lt;br /&gt;# mkdir -p /lib/modules/$(uname -r)/misc &amp;&amp;amp; cp ~/qemu-0.7.2/kqemu/kqemu.ko /lib/modules/$(uname -r)/misc &amp;&amp;amp; depmod -a&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CDROMs and QEMU&lt;/span&gt;&lt;br /&gt;Sometimes, you will need to insert another cd into the drive.  The behaviour is not good for me because my host OS (Ubuntu running Gnome) grabs and mounts the drive.  No matter what I tried (manually unmounting and remounting the drive, etc) I could not get QEMU to see the new disk which I had just inserted.  To fix this, hit CTRL-ALT-2 in the guest and type:&lt;br /&gt;qemu&gt; change cdrom /dev/cdrom&lt;br /&gt;&lt;br /&gt;And it will unmount and remount the cdrom within the guest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113407617284115807?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113407617284115807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113407617284115807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407617284115807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407617284115807'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/qemu-likes-and-dislikes.html' title='QEMU -- Likes and Dislikes'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113407476020476919</id><published>2005-12-08T13:20:00.000-07:00</published><updated>2006-02-28T00:18:43.196-07:00</updated><title type='text'>Dual Boot Windows XP and Linux</title><content type='html'>I installed Linux first. I left the first partition for Windows. I installed Linux first and then installed Windows XP Pro.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;1) Partition entire drive during linux install. I created the following partitions:&lt;br /&gt;Partition 1 - ntfs - /dev/hda1 - 10gigs&lt;br /&gt;Parittion 2 - ext3 - /dev/hda2 - I made this just a 512M /boot partition to contain my boot images and GRUB config.&lt;br /&gt;Partition 3 - Logical Partition (LVM) - /dev/hda3 - containing 1 volume group with two volumes: home and root - 68 gigs&lt;br /&gt;Partition 4 - Swap - /dev/hda4 - 2 gigs&lt;br /&gt;&lt;br /&gt;The nice thing about using a logical volume is that it can be dynamically sized and resized over time. It supposedly does have a small performance hit, so for servers with lots of disk activity, it needs more investigation.&lt;br /&gt;&lt;br /&gt;2) Install Linux.&lt;br /&gt;Easy step.&lt;br /&gt;&lt;br /&gt;3) Backup MBR&lt;br /&gt;The MBR is stored on first 512 bytes of your primary drive. To back it up is really easy -- just use "dd". One word of caution, though -- make sure you back it up to a drive that is NOT a Logical Volume. That is, put it on a floppy (or your iPod as I did!). If you do, it is still possible to get it back, so don't worry.&lt;br /&gt;&lt;br /&gt;$ dd if=/dev/hda of=/media/ipod/mymbr.bak count=1 bs=512&lt;br /&gt;&lt;br /&gt;4) Install Windows.&lt;br /&gt;When installing windows, choose the parition you want to install it on. I've heard Windows only really likes to be installed on /dev/hda1, so that is what I always stick to.&lt;br /&gt;&lt;br /&gt;Windows will tromp your MBR, so it will only boot into Windows. No worries, though -- the partition table is still there and your data should be there, too!&lt;br /&gt;&lt;br /&gt;5) Restore MBR because Windows is not nice and rewrites it.&lt;br /&gt;&lt;br /&gt;To do this, I use Knoppix. Download it for free and burn a cd. You can use just about any bootable linux distro. Basically, it is linux which boots into a desktop with most of the common utilities ever needed. I've even used it as a diskless workstation before and used a 512meg pen drive as my home directory.&lt;br /&gt;&lt;br /&gt;Once booted into Linux, just put in your floppy or mount your disk where you backed the MBR up to. Then restore the MBR:&lt;br /&gt;&lt;br /&gt;$ mount -t ext3 /dev/hda2 /mnt/hda2 (this was my /boot partition was just an ext3 partition)&lt;br /&gt;$ dd in=/mnt/hda2/mymbr.bak of=/dev/hda count=1 bs=512&lt;br /&gt;&lt;br /&gt;Then reboot and you should be back into Linux.&lt;br /&gt;&lt;br /&gt;6) Update GRUB to boot Windows.&lt;br /&gt;Once back into your previously installed linux, edit /boot/grub/menu.lst and add the following to GRUB's config to optionally boot into Windows during power on:&lt;br /&gt;&lt;br /&gt;title Microsoft Windows XP Pro&lt;br /&gt;root (hd0,0)&lt;br /&gt;makeactive&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;Other notes:&lt;br /&gt;When I originally partitioned my /dev/hda1, I set the partition type to FAT32. However, when I installed XP, I formatted it as NTFS. When I did all of the above steps, Ubuntu would not load. It complaied during startup that /dev/hda1's partition type was incorrect and just hung. Seems like it should have continued, but it didn't. In /etc/fstab, I could probably add "errors=remount-ro" to /dev/hda1. Anyways, this is what I had to do to get things all fixed back up.&lt;br /&gt;&lt;br /&gt;1) Boot into Knoppix&lt;br /&gt;2) Install LVM support (http://www.knoppix.net/wiki/LVM2) and mount your root partition (or wherever you have /etc mounted on).&lt;br /&gt;3) vi /mnt/myoldroot/etc/fstab and comment out the entry for /dev/hda1&lt;br /&gt;4) Once I was able to boot back into my Ubuntu system, I again edited /etc/fstab and changed the type to NTFS and did a "mount -a" to mount it and check it out.&lt;br /&gt;5) To fsck the filesystem:&lt;br /&gt;fsck -a /dev/VolGroup00/LogVol00 # took a long time&lt;br /&gt;&lt;br /&gt;Other LVM links:&lt;br /&gt;&lt;a href="http://www-128.ibm.com/developerworks/library/l-lvm2.html?n-l-4121"&gt;http://www-128.ibm.com/developerworks/library/l-lvm2.html?n-l-4121&lt;/a&gt;&lt;br /&gt;Channel #lvm on &lt;a href="http://www.freenode.net/"&gt;freenode&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113407476020476919?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113407476020476919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113407476020476919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407476020476919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407476020476919'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/dual-boot-windows-xp-and-linux.html' title='Dual Boot Windows XP and Linux'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113407317289427607</id><published>2005-12-08T12:47:00.000-07:00</published><updated>2005-12-08T13:19:32.903-07:00</updated><title type='text'>Emulators</title><content type='html'>I've used VirtualPC, VMWare, and QEMU.  QEMU (with KQEMU accelerator, which you don't want to do without).  Here are some notes/issues/resolutions for each:&lt;br /&gt;&lt;br /&gt;I use the VM's to connect to my corporate VPN via Nortel's Contivity client. &lt;br /&gt;&lt;br /&gt;I also took a brief look at BOCHS, but didn't install it.  It seemed that most www chater was all about QEMU.&lt;br /&gt;&lt;br /&gt;VirtualPC 2005:&lt;br /&gt;- Sometimes shared folders in the guest would "isolate" themselves and never update, even though the host had modified contents of the shared folders.  This was a killer for me because I used the VM to do CVS version control within my VPN and my host as the development environment.&lt;br /&gt;- Known issue was found for VirtualPC after applying service pack that stated VPC doesn't run well on laptops with my intel chipset (P4 Centrino w/ Mobile Technology.  The "fix" from Microsoft just ran my PC at full blast to keep the chip from entering power saving modes.&lt;br /&gt;&lt;br /&gt;VMWare:&lt;br /&gt;- No complaints.  Sometimes the mouse pointer gets hosed up and I have to switch from  VM to HOST and back and it clears it up.&lt;br /&gt;- Stable.&lt;br /&gt;- Expensive ($180), which is the killer for me.  No way will I remove that much out of my own pocket.&lt;br /&gt;- Linux 2.6 time sync issue (documented below)&lt;br /&gt;- Wireless networking can only use NAT.  Appearantly an issue with the Linux drivers, not with VMWare.&lt;br /&gt;&lt;br /&gt;QEMU:&lt;br /&gt;- Just installed it on my Linux 2.6 Ubuntu.&lt;br /&gt;- Compiled it from source along with the kqemu performance package.&lt;br /&gt;- First issue -- mouse integration did not work.  Solution: export SDL_VIDEO_X11_DGAMOUSE=0 before starting qemu.&lt;br /&gt;- Networking ran out of the box.&lt;br /&gt;- Linux 2.6 time sync issue (documented below)&lt;br /&gt;- As with VMWare, you can only use NAT due to limitation in the Linux drivers.&lt;br /&gt;- Once I get around to configuring my guest to connect to my corporate VPN, I will be very curious to know if/how folder sharing works.&lt;br /&gt;- NAT networking is pretty slick -- it has its own firewall, dns, and dhcp.&lt;br /&gt;&lt;br /&gt;Here's my startup script for QEMU:&lt;br /&gt;$ cat runqemu.sh&lt;br /&gt;#!/bin/bash&lt;br /&gt;export SDL_VIDEO_X11_DGAMOUSE=0&lt;br /&gt;qemu -localtime -user-net -m 384 -hda winxppro.img&lt;br /&gt;&lt;br /&gt;Linux 2.6 Time/Clock Synchronization issue&lt;br /&gt;I've installed the 2.6 (i686) kernel.  Appearantly a setting in the Linux source changed from 2.4 to 2.6 which affects the way a virtual machine keeps up with the correct time.  The effect was that the guest's clock ran up to 10x warp speed.  You could see this by launching the XP Clock.&lt;br /&gt;&lt;br /&gt;This issue mostly seems appearant in Mobile chipsets, not desktops, but I'm not 100% sure.  The only way I could fix it was by passing "acpi=off" to my kernel during boot.  My GRUB /boot/grub/menu.lst entry looks like this:&lt;br /&gt;title           Ubuntu, kernel 2.6.12-10-686 (VM TRIALS)&lt;br /&gt;root            (hd0,1)&lt;br /&gt;kernel          /vmlinuz-2.6.12-10-686 acpi=off root=/dev/mapper/ubuntuvg-root ro quiet splash&lt;br /&gt;initrd          /initrd.img-2.6.12-10-686&lt;br /&gt;savedefault&lt;br /&gt;boot&lt;br /&gt;&lt;br /&gt;Now my guest clocks stay in perfect sync.  However, power saving features are disabled, which is a bugger.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113407317289427607?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113407317289427607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113407317289427607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407317289427607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407317289427607'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/emulators.html' title='Emulators'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113407100039609956</id><published>2005-12-08T12:42:00.000-07:00</published><updated>2005-12-08T12:43:20.396-07:00</updated><title type='text'>SIMP for Linux</title><content type='html'>I've used SimpLite (&lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.secway.co/" target="_blank"&gt;www.secway.co&lt;/a&gt;) for MSN encryption for conversations.&lt;br /&gt;Since I'm running Ubuntu now, I found that Secway also has a Linux&lt;br /&gt;version.  &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.secway.fr/us/products/simpserver/" target="_blank"&gt;http://www.secway.fr/us&lt;wbr&gt;/products/simpserver/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Simply download, extract to /usr/local/simp and start it up.  By&lt;br /&gt;default, it starts a local socks-4 proxy for MSN on port 11863, so you&lt;br /&gt;have to configure GAIM to use that port.&lt;br /&gt;&lt;br /&gt;Unlike the Windows client, the server version of SIMP must automatically&lt;br /&gt;create keys for you because I didn't have to do anything.&lt;br /&gt;&lt;br /&gt;I created an init.d script as follows to auto start/stop it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#! /bin/sh&lt;br /&gt;&lt;br /&gt;SIMPSERVER=/usr/local/simp/bin &lt;div id="mb_0"&gt;&lt;wbr&gt;/simpserver&lt;br /&gt;PIDFILE=/tmp/simp.pid&lt;br /&gt;&lt;br /&gt;set -e&lt;br /&gt;&lt;br /&gt;case "$1" in&lt;br /&gt; start)&lt;br /&gt;       if [ -e $PIDFILE ]; then&lt;br /&gt;               echo $PIDFILE already exists, not starting server.&lt;br /&gt;               exit 1&lt;br /&gt;       fi&lt;br /&gt;       nohup $SIMPSERVER &gt;/dev/null 2&gt;&amp;1 &amp;amp;&lt;br /&gt;       echo $! &gt; $PIDFILE&lt;br /&gt;       ;;&lt;br /&gt; stop)&lt;br /&gt;       kill -TERM $(cat $PIDFILE)&lt;br /&gt;       rm $PIDFILE&lt;br /&gt;       ;;&lt;br /&gt; reload|restart|force-reload)&lt;br /&gt;       echo $1 not implemented.  just kill and restart it yourself.&lt;br /&gt;       ;;&lt;br /&gt; *)&lt;br /&gt;       echo "Usage: $N {start|stop|restart|force&lt;wbr&gt;-reload}" &gt;&amp;2&lt;br /&gt;       exit 1&lt;br /&gt;       ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113407100039609956?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113407100039609956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113407100039609956' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407100039609956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407100039609956'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/simp-for-linux.html' title='SIMP for Linux'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113407079661532779</id><published>2005-12-08T12:25:00.000-07:00</published><updated>2005-12-08T12:42:00.216-07:00</updated><title type='text'>Ubuntu and Debian Packages</title><content type='html'>Since Ubuntu is a take-off from Debian, it naturally uses Debians packaging tools such as apt-get, to update and configure your system. You may also use the GUI tool, Synaptics Package Manager.&lt;br /&gt;&lt;br /&gt;Here are some useful links and info:&lt;br /&gt;Good info about packages (see CONTENTS for a lot more on using apt* tools): http://www.debian.org/doc/manuals/apt-howto/ch-search.en.html&lt;br /&gt;&lt;br /&gt;Update all installed packages:&lt;br /&gt;# apt-get update&lt;br /&gt;&lt;br /&gt;Install a package:&lt;br /&gt;# apt-get install some-pkg&lt;br /&gt;&lt;br /&gt;See what's installed:&lt;br /&gt;# dpkg -l | more&lt;br /&gt;&lt;br /&gt;Query packages:&lt;br /&gt;# apt-cache search someRE*&lt;br /&gt;&lt;br /&gt;You can convert an RPM file to a DEB package (or to/from other common formats) by using Alien:&lt;br /&gt;$ alien --to-deb somefile.rpm  (will create somefile.deb)&lt;br /&gt;&lt;br /&gt;Some other things to mention -- apt* tools use a local "database" to drive what packages are available and where to get them. Read the URL link above to understand how it works and how to keep it up-to-date so you always know what the latest packages are available.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113407079661532779?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113407079661532779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113407079661532779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407079661532779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113407079661532779'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/ubuntu-and-debian-packages.html' title='Ubuntu and Debian Packages'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19696450.post-113406792573953128</id><published>2005-12-08T11:40:00.000-07:00</published><updated>2005-12-13T16:45:57.160-07:00</updated><title type='text'>Ubuntu Linux 5.10</title><content type='html'>Running Ubuntu (Breezy Badger) 5.10 linux on laptop now. So far, it is great. Only thing I had issues with was my display driver. I have an HP/Compaw nw8240 latop with an ATI FireGL v5000 card. I had to go and download the linux drivers directly from ATI's website and install them and all is well now.&lt;br /&gt;&lt;br /&gt;I downloaded version 8.19.10.  (ati-driver-installer-8.19.10-i386.run)&lt;br /&gt;&lt;br /&gt;The GL graphics are very slow (screen savers and most games are extremely slow in repainting the screen), but other graphics such as window movements, etc are very fast.&lt;br /&gt;&lt;br /&gt;Need to work on DRI support.  Supposedly it gives better results.&lt;br /&gt;&lt;br /&gt;VERY IMPORTANT NOTE: I installed KDE and X went back to the flashy screen.  Even reinstalling the ATI drivers didn't work.  Finally found a configuration utility installed by ATI under /usr/X11R6/bin/fglrxconfig which recreates the xorg.conf file and everything will work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19696450-113406792573953128?l=dustinbreese.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dustinbreese.blogspot.com/feeds/113406792573953128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19696450&amp;postID=113406792573953128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113406792573953128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19696450/posts/default/113406792573953128'/><link rel='alternate' type='text/html' href='http://dustinbreese.blogspot.com/2005/12/ubuntu-linux-510.html' title='Ubuntu Linux 5.10'/><author><name>Dustin</name><uri>http://www.blogger.com/profile/03425150550235186129</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
