Tuesday, November 9, 2010

Aren't you ready for Linux Yet?

"A Classic Drive By Attack" is what this article says.

So Microsoft Outlook has another bug that allows machines to be infected and taken over without the users clicking on an attachment or anything.

Plus many other security holes, in Office, and other security holes that have to be patched manually. I always hear much gnashing of teeth and wailing over the high cost of hiring the staff to administer Linux or Unix boxes, but once you install a Linux box, and once it's configured and running, administration is minimal.

I used to fix the Windoze boxes of family and friends when they got infected with a virus or malware, or crippled by spyware. Not anymore, now when someone brings me an infected box, I give them two options. Let me install Linux, or take it to someone else. So far nobody has turned me down. And of the 10 friends/family I have installed Linux for over the last two years, none of them have had a single virus or blue screen of death or other system issue. I also haven't received a single phone call about how does this work or that work, or this broke or that broke.

This has been typical of the Windoze environment ever since Windoze for Workgroups when they added networking and allowed the rest of the world in. I just don't get why people continue to buy the marketing hype of Redmond and continue to throw money at this swiss cheese platform.

And if you haven't worked with Windoze 2008 Server yet, let me tell you, you are in for big administration headaches and backwards compatability issues. In order to try to fill the holes in their swiss cheese, so many security "features" have been added, it pretty much rewrites the book on configuration of security on one of these machines. Things like authentication and networked filesystems and file permissions are very much fubar'd and require a whole new level of expertise to configure and maintain.

So to close, I'll relate a story. A friend of mine asks me about why their machines are running so slow in their office. This friend tells me they are going to buy new machines because everything is so slow now. I tell them, they probably have some kind of virus or malware, or something slowing the machines down and they don't need new hardware.

I speak with the business owner, and she tells me that everything runs great, it's just the slow machines. She also tells me Windoze if fine for their office (she forgets the compatability issues they had last month where people couldn't read each others documents).

The next day, this same business owner is reading e-mail and all of a sudden, a picture of a woman lacking clothing, doing the spread eagle appears on her screen. Needless to say, I went by their office and ran malware and anti-virus scan's on all the machine in the office. Turns out only one of the machines wasn't infected with multiple virus'

The moral to the story here is get off of the Redmond crack. Take the needle out and put something in your business that isn't prone to getting attacked every month from some new threat. It's great that there are security patches available, but before there is a patch, someone has to find the bug, and by the time you get the patch, it's already probably too late. Kinda like the old saying of "Closing the barn door after the horse is already gone".

Friday, June 25, 2010

Google Analytics Custom Variables - How To Trim Properly

Well I've been geeking out with Google Analytics as of late, and I've got to say, why would anyone pay for it anymore? Awesome tool that satisfies most Analytics needs.

That being said, recently Google launched a new feature called Custom Variables. This new feature is very powerful, but it has some limitations. One of these is that during a single page load request, if you total up all the keys and all the values for your request, they can only equal 64 bytes in total.

Other limitation are that you are limited to setting 5 key value pairs at a time, and the other limitation I have run up against is that you cannot send multiple values for a single key in a single page load.

But wait there's more.... The 64 character limit is URIEncoded, that is to say if you have a string with a character that gets URIEncoded, say like a semi-colon, this single byte will be expanded to 3 bytes when it gets URIEncoded.

So AB;

Becomes

AB%3D

If you are using the code on the net I found that URIEncodes, then trims the string, then URIDecodes before passing to _setCustomVar, you can run into an error where you wind up with a partial string on the end, that when URIDecoded will generate an error. To solve this problem I wrote the following function that allows the setting of custom variables and will trim them to an arbitrary length and will also get rid of any partially URIEncoded strings at the end.

Enjoy:

  function gaTrimCustomVar(vstr,vlen) {
// URI encode and truncate to vlen
var tstr = encodeURIComponent(vstr).substr(0,vlen);

// If the first character is URL encoded and length is not at least 3
// we'll return untrimmed and let the upper level deal otherwise we would clear
// the value completely and return an empty string.
if( tstr.indexOf('%') == 0 && vlen < 3) {
return vstr;
}

// load a pointer to any partial URI encoded characters at the end

var uptr = tstr.substr(tstr.length - 2,2).indexOf('%');

// If there aren't any partial URI encoded characters at the end, return
if(uptr == -1) {
return decodeURIComponent(tstr);
}

// return only up to the last partially URI encoded character.
return decodeURIComponent(tstr.substr(0,(tstr.length - 2) + 1));

}

Thursday, June 24, 2010

Conficker - Still paying for the mistakes of the past

I've been specializing in Analytics lately and I use Linux on all my desktop machines, so I haven't really paying that much attention to the Windoze arena other than the nicely manicured, maintained by a team of overseas engineers Windoze machines. I was reading this article from The Atlantic the other day, and I think the time has finally come to migrate off of Redmond Swiss Cheese once and for all.

The Conficker worm is one MF, for sure. The problem is this. You don't have to get infected by it directly. If there's a machine that's on the same network you're on, and it has the Conficker worm. That machine will actively attack your machine. It will try new security holes, and it will even try password cracks to try and guess your passwords.

First detected back in 2008, this thing has just gotten bigger and badder ever since. Sure there are patches, and apparently only some unreleased Beta of Windows 7 was vulnerable, but most of the other release before it were at one point vulnerable.

So let's say that you have one of these Windows systems and you are installing it fresh. It's probably vulnerable out of the box and will need an update. Well guess what, you have to connect to the Internet, to get the patch to close the hole. If you are on a network and there are machines that are infected, they will be actively attacking your machine. It's a race against time to see if you can patch your system before the nasties get in.

I just don't get it, I'm talking with my significant other's employer, they have seem to be having the same problems every network with Windows has, things work, then don't work, machines get infected with virus' and other nasty stuff, compatibility issues with older version and when I tell them they need to get off Windows and onto Mac's or Linux, they say "Well Windows has been working fine for us". When in fact they have all of the problems I just described. It's funny how people computers can run slow, crash and have all kinds of other issues that keep them from working and things are "working fine for us". The very next day, this same person I had the conversation with has the nastiest picture she has ever seen, spread eagle on her screen with the message "Watch Me Masturbate!". I think their ready for Linux now :)

Friday, April 16, 2010

Windows vs. Linux the candy bar analogy

So I was trying to explain to my significant other, this morning, about why, having worked with both *nix systems and Windows systems, do I dislike working with the OS from Redmond so much? Do I have something personal against Bill Gates? I mean come on man what's the deal yo? I really should like Windows, many of the things I do take much longer in Windows than just about any other OS, so there are more billable hours to be had. As an ethical consultant though, I really do want what's best for the customer. Also billable hours where the customer is in a panic because they are trying to recover important files that were lost because of some weakness in their operating system is not a fun call. I kind of summed up my dilemma in analogy that went something like this.

It would be like being a great chef, able to create any dish that tasted like anything in the world. But all people wanted to order from you, or have you prepare. were deep fried candy bars. They taste yummy to the customers, but the problem is, the customers keep keeling over dead. But it doesn't stop there, because you fed them the candy bar in the first place, you have to round up the Pope, the Local Witch Doctor and a guy from India named Bob to have a lengthly ceremony, where small animals are sacrificed to resurrect the now lifeless customer.

The customers is alive again, they are missing some fingers off of their left hand. Not to worry though, "Give me another candy bar!" the customer cries, "I'll pay anything, I love it!,and besides, it's what everyone is eating, I get a side of deep fried candy bar with almost every meal I order from any restaurant, why not? Oh and do I get a discount on you sewing my spare fingers back on?"

So I send the Pope, the Witch Doctor and Bob home with a healthy donation to the church, a goat and a support contract, or did I send the goat to the Pope? Well, regardless, the very next thing the customer does is order another deep fried candy bar. I say to the customer, "Look man, if you eat that you will just die again, and I'll have to call the Pope and things will get ugly, but you know, I can make you something that will taste just like that other candy bar, it will have the chocolate, the nougat, the caramel, everything the other candy bar has, and it won't kill you, except it's totally magical and organic, made by little elves in a far away land with chocolate rivers and houses made out of gingerbread, at least that's what I might as well be saying when I start to talk to the customer about the advantages of Open Source and the protected memory architecture of a *nix system vs. other operating systems that don't have these nifty features, not to mention the savings in time and money in maintenance, performance, downtime, etc.

You just can't beat a LAMP system (Linux, Apache, Mysql, PHP) for small to medium sized deployments. I just set up a small store owner with Ubuntu and Zoneminder on an 8 year old PC that would no longer run Windows, and now it's a low cost security camera server replacement for her 3 Axis Video cams in her store. Whenever my friends or family come to me with their Windows machines infected, again, I have just started to wipe them and put Ubuntu on them. If they want to keep their Windows, fine, but I'm not going to try to unravel their messes anymore. Oh and if you want to know what kind of new computer to buy, get a blue one :p

If you've got the dough, nothing will give you that low end torque like a Solaris Risc box running a well tuned Oracle database, oh baby! I put in a Sun box at a large deployment to process credit cards on the Internet a few years back, and it's still running without a reboot, chugging away. The Windows server that was processing credit cards for only a few local machines, had to be rebooted every night or the machine would hang, requiring someone to go down to the server room and hit the reset buttton in the middle of the day while cash registers were pumping and plastic was sliding. The problem was because of a poorly written application, but therein lies the big difference between most *nix systems and Windows based systems. In *nix land, it's much more difficult to write a program that will completely hang or crash the machine. Because of protected memory, which I won't go into detail about in this article, it makes it harder for a regular user to run a program that will cause the system and other users grief, it also makes it harder for virus' and other malicious programs to do extensive damage should they happen to get in.

All that being said, maybe one day, people will start to use an Operating system that is crafted by tiny elves in a far away magical land and forsake the evil king who rules from atop his green mountain of cash, with his armies of briefcase wielding stormtroopers, but then again, to quote a phrase "and maybe monkeys will fly out of my butt". Until then though, I guess I'll just shut up, put a few bills from the mountain in my pocket and go home :p

Thursday, April 15, 2010

Mozilla 3.6 and VMWare

I went there, and I went back. Some kinda issues on that baby. Chrome doesn't work at all (yet) with VMWare, but oooohhh what a Sexy browser, I just love Chrome, and now that it's on Linux, it makes it all better.

Anyway, after going down the long dark upgrade hole of Mozilla 3.6 pre2, Well actually the Upgrade was easy, it was what happened afterwards that was a long dark hole.

Firstly, my My VMWare did not work. Wouldn't even let me log into the console. This problem is easy enough to fix. Turns out that in 3.6 (And 3.7) SSL2 is disabled by default. I'm not sure what the story is, but I assume it has something to do with SSL2 being easily cracked. Anyway, the solution to getting it to actually log in, is to enable SSL2.

To enable SSL2, in the address bar at the top of your browser type in:
_
about:config

Scroll down to

security.enable_ssl2

Then click on whre it says false and click "Toggle", it should then say True.

Stop and start the browser (Actually I don't know if that's 100% necessary), and you'll get a login screen.

The next problem I ran into was that I couldn't get the console started, but It may not have been all 3.6's fault. Part of the problem was that because I couldn't get VMWare running, I decided to try to get to my VMWare server w/out Mozilla. Wrongo!!, I try to install the VMWare player and the installation process removed VMWare server, Doh!

After re-installing the VMWare Server and Downgrading my Mozilla to 3.5.9, I was ready to go, or so I thought. My VMWare instance would boot to 95%, then just stop. A poke around the log files found some errors about bad links in /var/run. To solve this, I did the following:

1. Stop the VMWare services by doing:

sudo /etc/init.d/vmware stop

2. Check to make sure no vmware process are running

ps -ax | grep vmware

There may be stuck vmware process' running, you have to kill by hand with kill or kill -9, make sure to kill the vmware-watchdog process first, or it will keep starting up process' you are trying to kill.

3. After everything is stopped, go to the /var/run directory(ies) from your /var/log/vmware log entries and remove any .lck file in the .lck directories.

4. Run vmware-config.pl and select the defaults all the way through.

You installation _SHOULD_ work now, if it doesn't, hey it worked for me :p

Friday, April 9, 2010

Star Trek Online, How to NOT get it working in Linux (Ubuntu)

Well, I wanted to make a short post as I thought I had it working using the method below. When the screen came up to the initial game after I installed, logged in, updated, etc. The Video was scrambled.

Since then I have been hopelessly lost down a road of re-installs and Wine Internet Explorer madness. I won't bore you with details, but just wanted to follow up to my last article and let anyone know that, the guy in the Video made it look, Sooooo.... Easy, nothing about the extra bits and bobs that you might need or that he was using, anyway, suffice to say, I'm still dual booting to get my Kling-On, but I did manage to get Team Fortress 2 working on Ubuntu, but that's another story, I'm going to hit the waves for a bit while I wait for the Excel, Visual Basic, ODBC Macro monstrosity I have written is finished before it's off to the world of Cut, Paste and Glue!

I also saw someone comment about how my later articles were better than my earlier ones, and you know, it's because I'm better too, but that's REALLY, another story, until then Geek on, and I'll see you in space you squishy Federation types :p

Thursday, April 8, 2010

Star Trek Online, How to get it working in Linux (Ubuntu)

OK I haven't posted in awhile, but this will be my geekiest post to date. Not only do I talk about Star Trek, I talk about a Star Trek game, not only is it a game, it's an online game, a massively multi-player, online game (MMO). Now if that weren't geeky enough, at the end of this post I'm going to provide links that will allow you to install Star Trek Online under Linux. So if you are not already having spasms of geek joy just thinking about playing your geeky game about your geeky TV show with other geeks on the Internet on the geekiest (and most user friendly, ahem!) operating system on the planet, then read on.

I've really been enjoying this game, it's very cool to get my Kling-On :p. So far PvP as a Klingon is the best part of the game. There's a mission called "A Good Day To Die" where the object is to be killed 50 times in PvP. The only drawback with PvP'ing is that PvP is the primary way for a Klingon to level, Federation types have all types of missions they can run to level up and get good loot. It also means Federation types are soft and squishy. They don't PvP much, whereas the Klingons pretty much have to PvP to level or get any good loot. The alternative for Klingons is to grind exploration missions. I think once more content is added for Klingons, they will become less the PvP elite that they are now and it will balance out a bit. Still though, Klingon vs. Federation at the moment is pretty much a game of burn down the noob, hehe.

So on with how to get this sucker installed on Linux (Ubuntu Hardy Heron w/ Upgrades was what I installed on). First I tried to install this under VMWare. Even with the latest release and much gnashing of Teeth, no go. Next I tried VirtualBox. I really liked VirtualBox and I think I will move to it for my personal use of things like GotoMeeting, etc. Things I have to run I have to have Windoze for. Anyway, VirtualBox had a problem, even though I had read people had gotten it to work. Of those who reported it to to work it worked very slow.

In comes Wine, yeah Wine. The difference between Wine and VMWare or VirtualBox, is that VMWare and VirtualBox, at their base are hardware emulators. They emulate a virtual piece of hardware, that any operating system can be installed on. Wine on the other hand is an API that interfaces Windows applications to the Linux OS. It's more of a bridge than an emulator. That being said. I found this nifty YouTube Video where this clever chap shows step by step how to install it.

The application he's using is PlayOnLinux, which helps you install your Windoze games on Linux. It can be downloaded from http://www.playonlinux.com

You'll also want to install the PlayOnLinux plugin POL Helper (Also in the video)

Instructions for that can be found in the following thread:

http://www.playonlinux.com/en/topic-2415-Plugin_POL_Helper.html

So my friends, sit back, relax, and geek out!

Thursday, February 25, 2010

IPOD Nano 8gb 5g review

So the thing looks and feels really, really cool, it felt good to have in my hand. The cool metal feeling made me feel like I was almost gripping something erotic. Then I plugged it into my computer, and the feeling changed from one of bliss, to kind of feeling like waking up in the morning after a drunken binge, next to a fat hairy guy, and you can't really remember what happened but your but kinda hurts.

I'll make no bones about loving Linux and abhoring the piece of Junk Redmond feigns to call an operating system. So all of my other devices just plug in and look like USB drives, my girlfriends freaking Palm does that and you already know what I think of that deprecated has been. To be fair, the IPOD does show up as a USB drive and you can copy music files to it, but then when you unplug it, it does not show that you have any Music on your IPOD.

So I embarked on a Journey of trying to get one of the many programs that can load music onto IPODS from Linux, most of them depend on a library called libgpod. This library is used by many of the Linux applications that manage your music library to easily sync your music with your IPOD.

The problem is that instead of the IPOD seeing that there is new files on it's drive and figuring out how to index them in it's database, the IPOD depends on an external application to update their little SQL database with artists and titles, etc. That's where libgpod comes in. Problem is Apple has changed the format, (once again), so none of the program that work with the previous versions of IPOD's work with the 5g (5th generation) IPODS.

After trying to download and compile libgpod from source and applying patches from the net. I finally admitted defeat and downloaded iTunes. Are you kidding me?!? 300mb and a half hour installation, just to get some MP3 files copied to my music player?? Apple can put it in a sexy package and make it simple, but they are as bad as the evil that lurks in Redmond when it comes to being closed and proprietary.

So my advice, unless you want to look cool, but fail in the tech department, get one of these. If you want a simple to use, low profile music player, there are many out there. Make sure you get a player that doesn't need additional software installed on your machine, that's really the key. You should just be able to plug the player into a USB port, then drag and drop supported format files onto it and be done. The player should figure out from what you load on it, what to do with it and should not require additional software be installed.

That's my Music Player design lesson for the day, class dismissed :p