The great thing about mono and C#

So, it seems like a ton of programs I've been trying to use recently don't work with the latest version of their dependencies. For instance, Metasploit doesn't work with Ruby >= 2.0. I was using some other program that required Python 2.0 rather than 3. And we've all heard the horror stories about programs requiring specific versions of Java.

I never have this problem with C# though. In theory, it could happen.. but Microsoft really likes keeping things compatible, it's their business plan. And as an extension of that, Mono never seems to flat-out drop support for anything in their core software. I have never seen a program that requires a specific version of .Net or Mono.

This is awesome! The worst thing I have to do with Mono is compile it from git so that I get pre-release (good) support of portable class libraries. Now, let's break this down. Why exactly is it like this though?

  • C#/.Net uses compiled-to IL
    • This prevents that issue of deprecating or changing misleading language features. It's all IL after compilation, so it doesn't matter
  • There is a spec for .Net. In theory, if you abide by the ECMA spec, most things should work, logic-wise
  • It's easy to take my dependencies with me with .Net

Now let's step through why this isn't easy with Ruby/Python

  • The language is improving and getting better. This can cause old programs to break, but is unavoidable with scripting languages
  • There isn't a spec that the latest version will always implement. This is probably a good thing though
  • There is a huge emphasis on not taking your dependencies with you. This leads to breaking changes in gems and such breaking your program.

What about Java? Honestly, I have no idea why Java doesn't benefit more. In theory, they should be equally as capable as .Net.

Am I saying .Net is perfect? By all means, no. In fact, .Net has seen some breaking changes

  1. I've a JIT bug that only happens when using .Net 4.5's runtime, not .Net 2.0's
  2. In .Net 4.5, they changed marshaling to be more "strict", breaking at least one program I've seen (at my work)

And mono of course is (by design), not a complete copy of Microsoft's .Net. In fact, I've even seen a bug where .Net accepted a piece of IL, where Mono broke, due to Microsoft not being "strict" about the ECMA spec.

With all that being said though, this seems to be the major leg-up for compiled to bytecode languages. They'll probably work a very long time, despite the bytecode runner being updated.

This is also avoidable. I've seen some scripting language use a version number attribute, so that it can avoid this scenario. I'm sure there are other methods as well.

All I know is, I'm tired having python 2 and 3 installed on my system because not all my programs will run on just one or the other.

Posted: 6/3/2013 5:49:16 AM

How to reuse an NVG510

If you are like me and you decide to give AT&T the middle finger and move away from U-Verse, there is still hope you can use the NVG510. It's uses are very limited however due to it's very poor engineering, even with root access.

It's fairly trivial to root and then disable the DHCP server, making it function as a dumb switch. From there, you can now configure it's wifi and such to be a dumb access point.

However, I did this and found the NVG510 is complete and utter crap. It has this really retarded power saving thing (power saving, yet it's still hot to the touch) which basically means "lets cut the wifi power to 1% after being on for 30 minutes"

So, in summary: how to recycle a U-Verse modem:

  1. Douse modem with gasoline
  2. Strike match

Actually though, I think I'm going to begin tinkering with the NVG510's internals. Maybe looking at trying to reflash it and doing other dangerous things... and when I inevitably brick it, proceed to those instructions.

Posted: 12/28/2012 2:30:57 AM

wget, I hate you

So I recently needed to download all files of a certain type out of a moderately complex HTML directory listing. I figured "Oh this should be easy, just use wget -r and simple as that"

Well, then I discovered the moderately complex HTML directory required a list of about 12 reject patterns to keep from downloading duplicates. Then I hit a brick wall. The files I am downloading are quite numerous and about 5-10Mb each. There are two different set of links in the listing that point to the same file, making it extra fun. One is index.php?path=/blah/whatever&download=file.dat and the other is just /blah/whatever/file.dat they both point to the same thing. So then I realized that wget sucks.

Basically the command line goes something like this:

--2011-03-18 23:41:24--  http://www.host.com/foo/index.php?path=/foo/whatever&download=file.dat
Reusing existing connection to www.host.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 4901125 (4.7M) [application/x-download]
Saving to: `www.host.com/foo/bar/index.php?path=foo%2Fwhatever%2F&download=file.dat'

100%[======================================>] 4,901,125    183K/s   in 27s

2011-03-18 23:41:51 (180 KB/s) - `www.host.com/foo/bar/index.php?path=foo%2Fwhatever%2F&download=file.dat' saved [4901125/4901125]

Removing www.host.com/foo/bar/index.php?path=foo%2Fwhatever%2F&download=file.dat since it should be rejected.

Did you just say what I said? Why the hell did it download and save the file and then remove it because it's rejected.

Sigh. I loathe thee, wget.

Tags: wget rant
Posted: 3/19/2011 4:46:45 AM

deleted

Don't worry about this

Tags: rant
Posted: 3/7/2011 3:26:13 AM

Let's break some RFCs!

So I recently answered a question over at stackoverflow.

In answering it, I discovered that many popular websites go against the hostname/DNS RFC and allow underscores in subdomain names.

For what purpose? Well, I honestly have no idea but I think it's stupid as hell. Basically they're allowing people to use _ instead of - just because it looks cool. Who cares if it breaks the RFC and isn't actually guaranteed to work anywhere.

Posted: 3/6/2011 6:56:00 PM