Another Microsoft Product Bites the Dust – At Least for Me

To anyone who has received an obvious hacked account email from me, sorry.  I am finally moving to GMail.  The reason – a better 2 factor authentication.

Such a simple thing that they could have implemented and I would have been happy for them to index my data, purchasing habits, and connections all day long.  I had never moved over to GMail (though I had an account) because (a) I don’t want to give Google everything.  They have to work for it a bit, (b) I actually like the interface, especially when they moved to outlook.com, and (c) they were the incumbent.  I had a hotmail account before hotmail was bought up by Microsoft and I didn’t mind it.

But now that I’ve been hacked twice in 2 months, I’ve learned my lesson.  After the first attack, I moved all of my contacts out of hotmail.  They used the contact list to email everyone.  I figured if I could just keep that separated, there would be less problems.  I use an Android phone at home anyways, so most of my contacts were in Google already anyways, so I just left it there and would reference it occasionally.  After the first attack, though, I changed the password to something that would never be hacked.  I use a password generator that creates extremely hard to remember and use passwords.  After I got hacked the second time, I checked how secure my password really was.  It was pretty solid.  The password, based on this webapp would take approximately a century for a standard computer to crack.  That seems reasonable, right?  Apparently it’s not enough.

Truthfully, if you were to throw Amazon EC2 instances at it, I could see it taking a matter of hours to crack it instead of days, but that’s a lot of money for my insignificant emails.  But after the second one, I noticed something interesting – they weren’t originating from my server.  Someone had hacked into Microsoft’s system – somewhere in the middle.  Looking at the IP addresses that were sent from previous emails and the IP addresses that was used sending the bad emails, it looks like there is a disconnect somewhere in the Microsoft network.

Now, I could totally be wrong and they could be doing something totally different.  But you know what?  My 16 character password was hard enough to remember. Microsoft has finally implemented 2 factor authentication, but is it too little, too late?  Also, you can’t control it very well yet in their system, so it looks like if you want to revoke privileges, it is for every device you have or none at all.  Seems like something they should work on.

I implemented it anyways, just so I could feel safe about forward along to my Gmail account.  It was mostly me, but at least partially you.  Well, Microsoft… so long, and thanks for all the fish.

Making your Git Diff/Merge More Useful

OK, it is understood that you should try to keep your commits small in git, as well as other content versioning systems, but sometimes, you have to refactor or have a branch that won’t die.  Unfortunately, the merge process gets really painful.  Depending on what you are merging, this can sometimes be made much easier.  For example, if you are coding, the default line-by-line compare kinda sucks.  So I did a bit of research with my buddy, David Souther, to find out how to make this better.

Patience algorithm

The first algorithm is called the patience algorithm, which is documented visually here.  It’s basically searching for matching full lines to find points that haven’t changed.  This is useful, because if you are programming an API, this is likely to change less frequently than the code inside the API.

Histogram Algorithm

This is the one that jgit uses by default.  Eclipse, in turn uses the egit plugin, which uses jgit under the hood.  So basically, Eclipse uses this by default.  I attempt to stay out of the IDE as much as possible these days though, so I’d rather this be run on the command line.

Myers Algorithm

There is also a third, only sometimes useful one called Myers algorithm, which is a basic greedy algorithm.  It can sometimes be useful when you know that your code is in large runs in particular section.  More info here.

Testing it out

To test these out, anyone can do the following to see the default compare of a file and the last change in its history:

 

versus the following, which will run the patience algorithm:

 

Keeping the Change

You get the general idea.  Just adjust the algorithm with the “–histogram” or “–myers” flags.  If you want to keep a particular one, run “git config –global diff.algorithm patience”, which will save this as your default git diff algorithm.

Bash and Zsh Shortcuts

I’m not going to beat you up with the benefits of using zsh over that of bash. You really should know both, since bash is everywhere. Zsh is the newer version that is a powerhouse, though. So if you should decide to use this, I suggest checking out the program oh-my-zsh, which gets all of the common shell configurations set up for you and keeps it up to date.

But, what I really wanted to share was a good reference for bash/zsh shortcuts.  There are others out there, but they seem to be incomplete.  If I’ve missed anything, let me know and I’ll add it.

Command What it Does
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + F or → Forward one character.
Ctrl + B or ← Backward one character.
Meta + F (in OSX this is ESC, F or ALT+ →) Move cursor forward one word on the current line
Meta + B (in OSX this is ESC, B or ALT+ ←) Move cursor backward one word on the current line
Ctrl + P or ↑ Previous command entered in history
Ctrl + N or ↓ Next command entered in history
Ctrl + L Clears the screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Lets you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Kill the line after the cursor
Ctrl + Y Yank from the kill ring
Ctrl + _ Undo the last bash action (e.g. a yank or kill)
Ctrl + T Swap the last two characters before the cursor
Meta + T (in OSX this is ESC, T) Swap the last two words before the cursor

 

Update 7/22/2013 – My buddy David Souther liked this one so much he created a little worksheet from it and added some sed commands.  It’s great for a reference.  Check it out here!

Beer Brewing – A Beginner’s Guide to Extract Brewing

This information is readily available around the internet.  Home Brewing has become a regular pastime of tons of people in the US.  Unfortunately everyone who gets into it ends up getting really heavy into it and forgets that folks that are just learning aren’t going to understand what they are talking about.  So I thought I would put a quick cheat-sheet together for those just getting into home brewing.  If you want to learn more of the advanced concepts and techniques, please check out the brewing or homebrewing article on Wikipedia and start checking out the many blogs out there.

 

Definitions:

Yeast
A single celled fungus.  These little guys are the most important part of brewing.  Everything we do is to make them happy. Since there are different thousands of kinds of yeast (at least), it is important that you buy the yeast from a brewers supply to make sure that you get a reasonably pure batch.WortA sugary liquid extracted from the mashing process.
Malted Grains
Germinated grains (e.g. started growing) that have been dried (which stops the growing process) with hot air.Malt ExtractFor the most part, in home brewing, this refers to malted grains that have been turned into a syrup or a powder, which contains all of the sugar that your yeast should need to eat during the fermentation process.
Hops
Come in many forms, such as pellets, plugs, and fresh whole flowers.  These are a close relative to the help plant that provide resins that Impart bitterness (using alpha and beta acids) and aroma to your beer.  These are not readily water soluble.
Alpha Acid
Heat and boiling (called isomerization) allow these types of acids to become soluble in water, which is why you steep the brew.  The more alpha acid a certain type of hop contains, the more bitterness it imparts to the beer.  The amount of alpha acid is usually listed on the package of the hops.
Beta Acid
It is important to use fresh, unoxidized hops to extract the small amount of beta acids available.

Continue reading

The hope that the Cable Company Regime might Die (Google Fiber, Aereo, and Senator McCain)

In some ways, law and politics is a game. Most of the time the big bullies push around everyone, but these days, things are changing.

I shared this with friends, but thought it merited sharing with the world. It’s funny because it’s true.

Google Fiber

Google Fiber not long ago announced that it is releasing another couple of zones. After a successful attempt with Kansas City (in both Kansas and Missouri), it is expanding. Lucky bastards in Austin.

For those who haven’t been paying attention to the Google Fiber thing, it’s interesting stuff. For $300, you get internet for 7 years at current cable provider speeds. Or, for the same overpriced amount you pay your cable provider for cable television and internet (~$120), you get the same cable package, plus internet that ranges from anywhere from 200 to 1,000 times faster (depending on your current internet speeds).

Yup, you read that right. 1,000 times faster.

It’s insane. It’s groundbreaking. And it’s going to happen, whether the cable providers want you to do it or not.

Aereo

From a cable spokesman, they “expect that you don’t want faster speeds because you haven’t asked for it.” Except in my area, where FIOS exists and people buy homes in the right areas just so they can get the Fiber Optic speeds, which are far below that of the Google Fiber project.

I would love to be able to buy HBO or TNT, but don’t want to buy ESPN. I support one product and not the other. But, since the cable companies and cable content providers are working in collusion and the cable companies are operating within state supported oligopolies, we are forced to take what they give us. What they give us is packages so that they can maximize their profits and advertisements.

Things like this give us options that are legal. Technically, the current regime is the one that is breaking the laws (spelled “Legal Monopoly”) with congressional support.

I would like to have local channels too, but don’t want to pay for the antenna or get up on a roof, even if that is able to happen. Plus, I don’t want to buy all of the equipment (slingbox, dvr, etc) to do this. I can, but I don’t want to. A fun new service called Aereo provides this service for you. They basically set up a an antenna, a dvr, and a slingbox, and give the control to you.

People and cable companies are up in arms over this. Everyone is screaming “Thief!” And when I say everyone, I mainly mean content providers and cable companies. Why? Because they have a nice little cash cow that they don’t want to see end. So what do they do? They take Aereo to court to sue the pants off of them. Turns out that Aereo was absolutely prepared for that. In a recent court case decision, they won the court case based on the fact that antenna, dvr, and slingbox are all legal for you and have been decided so in previous court cases. Plus one for the underdogs.

This is a valid service that they are providing. Just because you don’t like it doesn’t make it immoral or copyright infringement.

Senator McCain and the a-la-carte options

Even better yet, Senator John McCain, a man that I would not say that I align with politically, has a fabulous idea that he sent to the New York Times.  Basically, a-la-carte pricing has been requested for about 20 years by the government.  The FCC doesn’t want to step in and get involved in that, because that would be government putting limitations on businesses, which would be a political crap-storm.  However, he is willing to cut off the subsidies that they are getting from the government when they don’t do this.  BAMN!  Thank you Mr. McCain!  It’s about time.

The cable companies are putting pressure on companies that might take their business (Google, Microsoft), but they can only do so much. With the updates to the Home Theater PCs (by Dell, Boxee, Plex, XBMC, and even the new XBoxOne, for better or worse), it’s possible to connect your home in ways that were unheard of.  The only problem is that the content is still coming.  It’ll get there soon enough though.

Hope

With all of these different forces building, it might just be possible to losen the grip of some of the worst-liked companies in the US today.  Here’s for hoping, right?

Stupidest Google Groups Message I Have Ever Found

I understand that google groups has upped the number of permissions that people can tweak. That way, you have separate permissions to join, post, reply, etc. If you want to be a nazi in your group, they give you the power. However, I came across the most ludicrous message I have seen from any google application:

“You do not have permission to leave this forum.”

And just so that folks don’t think I’m just making it up, I took a screenshot.

Screen Shot 2013-05-24 at 2.29.44 PM

Now, I know that Google Groups isn’t the most feature rich forum software out there, nor is it the most feature rich newsgroup software. Unfortunately, I have now relegated this to “The place where the retard Google devs get to play.” This is because, whomever thought that this was an appropriate message or rule to make, falls into that category.

(PS – Sorry if I insulted any special needs kids. Just know that you can make fun of some of the Google developers now.)

Simple Groovy-isms

You learn pretty quick when switching over from Java to Groovy. Problem is that it is fairly backwards compatible, so if you aren’t doing something in the easiest way possible, it may be hard to know. For the basics, I just want to state them so that everybody is at least covering the basics.

Scoping

By default, classes are public in groovy. Don’t add the public keyword. Similarly, member variables are private. The accessors and mutators are generated (as you’ll see in the next section).

Accessors and Mutators

Accessors should be adjusted from

To the following

Similarly, the mutator

should be used as follows

It looks like you are accessing the private method, but it’s not. It’s just shorthand for calling the “get” function. This is important because even if there is no member variable – such as x.getCount(), this should still be called using x.count. That’s one of the fun shortcuts in Groovy. Continue reading