Thursday, September 19, 2013

Small Side Project

The other day, while on lunch, I decided to write a quick bash script to determine the IP of my machine.   For the first incarnation of this script, I chose Bash as it is just a quick and dirty way to achieve my goal.  
Well, after working on it for a little bit on my Linux machine, I looked to my right and saw my Macbook sitting next to me.  Being a *nix backed OS, I decided that the script also needed to support it, as well.  What the heck, why not throw Solaris into the bunch as well, seeing as I also have access to a Solaris machine.
Once I decided to take a break, I created a new repo up on Github to host the project, created a license and readme file and got my script checked into the repo.  Shortly after I put up a facebook post about the new repo, a colleague downloaded it, tested it and quickly posted a suggestion for improvement.  
I will be the first to admit that my initial design was a bit short-sighted and didn't take into account interfaces that were not active.  
I quickly went about a re-design to determine which interface(s) were active, and report their IP's.  After getting the script working as hoped on Mac, I turned my attention to Linux and Solaris.  I quickly realized that when dealing with servers, you will most likely have multiple active interfaces, including virtual (vnet) interfaes. 
Sitting here writing this, I think I may simply report each one, and also print the interface name in the output, which is currently not done.  The code is a work in progress, so if you are interested, please stay tuned and watch the updates flow.  
As always, if you have any suggestions for script improvement or if you find any bugs, please open an issue through the project on Github.  

Thursday, September 05, 2013

Effing ARGH!!!!!

Let me just say how painful it is when you have been pouring tons of time into a pet project that you feel strongly about, and that you had a "grand plan" for, only to literally stumble upon another site that has already implemented the idea.  ARGH!!!!!

My idea was to be a nutritional information site.  It would cover not only standard foods and processed foods from your grocery store, but also the food at restaurants.  I wanted this thing to be the one-stop-shop for anyone conscious about their health and what they eat.  

One of the main reasons this is near and dear to me is that I am a Diabetic, and earlier this year changed my entire eating style to be Paleo.  Its been an amazing journey thus far and I wanted this site to be the nutritional information bible.

Well, while downloading restaurant nutritional information last night, I noticed that one of the PDF's was not hosted at the restaurant's site, but instead another site all together.  I went to the root url only to discover that this site, where the info was hosted, already provided what my site was going to provide.  And on top of that, it was pretty slick.  A friend suggested I use their data as my source and make a better site, but to be honest, it wouldn't be right.  Yes, I am one of those honest people and believe in doing the right thing.

You can say 'C'est la vie'..... move on..... whatever you choose, but it doens't take the sting out of the fact that I feel robbed and completely screwed over having been totally beaten to the fully implemented concept.  

I am going to just have to ensure that the next idea that I have gets to fruition quicker, before someone else does it.

Monday, September 02, 2013

Do My SSL Keys Match Up?

Recently, at my day job, we had an issue where the SSL certificate that we had in place for one of our URL's, was expiring and needed renewing.  One of my colleagues had renewed the certificate, but did not have time to install it immediately.  So, the day that its expiring we had to do a bit of scrambling to get it replaced on the server.

So, having been given this task, I logged on to the server and noticed that the public key, signing keys and private keys were all put into the same directory.  Cool, I don't have to figure out where to put them.  So, I downloaded the certificate bundle from our issuer and unzipped it.  It was then that I realized that the bundle only contained the public key and the signing certificate(s).  

So here I am, with the new key and no private key.  Plus, looking on our issuer's site, there was no way to tell what private key was used.  Thus became my quick search of the Googles to determine how to compare a public key with a private key to see if they are a pair.  

If you have manually created SSL certificates before, then you should already (hopefully) be familiar with the openssl software.  Thankfully, that software can also be used to pair up public and private keys.

In order to match up two keys, you need get some output from the keys themselves.  On the public key, you want to run the following:

openssl x509 -noout -text -in cert.crt
You will then want to run the following on the private key that you suspect may match up:

openssl rsa -noout -text -in cert.key
As part of the output of both of those commands you will see a section called "Modulus", which looks something like this:

Modulus (4096 bit):
                    00:e4:86:e3:fb:49:07:1d:a6:11:df:3b:1f:d8:1b:
                    65:c8:97:06:28:fa:73:d2:bc:d2:05:94:b3:f3:0d:
                    69:6d:ae:fa:80:a5:4d:63:6f:bf:1e:62:67:fe:3d:
                    be:96:ab:17:25:87:b5:ac:04:15:70:20:e7:d3:0b:
                    e3:fe:99:53:eb:10:60:2e:48:a2:0d:00:de:9c:c4:
                    7c:79:f4:ff:66:e7:40:37:2a:4a:7c:93:8a:af:66:
                    17:f1:04:60:94:c7:62:86:83:e0:1f:28:b8:4d:8e:
                    dd:30:59:47:76:ba:b9:60:b5:a7:2a:af:1d:be:2c:
                    bb:1f:58:6d:56:f0:36:a4:72:f7:1b:9e:c9:f6:57:
                    99:e2:3d:3a:7b:db:9a:2d:50:47:3f:3e:15:27:5a:
                    b2:fe:84:4b:4d:68:a7:ca:32:6d:4c:59:1a:a4:74:
                    39:f0:f3:10:a8:fa:9f:de:cb:4f:c8:b1:86:24:aa:
                    01:48:32:8b:e9:06:1f:71:43:2d:64:1a:30:73:d3:
                    7c:9f:46:f9:17:59:1a:db:0b:fa:a3:49:b0:56:90:
                    e5:37:79:42:35:05:24:e5:82:80:59:4c:16:94:3f:
                    9c:d3:d3:f5:ea:03:87:d6:5f:c8:23:1a:08:9c:43:
                    78:be:7d:98:a0:e0:82:05:74:de:1a:bb:4a:2e:d6:
                    a3:cd:70:24:a3:5d:05:06:a6:28:2c:f8:75:2d:61:
                    34:28:a6:44:69:b6:f8:cc:ea:9d:f1:97:35:3c:cd:
                    46:b5:69:e6:7e:7d:a5:07:7d:cb:bc:98:d1:80:18:
                    f9:87:fa:d8:db:c7:42:4d:93:54:36:4b:83:45:0c:
                    79:b3:0f:1c:28:e1:f7:92:0b:56:86:f2:17:80:55:
                    fe:31:67:c9:31:5c:7b:87:d2:ea:ea:a8:38:0e:b1:
                    37:68:ef:a1:d1:be:a1:69:8e:37:45:bb:96:b7:9d:
                    27:1e:a9:d5:6a:be:36:a8:20:ae:ab:4f:5e:a1:40:
                    f6:92:57:17:ff:68:c6:9b:4e:ee:d1:2f:47:b9:9f:
                    9c:be:4b:21:ad:20:a7:12:38:89:2b:12:0e:62:cc:
                    44:65:e7:af:31:fe:ba:c7:e7:60:e3:cc:65:b2:91:
                    15:73:2c:d7:17:95:53:f9:d6:f8:6a:4c:3c:5a:62:
                    c7:5b:c9:2b:52:37:66:ec:56:be:4a:75:49:0b:9e:
                    32:a1:e3:62:0a:a3:de:3a:a5:00:03:d8:01:79:df:
                    9b:46:1f:44:a2:06:71:28:0d:8a:61:00:5c:7f:5a:
                    0c:37:c0:dd:dc:3b:80:a1:b7:ad:df:1d:08:fa:95:
                    f8:35:42:3f:4c:e6:8e:f3:94:12:d6:83:63:84:63:
                    89:bb:61 

What is really nice is that if they are the correct pair, the modulus of both keys will be identical.  To finish my anecdote regarding work, I got lucky and the first key that I chose (which was the private key previously used), ended up being a match, proving that they new key was generated using it by our provider.  

I hope this has helped someone find their long lost matching keys.  

Saturday, August 17, 2013

Easy CD Ripping on Mac OSx

As we all know, there are a plethora of applications out there to rip music cd's to mp3 format.  All of them have some kind of learning curve, as well as learning to configure them properly, not to mention, some of the better options will cost you a few $$ out of pocket if you want to use them. 

In this post, I will show you how to easily configure your iTunes software to import a music cd and convert it to MP3 on the fly.  The only limitation that some will skoff at, is that it only seems to support up to 192kbps.  For me, this is not an issue as I tend to use 192 by default.  I have found the higher rates above 192 don't always play or are sketchy when playing, but that's just my observance.

For these instructions, I am using iTunes 11.0.4 on OSx 10.8.4.  If you are using something different (including Windows), your going to have to figure out where to go.  Hopefully it won't differ to greatly.

The first thing you will need to do, after putting your cd in you Mac and selecting it from the source drop down menu, is to go to iTunes->Preferences in the top menu.   When the window appears, you will need to be in the General tab. On that screen, look for the section called "When you insert a CD:"  Here is what it looks like.


Once you found the above, you will click on 'Import Settings'.  The new window that opens will look like this:


In the above, you will want to set your settings as shown.  The 'Import Using' setting is important for the conversion to MP3.  After changing the settings, hit "Ok' to save them. 

When the tracks are converted to MP3, iTunes will save the files to the designated 'iTunes Media folder location'.  You can find out what this is, and even change it, on the 'Advanced' tab.  Once you are done, hit 'Ok' to go back to iTunes.  

The only thing left is to click on the 'Import CD' link in the upper right corner of the iTunes window.  This will begin the import and conversion of the files.  Believe it or not, its not that awful and only takes a several minutes per CD to rip all of the tracks.  

I hope this tutorial provided what you needed to rip mp3s with iTunes.  

Issues/Bug Tracking Software

I recently started working on a software project during my companies recent Hackathon.  While I ended up getting a good chunk of the application completed (ok, the initial configuration script and the first part of the app itself), I see an immediate need to track both needed enhancements and bugs/issues.

I did a quick search and found a Wikipedia page comparing the different issue tracking systems out there.  Some of my requirements are:
  • It must be FREE!
  • Support for git (as that's what I am using for my versioning)
  • Python based (because Python rocks!)
  • Not hosted.  I want to host it myself.  ( I'm a control freak)
  • An option for OpenID login would be sweet.
  • Ability to lock it down securely.
I know, its not a terribly long list, but its not short either.  Unfortunately, my options are quite limited, due in no small part to my Python requirement.  After looking at the options, I am currently looking at Trac (quite popular) and Apache Bloodhound.   Before you say it, Launchpad is python based, but unfortunately appears to be a hosted solution.  

In comparing the two potential choices, I have decided to go with Trac.  I did some research on their site (and through the Googles), and there has been plenty of additions made to the project.  For instance, someone implemented pastebin support in Trac using a Python module called ClueBin.  That is SWEET in my opinion.

Update:  Thankfully, I quickly realized something I overlooked in my decision.  That was the need for support for multiple projects.  I know, I didn't list that above, but an issue tracking system that only supports one project is quite tunnel visioned.  Trac claims that people have modified the application to add support for multiple projects, but at the point that I am at, I am in no place to take on that modification.  So, it looks like Apache Bloodhound is going to get my current vote and i will update after I have it installed and have used it for a bit.

Sunday, July 14, 2013

Adding Desktop Spaces in OSx 10.8.x

This is one of those things that is different between earlier versions of OSx and the current version.  To be honest, I find it much easier in today's version than it was earlier.

In the earlier version's of OSx (I am not really sure of which version it was changed), you would go to System Preferences, and under Personal there was an item called "Expose and Spaces", where you would configure your desktop spaces.

Now, with the advent of gestures making it a bit quicker to do certain things, like switching desktop spaces, you can also add desktop spaces.

How?  Using what is called the "view Mission Control" gesture, where you use 3 fingers together and drag them upwards on the mouse pad, you are presented with a display of your desktops and your running applications.  You can drag your apps to different desktops from here.  If you bring your cursor to the upper right corner, a "+" sign will appear.  Click it and it will add a desktop to your spaces.  If you happen to add one to many, or want to reduce the number of desktop spaces you have, then simply hover over the desktop(s) you wish to get rid of and an "X" will appear in its upper left corner.  Simply click the "X" to get rid of the desktop space.

For those that are somewhat new to OSx and are not totally comfortable with gestures and want to learn, Apple has provided some quick videos.

I hope this helped.

Wednesday, June 05, 2013

Setting Up BitTorrent Sync

A New Toy

On April 23rd, BitTorrent Labs announced a new offering called BitTorrent Sync (btsync here after for short).  The project was quickly adopted by users and within 2 weeks, a Petabyte of data had been synced by users, between their devices.  That is an amazing amount of data!

My Issue

Personally, I have been using DropBox for quite some time and have a plethora of files stored in my account.  So much, that I needed to make room for other things that I need to store.

The Setup

I had thoughts of documenting all of the steps that I took to get btsync installed and running on my 2 systems, but in lieu of re-documenting everything, I figured that I would share the tutorial that I followed for my installation.  

While Bittorrent does have documentation on the main site, I found the above tutorial a much better guide to follow for the setup process.

What stinks is there isn't any man page or help guide for the btsync command.  But, thankfully you can do the following to get the usage statement:

  btsync --help

and that will print out what the options are for the command.  The setup is pretty straightforward with very little, on your own hacking (even though there is nothing wrong with a little bit of that.











Thursday, May 30, 2013

"Change My Name Please", begged the Mac OSx Machine

I ran into a small issue where my laptop and my machine at work had the same name (yes, I liked it and ended up overusing it).  When I first logged on to the network at work, my machine name on my laptop was "auto-changed" to have a suffix of '-2'.  I found it odd, but accepted it.... temporarily.

I recently made a conscious effort to fix my naming scheme, and have since done so.  In case you have a Mac and don't know how, here is the command to use if you want to change the hostname of your machine.

First, open up the Terminal app and enter the following:

    sudo scutil --set HostName .local

The portion should be replaced with the new name you want for your machine.

I recommend that you nail down your own machine naming scheme prior to haphazardly naming your machines on the fly.  But in the event this happens, you now have the knowledge you need.

Saturday, February 16, 2013

Frayed...... No more!

I posted a short time ago that I had re-entered the job market thanks to the company that I work for eliminating my position.  To recap, they notified us (my entire group) back in October 2012.  I was given my notice and a termination date in mid January that would terminate my employment in April.

I have to admit that prior to the bombshell they called an announcement, I had been looking around at jobs and had been on a couple of interviews over several months prior.  It was only a casual looking as I was employed.  Once we received the news that casual looking turned to an all out assault into the job market to find my next job.

It took a little while, but I am quite proud to announce that I FOUND A JOB!!!!!!  I was beginning to get in the mindset that I wasn't good enough and wouldn't find anything, but I have to say the two interviews that I went on felt really good.  The company is amazing and still in start-up mode, so its in the process of growing and expanding.

I have 4 days of work left and I will be done with the employer who apparently didn't want us around any more (maybe some day I will expand on that vague idea).  The good news is that I am employed, joining an amazing company and plan on getting my head right into the job.


On a side note, I found out something about the way my current employer is going about their 'moving of positions', that is really just disgusting and underhanded.  From what I found out, if you terminate or lay off a certain number of employees, it must be reported to the Federal Government and counted among the unemployment statistics.  The media then get hold of the news your doing layoffs and that can really worry people and even effect your stock price in some cases.

So what is my current company doing?  They are doing the terminations / position moves in small groups that fly juuuuuust under the Federal radar.  Thus, they can move the jobs and terminate the positions (knowing most won't relocate) and they don't have to report it.  They are actually working to shut down the site where we are, so the fact that they are doing it in small chunks and nobody will be none the wiser that all those people were laid off and the site closed, is just wrong if you ask me.

I just hope that in the long run, the choices they are making as far as staffing to replace many years of talent and experience, come back to bite them in the a$$!  The look at the numbers and don't give a crud about the people and their experience.  It goes to show that in large corporate America, nobody is safe, no matter what.

Sunday, February 03, 2013

Thoughts on Pinguy Linux

Ever since Ubuntu has completely switched to its Unity desktop (which I have to say I am not at all pleased with), I have been looking around at some different distributions.  Some have been ok, some have been quickly removed from my system (mostly for lacking any thought by the person who put it together).

Today I discovered a link to Pinguy Linux while going through the headlines on Hacker News.  A quick read of the description peaked my curiosity, so I downloaded a copy via their Torrent link.  I have to say that it was nice to see my download hit 3.4 Mb / second as the download finished in a matter of minutes.  I then created a virtual machine and installed the distribution into it.

The installation went pretty quickly and I was up and running in only a matter of about 10 minutes.  First impressions are quite important when you are trying to make a difference and this one did not blow me away.

After everything started up, I noticed that there is a dock on the left side of the screen containing folders.  Maybe its me just being picky, but I didn't want it there.  The unfortunate thing is that I couldn't figure out how to get rid of it.  For me, this was strike one. The system status app that auto runs is actually nice, keeping the user informed of processes, ram used, disk space, etc.

The next strike came when I started going through the Applications menu.  While there were plenty of apps for multimedia and such, there weren't any development type apps. I know its not a requirement for everyone, but nothing?  That wasn't the strike though.... it was when I scanned down to the wine applications menu, scanned over a couple of levels to find that Microsoft's Notepad had been installed by default.  Really?  Notepad?  I am on a Linux system that has plenty of editors available to it.  Why on Earth would I want an inferior product like Notepad?  (I say inferior, mind you, as a sign of its lacking any features, not as a slam to Micro$oft).

As I was browsing around, I noticed that the background kept changing.  They had pre-setup a rotating desktop background that cycled through pre-installed pictures. Why?  That takes up system resources that could be used for greater good.  And, when your running in a virtual machine as I am, you haven't allocated a ton of ram to begin with.  So, for me that was strike three.

All in all, if your on a fixed system, not in a Virtual Machine environment and you don't mind some of the quirks and "features" I have described (and your a multimedia geek), then maybe this is for you.  For me though, I am removing it and moving on to the next one.   The closest I have found for a distribution to switch to is Linux Mint.  We shall see though..... we shall see.
 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.