Showing posts with label technology. Show all posts
Showing posts with label technology. Show all posts

19 August, 2008

Getting Sun's JDK working right in Fedora

This should be an easy task, right? Just download the RPM, install it, done and done. Right? Well, no, not quite.

I've managed to whip up a couple commands that help with the post-install though. Namely, overriding all of the various symlinks throughout the system to IcedTea and GCJ. Here, for your viewing and usage pleasure, is what I have come up with. Please feel free to emend where you deem appropriate, and please let me know if I am missing things!

alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_07/bin/java 20000 --slave /usr/bin/keytool keytool /usr/java/jdk1.6.0_07/bin/keytool --slave /usr/bin/orbd orbd /usr/java/jdk1.6.0_07/bin/orbd --slave /usr/bin/pack200 pack200 /usr/java/jdk1.6.0_07/bin/pack200 --slave /usr/bin/policytool policytool /usr/java/jdk1.6.0_07/bin/policytool --slave /usr/bin/rmid rmid /usr/java/jdk1.6.0_07/bin/rmid --slave /usr/bin/rmiregistry rmiregistry /usr/java/jdk1.6.0_07/bin/rmiregistry --slave /usr/bin/servertool servertool /usr/java/jdk1.6.0_07/bin/servertool --slave /usr/bin/tnameserv tnameserv /usr/java/jdk1.6.0_07/bin/tnameserv --slave /usr/bin/unpack200 unpack200 /usr/java/jdk1.6.0_07/bin/unpack200 --slave /usr/lib/jvm/jre jre /usr/java/jdk1.6.0_07/jre

alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_07/bin/javac 20000 --slave /usr/bin/appletviewer appletviewer /usr/java/jdk1.6.0_07/bin/appletviewer --slave /usr/bin/apt apt /usr/java/jdk1.6.0_07/bin/apt --slave /usr/bin/extcheck extcheck /usr/java/jdk1.6.0_07/bin/extcheck --slave /usr/bin/jar jar /usr/java/jdk1.6.0_07/bin/jar --slave /usr/bin/jarsigner jarsigner /usr/java/jdk1.6.0_07/bin/jarsigner --slave /usr/bin/javadoc javadoc /usr/java/jdk1.6.0_07/bin/javadoc --slave /usr/bin/javah javah /usr/java/jdk1.6.0_07/bin/javah --slave /usr/bin/javap javap /usr/java/jdk1.6.0_07/bin/javap --slave /usr/bin/jconsole jconsole /usr/java/jdk1.6.0_07/bin/jconsole --slave /usr/bin/jdb jdb /usr/java/jdk1.6.0_07/bin/jdb --slave /usr/bin/jhat jhat /usr/java/jdk1.6.0_07/bin/jhat --slave /usr/bin/jinfo jinfo /usr/java/jdk1.6.0_07/bin/jinfo --slave /usr/bin/jmap jmap /usr/java/jdk1.6.0_07/bin/jmap --slave /usr/bin/jps jps /usr/java/jdk1.6.0_07/bin/jps --slave /usr/bin/jrunscript jrunscript /usr/java/jdk1.6.0_07/bin/jrunscript --slave /usr/bin/jsadebugd jsadebugd /usr/java/jdk1.6.0_07/bin/jsadebugd --slave /usr/bin/jstack jstack /usr/java/jdk1.6.0_07/bin/jstack --slave /usr/bin/jstat jstat /usr/java/jdk1.6.0_07/bin/jstat --slave /usr/bin/jstatd jstatd /usr/java/jdk1.6.0_07/bin/jstatd --slave /usr/bin/native2ascii native2ascii /usr/java/jdk1.6.0_07/bin/native2ascii --slave /usr/bin/rmic rmic /usr/java/jdk1.6.0_07/bin/rmic --slave /usr/bin/schemagen schemagen /usr/java/jdk1.6.0_07/bin/schemagen --slave /usr/bin/serialver serialver /usr/java/jdk1.6.0_07/bin/serialver --slave /usr/bin/wsgen wsgen /usr/java/jdk1.6.0_07/bin/wsgen --slave /usr/bin/wsimport wsimport /usr/java/jdk1.6.0_07/bin/wsimport --slave /usr/bin/xjc xjc /usr/java/jdk1.6.0_07/bin/xjc --slave /usr/lib/jvm/java java_sdk /usr/java/jdk1.6.0_07
You may notice that I did not include the manpages in these alternatives definitions. This was intentional... because alternatives is looking for gzips and the JDK, by default, does not gzip them. Whatever. I leave that as an exercise for the user. I just didn't feel like bothering, myself. :)

14 November, 2007

All Your Data Are Belong To Us!

I just had a rather interesting article pointed out to me, on Computerworld UK. According to David Litchfield, a UK based security researcher,
"There are approximately 368,000 Microsoft SQl Servers... and about 124,000 Oracle database servers directly accessible on the Internet,"
Given these numbers, I have to wonder what would be found if he were also to look for other widely used databases; MySQL, PostgreSQL, Firebird, etc. It's a bit of a frightening prospect to think that I probably have personal information stored on at least one, if not more, of those exposed servers. Things like this make me wonder how so many IT professionals keep their jobs when they really have no clue as to what is really going on. The most likely scenario is that these people are all book trained, they have their degrees and certificates and all that nonsense... then they get into a real world environment, thrown up against a huge ball of servers, and they have no idea what to do. Hearing about these things makes me very glad for the opportunities and experience that I have had. I learned better, LONG ago, than to make amateurish mistakes like this.

You can view the full text of the article here: http://www.computerworlduk.com/management/security/data-control/news/index.cfm?newsid=6198

28 August, 2007

Geeky happiness

Okay so uh, I just have to let out a little explosion of happiness. I'm finally getting my boss to order servers on par with what I think they should be... and we just ordered what is, by far, the beefiest machine we've got. I think it may actually be pretty much the beefiest I've worked directly with. This thing has got 2 quad core Intel Xeon CPUs, each with dual 4mb cache... it's got 8gb of RAM... and the hard drive is SAS; Serial Attached SCSI. Basically, this thing flies. It makes me all kinds of giddy.

Okay, that's really all I needed to say.

Happy! Eeeee!

Now off to have some fun tonight before my surgery in the morning.
Catch ya'll on the flip side!

19 April, 2007

Social Networking

It seems to me that social networking is getting somewhat out of hand nowadays. Personally, I've got accounts on Blogger, last.fm, MySpace, Flickr, LinkedIn, Facebook, Hi5... and I can't even remember others I may have signed up on in the past. This is just ridiculous. Worse yet, on most of these accounts, I have very similar friend lists. Other people I know who have signed up on some or all of these sites. So when does this all end? Does it ever end?

Now granted, some of these sites have definite differing purposes. Blogger is more for pouring out your thoughts as I'm doing now, than for networking. But there is still that social aspect to it. Flickr is for sharing photos... but again, it has a very community-based design, and it's becoming more so all the time. Last.fm is about tracking music listening habits and discovering new music... but it also has a very social aspect to it: friends, "neighbours", forums, groups, etc. Still, why do we need ALL of these sites? Despite all of the ones I have an account on, I know there are far more that I still haven't signed up on!

It's actually starting to get pretty frustrating keeping up on all of these... what I need is some method of consolidating all of this collaboration into one single point of contact. Some method for keeping up on all of them from one central system. I'm trying out this Flock web browser in the hopes that it would provide something of the sort, but no such luck. It provides an easy interface for blogging (which I'm using right now) and drag-and-drop uploading for Flickr images... but that's about it. What I'm looking for is... a control panel or command center of sorts, for all of my social networking and collaboration sites. Some way to get an overview of what's happening on all of those accounts, without having to log in and load them up individually. I want to be able to "link" friends on different networks, so that I can see who I have added where. Hmmm, perhaps this calls for a brand new website... SocialControl, or something of the sort. Couldn't hurt to try. After all, my contact page is getting way too cluttered with all of the sites that I'm on now. Now this is an idea I may have to run with.... does anybody else have any input on this? Similar thoughts? Does this seem like something that might be useful?

On a side note, I noticed a very important feature missing from that Flock browser as I was publishing this post. It doesn't let you tag your post... I had to come in and do that by hand after the fact. Oh well, not everything can be perfect.


UPDATE: 3 hours later, I decided to do a quick google search for something along the lines of what I was thinking, and I came across The Internet Address Book. Could this be something useful? It's apparently been out since September '06, and I've never heard of it before, so I'm guessing it's not faring as well as most of the network it claims to connect to. On the other hand, from what I see so far, it doesn't so much connect to these networks as simply lists your IDs on them. I was definitely thinking of going beyond that. More to come later... perhaps?

30 March, 2007

Encoding Flash Videos

One of our clients recently sent us a video that they want to have displayed on their website... and we've decided that the best option would be to use an FLV (Flash Video) file. We're also going to be using the same video format for an upcoming site of our own... one small part of the site will have uploaded videos, so they will need to be automagically converted to FLV. This sounds simple enough, right? Sure, it should be.

Turns out it's not all that simple.

After lots of trial and error, I came up with this command:
mencoder -vf scale=216:144,hqdn3d -af resample=44100:0:2 -hr-edl-seek -ovc lavc -lavcopts vcodec=flv:vqmin=3:v4mv:vmax_b_frames=0:vme=4:vqblur=0.0:tcplx_mask=0.2:mbcmp=6:trell:cbp:naq:dia=2:aic -oac mp3lame -lameopts vbr=2:q=5:aq=0:vol=2:mode=1 -ofps 10 -of lavf -lavfopts format=flv:i_certify_that_my_video_stream_does_not_use_b_frames dvd:// -o test.flv

Finally, I got a decent quality encode, with a decent file size, and not too ridiculous of an encode time... about 45 seconds encoding time for 1 minute of video. This was, however, on an already-busy 1.6GHz Pentium Mobile with 1gb RAM.

Now all I need to do is find another switch or perhaps another command to detect the video resolution and automatically maintain the proper aspect ratio when downscaling it... with that command, I scaled 720x480 down to 216x144 (0.3 times the size), but I had to pull out a calculator and figure out those numbers by myself... that doesn't work with an automated process. Oh well, one step closer at least!

Hell, I could make my own YouTube or Google Videos equivalent with this.... nice!

UPDATE:
Okay so, a couple frustrating hours later, I've finally got this down pat. I was getting some very nasty distortion on parts of the video... turns out that was due to the "tcpl_mask" option... according to the mencoder manpage:
Temporal complexity masking (default: 0.0 (disabled)). Imagine a scene with a bird flying across the whole scene; tcplx_mask will raise the quantizers of the bird’s macroblocks (thus decreasing their quality), as the human eye usually does not have time to see all the bird’s details. Be warned that if the masked object stops (e.g. the bird lands) it is likely to look horrible for a short period of time, until the encoder figures out that the object is not moving and needs refined blocks. The saved bits will be spent on other parts of the video, which may increase subjective quality, provided that tcplx_mask is carefully chosen.
In theory, it sounds like a great option. It could potentially add a lot of compression.... in reality, it barely effected the file size at all, and it cause all kinds of headaches. Along the way to finding this, however, I did find some other useful video filters, and I learned a bit more about encoding videos. (I thought for some time that it was possibly interlacing or interleaving that was causing the problems... so I ended up reading up on them, learning exactly how they work and what they do... only to realize there was no way they were guilty). I also managed to find that magic switch to automagically scale the video. I just have to specify one dimension now and it figures out the matching dimension... I love it! So, finally, here is the fully functional, heavily optimized version of that command:

mencoder -vf pp=h1/v1/dr,scale=216:-3,harddup -af resample=44100:0:2 -hr-edl-seek -ovc lavc -lavcopts vcodec=flv:vqmin=3:v4mv:vmax_b_frames=0:vme=4:vqblur=0.0:mbcmp=6:trell:cbp:naq:dia=2:aic -oac mp3lame -lameopts vbr=2:q=5:aq=0:vol=2:mode=1 -ofps 10 -of lavf -lavfopts format=flv:i_certify_that_my_video_stream_does_not_use_b_frames dvd:// -o test.flv

Yay! My work is done here.

30 January, 2007

An interesting perspective

I just found this article on the brand new Windows Vista, and although the article has a lot of words without saying a whole lot, I like how this guy put it into perspective. It seems similar to how I might evaluate it.

I'm a bit anxious myself to get a look at Vista... but I don't know that I really want to make the switch yet. I'm also not sure I want to fork over that kind of cash right now, when I can still be perfectly happy on a free Fedora Core installation.

12 December, 2006

Code Restructuring

Recently it was decided that I need to go into a documentation/maintenance phase at work, which I'm totally cool with. There was next to no documentation for me to work with when I came into this position, and I've had to figure everything out from the ground up. Some things I'm still not fully sure of... but that's what this period of time is for.

I've decided to take this to the next level though. Notice I said "documentation/maintenance", not just documentation. I'm taking the opportunity to rewrite and refactor a lot of the core functionality of our code. Build it the way it should have been done to begin with. Reorganize things, make things more readable and understandable, and document the whole process as I go, of course.

This is really turning into quite the project... one of those ones where I'm not really sure how it's ever going to end. Right now, I'm working on rewriting all of our database connection code... which is a large undertaking in itself. I think overall, this is going to be a very worthy project though. I'm building a more solid base for our code to run on, trimming a lot of fat in the code, getting it all figured out for myself and any future developers... plus I'm increasing my own understanding of PHP's object oriented programming, and in fact object oriented programming in general. This whole thing will definitely be good for my resume and my future experiences in programming.

I just hope I can actually give this project a finite timeline...

07 December, 2006

My (lack of) style

So my webpage right now is pretty ugly.

At least I think it is.

I've been wanting for quite some time to update the style, make it not so sucky. The problem has been that I just can't come up with a design that DOESN'T suck. Technically, I'm very good with XHTML, CSS, JavaScript, whatever... I can make web pages do lots of fancy things. What I can't do, however, is create a site design to fancy up. I've had a couple of failed attempts at new designs... both with different concepts, different layouts, different colors, all that. Those were definite failures though.

However, this time, I think I've got it! I got a wild hair up my ass and managed to throw together a layout that I'm actually happy with! Of course, I did have some helpful advice this time, from an excellent designer. I'm sure I'll be getting more advice before this is finished as well.

Anyhow, this means my site is actually going to get the rewrite it greatly deserves! I'll be trimming the fat, pulling off all the bs pages that are never really used (Including my guestbook... all it gets is spam these days) and sprucing up the pages that really need it. I will have a real programming section now, with full code samples, and lots of them! In fact, I even have one I just wrote up to aggregate the contents of this blog and display them on my page. OoooOoOoh, fancy!

So now, for your previewing and critiquing pleasure, here is the new design: http://tarken.lyrical.net/testsite/test3.htm

29 November, 2006

Microwaves suck!

Why the hell can't all microwaves just be a standard power and all that? I just put a bag of popcorn in for the recommended time... 2 minutes, 30 seconds... and even before I opened the door, I could smell that it was burned. So I pull the bag out, open it up, and find out that probably half the bag is burned. Hell, there's a chunk of BLACK popcorn. It's like freaking charcoal! And now the entire office reeks of burnt popcorn.

Dammit.

28 November, 2006

Database Relief

So, I've been battling with a database problem for a while now. I have this table that records all the traffic to every website we host at work. Needless to say, this grows. Quickly. At a rate averaging about.. ehhh... 35k hits/day.

Now, thanks to the wonderfully forward thinking engineers in this position before me, we have run into a built-in limitation of MySQL. By default, when you create a table, it's built with the ability to grow up to a size of 4gb. Well with as much traffic as we get here, that 4gb point has quite obviously come and gone. In just over a year worth of traffic. Brilliant.

I have finally found a solution to get us by for now though, as opposed to deleting old traffic records for inactive accounts. (I hate deleting archived data. Always bad.) One little query has made my world all better:
ALTER TABLE traffic MAX_ROWS=1000000000;

Yes, that is 1,000,000,000. One billion. We're at around 12.4 million records in that table right now. I figure if we get to a billion, I'll be retired on a tropical island, sipping on drinks with little umbrellas in them. Now, in the process of rebuilding this table with the greatly increased row limit, MySQL went ahead and recalculated the maximum amount of disk space the table could take up. The new number it came up with is 281474976710655 bytes. That comes out to exactly 256tb. Two hundred and fifty six TERABYTES. Yeah. Drinks with little umbrellas. Definitely.

17 November, 2006

I <3 RedHat.

http://arstechnica.com/news.ars/post/20061116-8240.html
http://www.redhat.com/promo/believe/
http://www.redhat.com/truthhappens/

RedHat rules. Plain and simple. Microsoft pushes, and they shove back. They won't take guff from anybody. That is awesome. More people should follow their example.