Resources For Pitching GitHub Enterprise

Recently GitHub announced GitHub Enterprise, a way to have all of the goodness of GitHub behind your own companies firewall on your own servers. GitHub in general is an obvious win for developers, but when trying to pitch why it’s so awesome to managers, execs, etc I was sort of at a loss as there isn’t currently much on the GHE site as far as features, etc. I reached out to GitHub trainer Matthew McCullough @matthewmccull for some ideas on features that I was not even aware of, and we came-up with a GitHub wiki page which outlines all of the various features we could think of that you would get over plain git hosting by using GitHub Enterprise:

GitHub Enterprise

While this is the only thing I’m aware of to use to help you pitch GitHub Enterprise to your peers and superiors at the time of writing, I plan on this being a living entry and will update it as I’m made aware of more stuff. If you know of other features, please update the Wiki entry above. Also, if you have other resources to use for pitching GitHub, contact me and I will add them to this page.

Posted in Culture, Tips, Hacks, & Tricks, Tools | Tagged , , , , , , | Leave a comment

CFAkismet Has Moved to GitHub

This is just a quick note to mention that one of the first open source projects that I wrote, CFAkismet, the ColdFusion based Akismet client, has finally moved to GitHub. Read more about it’s new location on the CFAkismet Project Page.

Posted in Languages, Site News, Tools | Tagged , , , | Leave a comment

Six Steps For Troubleshooting Instability, Crashes and Freezes In Lion

My primary home machine as of this writing is a 2008 model MacBook Pro, and every since I have upgraded it to MacOS X Lion, I’ve have had nothing but problems with it. I held of on upgrading until iOS 5 came-out, which then needed Lion for iCloud support. I gave in and ended-up spending several months troubleshooting various problems to get my machine back into a usable state.

This blog post is not the end-all authorative information about how to fix instability problems in Lion, it is however a quick guide of things to check if you are an experienced Unix/MacOS user. I don’t outline the steps down to the actions you must perform, it’s just an overview on what you should check. There are no guarantees that any of this will fix your problems, and you should have an expert do this for you if any of this stuff is unfamilliar to you.

Out of all of the things I read about people having problems with Lion, the culprit in at least 95% of the situations was old software interferring with Lion. Given that I have taken my machine from Leopard, to Snow Leopard, to Lion, there were bound to be problems leftover from old software.

The most important thing I have learned in this process is that Lion is not an operating system you want to upgrade to because it has a lot of massive changes in it. Do everything you can to only use Lion from a clean install. I can’t stress this enough. You will spend much less time getting your machine back to a usable state by doing a clean install than you would having to troubleshoot this stuff. In hindsight I’m still at least a little bit glad I didn’t because I learned a lot in the process, and getting Lion usable again has been a frustrating but somewhat rewarding experience.

Now that I’ve got all of that out of the way, here are some of the steps you should do in order to figure out why your machine keeps locking up:

1. Review Log Files

This is the quickest and most valuable step in figuring out what is going on. If you’re lucky, there will be all kind of different traces of badness happening including kernel panics. Google for anything suspicious you see in log files, and fix it if possible.

2. Make Sure Your Hardware Is In Good Working Order

You could actually have some sort of hardware problem that is making Lion crash. Maybe you have RAM that is not working correctly, a problem with your video card, etc. Make sure your hardware is not an issue.

3. Repair Disk & Disk Permissions

This is a pretty good thing to do in general when you are having system problems. It doesn’t take long to run, and it will almost always find something wrong, especially if you are experencing crashes.

3. Update/Uninstall Always Running Applications and Daemons

Are you running up to date software for everything that runs at startup? Some suspects would include software like Little Snitch and Dropbox. This sort of software almost never updates itself automatically, so make sure you are running the latest versions of programs that run at start-up or as daemon processes.

4. Update Frequently Used Applications

What programs do you usually have open when you experience a lock-up/crash? You should probably make sure they are all the latest versions. Run them one at a time and see which one causes Lion to crash.

For me, during troubleshooting I narrowed it down to Google Chrome. I instead ran Firefox for awhile and the crashes went away. Eventually I switched Chrome to the dev channel and it seemed to be stable, but I had already done a bunch of other stuff in the process so no idea if that was actually the fix or not.

5. Remove old Kernel Extensions

This one is kind of nasty and you could end-up really hosing your system. Be very careful while doing this. I ended-up finding a very old Cisco VPN extension from 2007, and well as some library called “Soundflower” or something like that which was also incredibly out of date.

6. Do A Clean Install Of Lion

If you’ve done all of the steps above and are still having problems, I would suggest a clean install of Lion. If you continue to have problems even after a clean install, you likely have a hardware problem.

Honestly I’ve had an almost finished blog post in my drafts folder with a lot of bile and hate for Lion for at least a month or two after seemingly wasting so much time trying to figure out what the problem was. However after running through all of these steps several times to make sure I didn’t miss anything, my old MacBook Pro from 2008 is stable again!

I can’t exactly point my finger at Apple for the problems I’ve had as I would say they were likely the fault of old software. I have certainly not been that happy with them as of late, though.

Posted in Operating Systems, Tips, Hacks, & Tricks | Tagged , , , , , , , , , , , , , | Leave a comment

Coming Out of Hibernation

This site, to some degree, has been online since the first part of 2003. Given that it’s almost 9 years old now, it certainly has some baggage associated with it. Over the past few years I’ve been severely neglecting it; every since I lost a custom theme I’d coded by hand, I just never found one I was very happy with. Also around the same time, I signed-up for Twitter, then left a job I had been at for 4 years to join a startup and things have just been crazy every since between my career and personal life. I have about twice as many followers on Twitter than I do RSS readers of this blog, and it’s time to change that!

The state of my blog has been killing me and it was time to update it. I’ve had the last week off of work and have spent a portion of it ripping the guts out of this blog and replacing them. New theme, almost all new plugins, etc. Other than starting off on a new blogging platform, it’s pretty much been done to this site. I still have some editing and purging of old entries to do, but I wanted to iterate quickly and get something out the door TODAY.

I’m pretty pleased as to how it’s turned-out and plan on trying to blog more frequently. If that doesn’t happen, I suppose I may as well shut it down or rethink it a bit.

Posted in Site News | Leave a comment

Hot Corners Stopped Working on Mac OS X

Like many Mac users, I use hot corners to start my password protected screensaver when I’m ready to walk away from my desk. Seemingly out of the blue, I was unable to use hot corners any longer. I tried changing the settings, added another hot corner, etc, and nothing seemed to work. Finally after much googling I found a thread on apple.com with other people having the same problem. Most of the solutions said to reboot which I didn’t really want to do, but eventually someone else found a way to fix the problem:

a) Open up Activity Monitor (/Applications/Utilities/Activity Monitor)

b) In the search filter type “Dock”

c) Select the item in the list who’s Process Name is “Dock”

d) Click on Quit Process.

The Dock and Expose will be restarted and the problem should be solved.

Give that a whirl and hot corners should start working again for you.

Posted in Operating Systems | Tagged , , , , , | 9 Comments

Running Jetty 7 on Port 80 With Maven

I think Jetty is one of the best kept secrets in the Java world, in particular for getting a quick container up and running with full integration with Maven for local testing of Java based web applications. I was doing a non-stock configuration of Jetty 7 and Maven today which took way too much Googling to get working (mostly to custom configure the connector), so I thought I'd document the process for those looking for the same thing. If you're looking how to get Jetty 7 working on Port 80 (particularly on Linux or OS X) with Maven, you're in the right place. As of the time of writing, the latest stable release of Jetty looks to be 7.1.6.v20100715.

The three minor hurdles to configuring Jetty 7 and Maven are making sure port 80 is not already taken, getting the right connector implementation configured, and running Maven as sudo so that Jetty has permission to run on Port 80. In OS X, you can see if anything is already running on port 80 by running the following command from Terminal:

CODE:
  1. sudo lsof -i -P | grep -i listen

If you're on OS X and see something running on Port 80 yet you didn't install a webserver, chances are it's Sharing. Go to System Preferences > Sharing and disable it. Otherwise, figure out what process is running on port 80 and make it go away.

Now to configure the Jetty Maven plug-in, here is what my configuration looks like which you should replicate in your pom.xml under the plugins section (and adjust to your particular directory structure and desired context):

CODE:
  1. <plugin>
  2.     <groupid>org.mortbay.jetty</groupid>
  3.     <artifactid>jetty-maven-plugin</artifactid>
  4.     <version>7.1.6.v20100715</version>
  5.     <configuration>
  6.         <connectors>
  7.             <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
  8.                 <port>80</port>
  9.             </connector>
  10.         </connectors>
  11.         <webappsourcedirectory>${basedir}/resources/war</webappsourcedirectory>
  12.         <scanintervalseconds>10</scanintervalseconds>
  13.         <webappconfig>
  14.             <contextpath>/</contextpath>
  15.         </webappconfig>
  16.     </configuration>
  17. </plugin>

One of the difficulties I encountered was getting the connector working correctly. Since Maven has moved to be an Eclipse project, the package structure for the connector has changed and thus the reason most of the existing documentation on getting custom connectors to work did not work for me.

The last remaining hurdle to overcome is that running a standard “mvn jetty:run” doesn't work on OS X (and likely Linux as well). You'll see the error message “Embedded error: Permission denied”. If you run Maven with error stacktraces enabled, you'll see an exception that looks like this:

CODE:
  1. [INFO] Jetty server exiting.
  2. [INFO] ------------------------------------------------------------------------
  3. [ERROR] BUILD ERROR
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Failure
  6.  
  7. Embedded error: Permission denied
  8. [INFO] ------------------------------------------------------------------------
  9. [INFO] Trace
  10. org.apache.maven.lifecycle.LifecycleExecutionException: Failure
  11.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
  12.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
  13.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
  14.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
  15.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
  16.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
  17.     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
  18.     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
  19.     at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
  20.     at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
  21.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  22.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  23.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  24.     at java.lang.reflect.Method.invoke(Method.java:597)
  25.     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
  26.     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
  27.     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
  28.     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
  29. Caused by: org.apache.maven.plugin.MojoExecutionException: Failure
  30.     at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:462)
  31.     at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
  32.     at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:577)
  33.     at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
  34.     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
  35.     ... 17 more
  36. Caused by: java.net.SocketException: Permission denied
  37.     at sun.nio.ch.Net.bind(Native Method)
  38.     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
  39.     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
  40.     at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:209)
  41.     at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:289)
  42.     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
  43.     at org.eclipse.jetty.server.Server.doStart(Server.java:253)
  44.     at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:67)
  45.     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
  46.     at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:437)
  47.     ... 21 more

This is because you need elevated permissions to run applications on lower ports on *nix based systems. Simply run it as sudo, “sudo mvn jetty:run” and you'll be good to go.

Not a terribly tough problem to overcome on your own, but I thought I'd try and try to save someone some time if they run across the same issues.

Posted in Culture, Languages, Operating Systems, Servers, Tips, Hacks, & Tricks, Tools | Tagged , , , , , , , | Leave a comment

The Most Efficent Way to Increment A Map Value in Java

Finding myself in a situation of needing to increment values in a map in Java, I was curious to see what the most efficient way to do so. Said piece of code will be looped over thousands of times and I wanted it to run as quickly possible. Yes, I know that pre-optimization is the root of all evil, but in this case it was something I needed to be conscious of.

I found a question/thread on StackOverflow where someone else had already pondered the same thing and got a long list of possible answers to compare to each other, including using Apache Commons and the Google Collections Library. After testing all of them, the fastest way ended-up being implementing a "MutableInt" class and using it as the value data type in the map:

CODE:
  1. class MutableInt {
  2.   int value = 0;
  3.   public void inc () { ++value; }
  4.   public int get () { return value; }
  5. }
  6.  
  7. Map<string ,MutableInt> map = new HashMap<string ,MutableInt>();
  8. MutableInt value = map.get (key);
  9. if (value == null) {
  10.   value = new MutableInt ();
  11.   map.put (key, value);
  12. }
  13.  
  14. value.inc ();

Pretty interesting stuff! Note that the above code snippet is not very cleanly formatted, but you'll get the idea.

Posted in Culture, Languages, Tips, Hacks, & Tricks | Tagged , , , , , , | 6 Comments

Fixing Remote Desktop in Snow Leopard

After upgrading to Snow Leopard on my MacBook Pro, I only found a couple of minor issues which were easily fixed. One of them was Microsoft's Remote Desktop Client crashing at startup when I ran it. Luckily the fix was very simple-- I simply downloaded the latest version from Microsoft and installed it again. If you're having problems with Remote Desktop in Snow Leopard, give it a try!

Microsoft Remote Desktop for OS X

Alternatively, you can also try downloading CoRD, an open source Remote Desktop Client and installing it. It seemed to have trouble connecting to my Windows XP workstation for whatever reason, but that doesn't mean it won't work for you of course.

CoRD

CoRD is a Mac OS X remote desktop client for Microsoft Windows computers using the RDP protocol. It's easy to use, fast, and free for anyone to use or modify.

Posted in Culture, Operating Systems, Tips, Hacks, & Tricks | Tagged , , , , , , | 10 Comments

Using Spring and Hibernate With JPA And Entity Interfaces

I'm currently setting up a new Hibernate project and finally getting around to trying out JPA annotations instead of using any Hibernate configuration or mapping files-- what the hell took me so long!!??! Anyhow, among the many gotchas I came across, one was how to deal with using Interfaces with Hibernate entity beans and associations.

When you declare an association to a Hibernate Entity with an Interface without using the correct annotation syntax to point Hibernate at the implementing class, you will likely see exceptions like this while running JUnit 4 tests in Eclipse:

CODE:
  1. java.lang.IllegalStateException: Failed to load ApplicationContext
  2.     at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:201)
  3.     at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
  4.     at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
  5.     at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:255)
  6.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:111)
  7.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:148)
  8.     at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
  9.     at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
  10.     at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
  11.     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
  12.     at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
  13.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
  14.     at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)
  15.     at org.junit.runners.Suite.access$000(Suite.java:26)
  16.     at org.junit.runners.Suite$1.run(Suite.java:93)
  17.     at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
  18.     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
  19.     at org.junit.runners.Suite.run(Suite.java:91)
  20.     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
  21.     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  22.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
  23.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
  24.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
  25.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
  26. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geoSessionFactory' defined in class path resource [com/peerdigital/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.peerdigital.geolocation.model.DefaultCountryEntityImpl.regionEntity references an unknown entity: com.peerdigital.geolocation.model.DefaultRegionEntityImpl
  27.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
  28.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
  29.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
  30.     at java.security.AccessController.doPrivileged(Native Method)
  31.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
  32.     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
  33.     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
  34.     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
  35.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
  36.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
  37.     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
  38.     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
  39.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
  40.     at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
  41.     at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:42)
  42.     at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:173)
  43.     at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:197)
  44.     ... 23 more
  45. Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.peerdigital.geolocation.model.DefaultCountryEntityImpl.regionEntity references an unknown entity: com.peerdigital.geolocation.model.DefaultRegionEntityImpl
  46.     at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:81)
  47.     at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:456)
  48.     at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:438)
  49.     at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:309)
  50.     at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
  51.     at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:673)
  52.     at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
  53.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
  54.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
  55.     ... 39 more

Most of the solutions I saw made you create a duplicate persistence.xml that had all of the same information in it which seemed silly to me. Eventually with the help of Google I came across the answer somewhere (which I no longer have around) which was to modify the field annotation to point at the class which implements the Interface:

CODE:
  1. @ManyToOne(targetEntity = DefaultRegionEntityImpl.class)
  2. @JoinColumn(name = "region_code_fk", referencedColumnName = "region_code_pk", insertable = false, updatable = false)
  3. private RegionEntity regionEntity;

One other thing to check-- make sure your @Entity annotation is importing the JPA annotation (javax.persistence.Entity), and NOT the Hibernate annotation (org.hibernate.annotations.Entity). If you import the Hibernate @Entity annotation it will not find the entity bean.

Hopefully that's of some help to someone. Just a quick post-- back to work I go!

Posted in Frameworks, Languages | Tagged , , , , , | 2 Comments

How To Install Dig in Ubuntu Linux

One tool I'm used to having without installing (it's included by default in FreeBSD) is Dig (which is short for Domain Information Groper). Dig is a really handy tool for checking and troubleshooting DNS related issues once you learn how to use it. For instance, it makes it easy to see how your MX records are resolving:

CODE:
  1. # dig google.com mx
  2.  
  3. ; <<>> DiG 9.3.2-P2.1 <<>> google.com mx
  4. ;; global options:  printcmd
  5. ;; Got answer:
  6. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41334
  7. ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
  8.  
  9. ;; QUESTION SECTION:
  10. ;google.com.                    IN      MX
  11.  
  12. ;; ANSWER SECTION:
  13. google.com.             10212   IN      MX      10 smtp3.google.com.
  14. google.com.             10212   IN      MX      10 smtp4.google.com.
  15. google.com.             10212   IN      MX      10 smtp1.google.com.
  16. google.com.             10212   IN      MX      10 smtp2.google.com.
  17.  
  18. ;; Query time: 1 msec
  19. ;; SERVER: 208.67.220.220#53(208.67.220.220)
  20. ;; WHEN: Sat Nov  8 02:56:08 2008
  21. ;; MSG SIZE  rcvd: 116

Luckily this is easy to install, just not terribly intuitive or easy to find as it's not a package known as dig:

CODE:
  1. # sudo apt-get install dnsutils

That's pretty much it-- you should now be able to use dig!

Posted in Culture, Operating Systems, Tips, Hacks, & Tricks, Tools | Tagged , , , , , , | 4 Comments