Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Sunday, July 06, 2008

SQL Server Performance, pt I

If your in Amsterdam, you have to look at windows.

Ok, so my career brought me back to Windows and Microsoft products. Bummer. One of my tasks recently required me to go over SQL Server 2005 Performance guidelines and Troubleshooting techniques and attending a lab of some sort where this performance guru shared some really nice tips.

It was actually very pleasant, and I want to share with you all some of the things I got from the training and if MS SQL Server is your thing, maybe you'll get some value out if this post.

So, first things first:
1 - tempdb: You can read more about it in this Technet article. The default size for this very important db is only 8 MB. Change it according to the few basic rules outlined in the link above.

2- Gathering generic performance statistics. MSSQL Tips gives a very nice overview on how and what kinds of statistics you can gather in MS SQL Server. I find this very useful to start a performance evaluation. Better yet, the Performance Dashboard add-on that can be downloaded here. It's too big and complex for this post, but if you need some pointers, ask me. Another really useful set of tools, jointly referred to as RML Utilities for SQL Server can be found here. Do some read-up on them and enjoy.

3 - I/O. This is one one the key elements in performance for just about any application. This might be a good time to introduce you to the SQL Server Best Practices
. The whitepaper on Predeployment I/O Best Practices is a must read if you don't know the basics on how to measure and improve this performance parameter.

4 - Isolation Levels. Be sure to read the Books Online on the 6 supported isolation levels in SQL Server 2005. Read uncommitted (or nolock), read committed, repeatable read, serializable, read committed snapshot and snapshot. Understand how these different levels affect concurrency.

5 - Stored Procedures. In most situations, SP's will provide better performance over queries any day. The reason for this is two-fold: The Data and Procedure caches, aka Memory Hogs R' us. A nice article I found on this can be read here.

There is so much more to say about this topic that I might consider transforming this in a series of posts. It would be just too much for a single post and there are several areas that I find would be really interesting to go over in depth, provided that I have the time to actually write something that is. :-)

Managing MS SQL Server is much more than pointing and clicking and therefore it is very easy to get it wrong. On the other hand, this is really valuable knowledge if you're considering a career as a performance engineer / consultant. Or even if you're just writing a Web App (RoR springs to mind) that you just can't figure out how to go about squeezing out every last bit of performance of, really knowing what you can do with the database layer is a definite plus.

Saturday, April 12, 2008

Going with the flow

Lately my collages at prt.sc have been printing their terminal usage history. I found mine to be interesting, so I'll post it too.

BlackBookII:~ jpa$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
59 ruby
59 clear
51 dscacheutil
37 ls
35 java
35 cd
31 sudo
24 vi
20 ps
19 rm

Yeah, I like to clear the output before doing something else... The dscacheutil honorable mention is a memory from my home in Portugal, see, the problems I had with Meo vs Leopard never quite disappeared and doing a "dscacheutil -flushcache" was the only way to get over the nagging network resolution bug.

Wednesday, March 19, 2008

1000.times better

Short code post. Just the story of how do you get someone looking into Ruby when they had already dismissed it as a fad. You know, the hype can blind you.

So the situation arrived when a friend needed to have a particular chunk of XML repeated 1000 times. No more, no less. Sounds stupid but it's just an oversimplified anecdote.

When he asked me for a quick script to do it for him, I saw an opportunity to show how Ruby would be a good tool for this job (insert promo here). Being a "show, don't tell" kind of guy, this was the code I presented him.


def thousand_repeater(string, repeats =1000)
repeats.times do
print "#{string}\n"
end
end


Not too fancy by any means. You just have to call it with the string you want, optionally provide the number of times you want it repeated and that's pretty much it.

Ex.: thousand_repeater "hello",3


The thing that got to him was actually the ability that Ruby gives you of doing something like "1000.times", compared to the more familiar (at least for him)

for(i=1; i<1000; i++)


Thats it.

Friday, December 07, 2007

News of the world

What an exciting week this has been!

We started of with a native Mono release for OS X, which you can read more about at Miguel's blog.

Then it was Netbeans 6, which is IMHO the best IDE for Ruby and Rails development and it's yours for free. Here.

And today we can rejoice at the launch of Rails 2.0.

Hurray for us!

On a side-note, I just wanted to share with you a conversation I had with a mono hacker regarding the look of Mono on Mac OS X, even if in a somewhat twisted way for better reading :

Me > People are complaining it doesn't look "native".
She > Well, there are two answers for that:
Novell is currently concentrating on making Mono on the Mac a stable development platform. The System.Windows.Forms layer has support for theming and we could accept contributions for a Quartz theme that uses the HIToolbox APIs. Or, in a shorter version, we accept patches.

And then she said goodbye with the funniest tagline I've heard this week :"nothing like a linux forum to complain about how a windows technology looks on a mac"

Tuesday, November 13, 2007

An ice cream that creamed a car

This is a somewhat old story that I've read some time ago. It came up today in a conversation I was having with some co-screenies.

I had to do some googling, but was able to find a good enough recount of the story. Read it here.

toad codebits day 1 - random thoughts

Well, in and out of the first day of Sapo Codebits, or Toad, and a few thoughts sprung to mind.

I'm gonna do this the old school way of dividing in a The Good, The Bad, The Ugly sort of way, so..

The Good :
- Getting to know fellas like Diogo, Luis, the segway dude, Samuel and the lovely Mono Hacker, and meeting up with "the" PHP Man , the Python Evangelist Extraordinaire, Franc and the hacker behind some of the funniest storys I've heard and of course, the geekiest guy I know Cafonso
- Mike Culver's Presentation. That was what I was there for.

The Bad :
- The Wireless bandwidth available.
- The food.
- Did I mention the low bandwidth (well, the codebits page is kind of remeniscent of a heyday of 16k modems, but come on!!)

The Ugly :
- PT's Pulso app.
I mean, the app/system in itself looks great and seems to be a wonderful piece of enterprisey software, but PT taking advantage of Open Source Software to build a great product and then selling it? What are they giving back to the community? Bug-fixes? Is that enough for such a big company? Shouldn't we expect a little more? Ok, this is just one more reason why I don't like PT, Sapo or any of the PTM companies.

Final verdict:
- If you were there, probably you had fun. If you weren't ,don't feel too bad. It's a well over hyped event.

I'll be back tomorrow, and hopefully I'll be able to catch up again with some of the folks I've met today and be able to see some more presentations.

toad codebits day 1

Well, it seems that I made the cut after all, but I only managed to get here some 30 minutes ago.

Not all is lost, I still managed to catch Mike Culver talk about Amazon WebServices, namely S3 and the amazing EC2. As soon as I'm able I'll post an update about the talk itself and my first impressions.

Stay tuned.

Wednesday, October 03, 2007

FASTA, betta, more

My girlfriend's sister asked for help. But all she got was a 16.

The purpose of this script is to get a file(name) as a first argument, a regexp as a second argument and then search trough the file and print out the whole sequence where any of the possible regexp values are found, being that the searched sequence itself must be identified with "<>" symbols and then do a little basic math with the elements we've found.

To try this out, save the following as (for instance) sequences.txt:

>50c's and 50t's
cccccccccccccccccccccccccccccccccccccccccccccccccctttttttttt
tttttttttttttttttttttttttttttttttttttttt
>10G's and 90A's
GGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>A random sequence
ccagtcctgtctaaggactttggttcatgcgttaatttcggttagccagtggcgcccacg
taacaaagtgcgaccgacctgcttccatagcattgaaatgtccttgattggagattttac
gcaggaggactgataagttcgggtctgaattgatgcagcgaacgttcatccaatactcag
acttgcactcagtcg
>A second random sequence
cgcatgacggccctcctcgacggttcattaaccttgcacaccaactgttcctcaaccgat
ctggtgtctttctcacttacatagcagttgctgtaccatttgatgggaacccgagatcac
cgggttatcgcgggagtttattccgaattgttctcggaaatgtggcgtcggcttgaattg
ggaataatacggatcttgacaagcacgatttcatccacaatgcggcacgagtaatcccct
tctggaaggatgcagaaaggacatatacaatgagctagccacgtggcgcataacgcagct
tggttagaaactaaatctatacaggaagatacagaatgggaacagtgtcgctcagtctag
ccagctagatccgcctttagtcgaccttaggggtaaggca

And the below code as scripty.pl:

print "\n\n *girfriends_sister_school_id* \*girfriends_sisters_friend_school_id*\n\n";
print "filename:\n";
$filename = ;
open(TEMPFILE, $filename) or die("Cannot open the file $filename");
print "Insert the regular expression to find:\n";
chomp($regexp=);
while () {

if ( /^>/xms) {
$paragraph = "";
$paragraph_head = $_
}
if ( /^$/xms) {
push @paragraphs, $paragraph;
} else {
$paragraph .= $_;
}
}
push @paragraphs, $paragraph;
foreach (@paragraphs) {
while ( $_ =~ /($regexp)/gi) {
$expressions{$1} += 1;
}
}
foreach $key (keys %expressions) {
print "\n\nPattern = $key\n";
foreach (@paragraphs) {
if ($_ =~ /$key/) {
$paragraph_with_patterns = $_;
$total = length$paragraph_with_patterns;
$counterA = 0;
$counterC = 0;
$counterT = 0;
$counterG = 0;
if ($key =~ /a/){
while ( $paragraph_with_patterns =~ /a/gi) {
$counterA += 1;
$sum1 = ($counterA/$total);
}
}
if ($key =~ /c/){
while ( $paragraph_with_patterns =~ /c/gi) {
$counterC += 1;
$sum2 = ($counterC/$total);
}
}
if ($key =~ /t/){
while ( $paragraph_with_patterns =~ /t/gi) {
$counterT += 1;
$sum3 = ($counterT/$total);
}
}
if ($key =~ /g/){
while ( $paragraph_with_patterns =~ /g/gi) {
$counterG += 1;
$sum4 = ($counterG/$total);
}
}
$paragraph_with_patterns =~ s/($key)/\<$1\>/gi;
print "$paragraph_with_patterns\n\n";
%sum = ();
%sum1 = ();
%sum2 = ();
%sum3 = ();
%sum4 = ();
if ($counterA >0){
%sum1 = ("A", $counterA);
}
if ($counterC >0){
%sum2 = ("C", $counterC);
}
if ($counterT >0){
%sum3 = ("T", $counterT);
}
if ($counterG >0){
%sum4 = ("G", $counterG);
}
%sum = (%sum1,%sum2,%sum3,%sum4);
foreach $key_id (sort hashValueDescendingNum (keys(%sum))) {
$div = ($sum{$key_id}/$total);
print "$key_id = $sum{$key_id} \/ $total = $div\n";
}
}
}
}
sub hashValueDescendingNum{
$sum{$b} <=> $sum{$a};
}
exit;

Then run perl scripty.pl . Put sequences.txt as the file and a[c|t]g as the regexp when prompted.

I had alot of fun doing this wich is a good thing since I didn't get paid.

And no, neither bio::perl, nor any other module for that matter, were options.

Finally, a major thank you must go out to sab for the priceless (as in: he didn't get paid either) help.

Tuesday, August 14, 2007

that's cool

Quicky:

Are you using OS X to develop the next big Rails app and need ImageMagick, RMagick and friends?

Well, just point your browser to rubyforge and download the rmagick-osx-installer package, unzip it and read the fine manual. If you have all the pre-requisites, "sudo run" the installer script and then... go out for a coffee.

When you're back you'll have the following log in your terminal windows:

libpng was installed successfully
libjpeg was installed successfully
ghostscript was installed successfully
ghostscript-fonts-std was installed successfully
FreeType was installed successfully
libwmf was installed successfully
ImageMagick was installed successfully
RMagick was installed successfully
Removing rm_install_tmp directory...Done

That simple.

Tuesday, July 03, 2007

Making the enterprise see red - part I

Ruby trough Rails has been a poster-child for the so called web 2.0, but in the enterprise level the adoption rate hasn't been all that remarkable.

Rather than go trough an extensive diatribe about how adoption rates in the enterprise for just about any open source technology is always necessarily slow, because no self respecting OSS programmer plays golf, I'll just list some of the perceived weaknesses and shortcoming usually attributed to Ruby.
- Contrary to Perl, it doesn't come installed by default on just about every Unix-like OS;
- The treathing model used is week;
- Rails doesn't scale;
- It's just a fad, and it will go away before it matures;
- Poor Unicode support;
- No single good IDE and Text Editors are soo 80's;
- Nobody wants to learn yet another language especially when there is close to 0 employability for it;

While most of these are (at least to some extent) true, there are many projects that aim at overcoming them. And Ruby itself is still just version 1.8.6 at this point.

One such project seems to be catching enough wind behind it so that it could drive Ruby into mass (wishful thinking here...) adoption. JRuby.

Now, one might expect that the "J" would stand for Japanese, but remarkably it stands for Java. Isn't that ironic? Ruby is sometimes hailed as "What programmers should be using to still have time for a personal life" contrary to Java's "Write once. Then again, Just one more time... Ok, call your mom and cancel dinner" motto.

Jruby (which just recently reached the 1.0 mark) is a pure Java implementation of Ruby, and it's developed by Thomas Enebo and Charles Nutter with Ola Bini also being credited here and there, and, to some extent, sponsored by SUN. It aims at being more that just another implementation of Ruby (not that there are many...) which means that while still programming in pure Ruby, a coder can now enjoy the following added benefits:
- Java's scaling capabilities since Ruby code now runs inside a JVM which means parallelization in multi-processor setups ;
- An optimized Database connectivity with JDBC;
- Same level of Java's Unicode support;
- Garbage Collection handled by Java. (don't we all appreciate that?);
- A great IDE (Netbeans 6. Packed with all typical goodies plus code completion and a Swing Form Builder, it just might be the VB6 of the XXI century), plus a pretty good one (XCode + a hack);
- Access to those millions of lines of code in Java classes;

And last but not least : Integration. This is the one that's going bring it home.

With Jruby and a rails plugin called GoldSpike (previously rails-integration) we're a simple rake command away from turning any Rails app into a standard WAR file, which in turn can be deployed in either Tomcat or Glassfish or presumably just about any other applet container.

What this means is, in an enterprise environment where you have all these layers (think MVC in different LAN segments) set up and where any innovation is foreseen as potentially disruptive if not outright forbidden, we can easily introduce Ruby and Rails code, and from a manager's point of view its a win-win situation where the developers get things done faster, and the implemented structure is maintained without any hiccups. And they still get Sun's level of support.

In parts II and III I'll be showing some code and examples of rapid deployment with JRuby.

Monday, June 11, 2007

The Automator

I've always been one to dislike repetitive tasks. I think it's partially because I find it hard to concentrate for a long time on tedious chores and partially because I fear getting carpel tunnel syndrome.

Just this weekend my "disability" was put to the test. I found myself going trough 8 GB of assorted files (note to self: do _not_ label zipped backups "stuff"...) trying to find a couple of pictures I wanted my girlfriend to see. I didn't know the filenames (note to self: rename the pictures I like because PIC00731 or DSC00239 aren't real _names_) or the time stamps.

Know, if I was "doing" Windows, I would pull out one of my 50+ lines VBS's, but that wouldn't get me no lollypop. I might had tried a bash-slash-perl trick to move only a couple of selected filetypes onto a new folder, but that wouldn't get me too far either since I would still need at least one more action to open all of them. And my girlfriend would leave before waiting for me to get the script right....

The solution ended up being my new favorite Mac OSX app. Automator.

Automator comes bundled with OSX 10.4 and basically it's a tool that provides you with a way to visually set up a group of actions that get a specific job done. And they call it a workflow, which pretty much sums it up.

Although you would use it to build a program, the programming background needed to use is zero, and the learning curve is neglectable.

After analyzing my specific needs, I came up with this list of necessary steps:
1 - specify the main folder;
2 - get the folder contents, repeating for each of the subfolders;
3 - filter the specified finder items by file type;
4 - decide what to do with them, in this case, I wanted to open the images in Preview so i could see them and find the ones I really needed.

And this was what I got:

Not bad huh?

By selecting and dragging the specific actions from the action list on the left to the right side pane and then changing a couple of options I was done! I saved it as an Application, runned it and 2 minutes later I was seeing the images trough Preview's Slideshow feature.

Thursday, May 24, 2007

+1

Tuesday Penantes switched.

I'm counting the number of "converts" I've brought into the light ... does anybody know how many I'll need so I get a free toy from Steve?

Saturday, May 12, 2007

FARM project (*)

You might have heard me drool about having helped implement the first Rails app at work.

If you read this blog regularly, you might even know that this was a project done in collaboration with penantes.

Now, what has been missing is an overview of the technology used and a brief explanation thereof.

The project itself is little more that a web-based front-end to penantes's voodoo-like perl scripts and it's purpose is solely of giving interested parties a better view of the spell's script's results.

Well, we had an old Dell Poweredge laying around, so that was the machine used. It had an ancient implementation of Red Hat 8 (actually. I think it was vd who installed it) so that had to go. Not so much because it was old, but because it was Red Hat. And no noticeable services running around so a clean install it would be.

For OS we chose FreeBSD. We wasn't our first choice, but Ubuntu didn't correctly recognize the SCSI controllers and the openSolaris DVD was well...a DVD, and Debian 4 was late. The machine at this time didn't have a working network connection and only a CD drive for media. Since FreeBSD is a distant cousin from both Solaris and Mac (I just had to bring this up) it was the next best thing.

The install was easy enough and the software available was pretty much all we needed.
For web serving we have Apache, for database we used Mysql, and has i've said, we used Rails for development. And apart from configuring Apache with fcgid which is a hole new post subject, everything runs just fine for now.

Recommended reading Rails on FreeBSD wiki page.

(*) in case you didn't notice....
FreeBSD
Apache
Rails
Mysql

Wednesday, April 18, 2007

Year Zero. A final surprise?

Year Zero, Nine Inch Nails new album was officially released today. And a few more surprises came with it.

After hearing it on repeat for about 3 hours, when i finally removed the cd from my macbook, the CD had turned from grayish into white revealing some binary code that (after some googling) "I" discovered could be translated to a link to another secret site!

And i though that it was just my macbook going _Extra_ hot this time!!

This is the beginning....

Tuesday, April 17, 2007

Thursday, April 05, 2007

Perl Tech Meeting

Yesterday I went to my first Perl Tech Meeting and I can't stress enough how geeky those guys are.

Having lots of easy going, funny intelligent people talking about something they like is always fun, but this was actually very informative, since there were some tech talks that covered areas such as better debugging, replacing bash with perl, using C to improve Perl scripts benchmarks (dam, this guy was awesome!).

I specially enjoyed meeting Francisco Cabrita hearing Miguel Duarte and José Castro and some others whose names elude me right now.

Anyway, thanks to SAB(offline for _way_ too long) and Penantes for the invite.

May the Camel be with you!

Wednesday, March 14, 2007

Commodore is back!


This is one of the most exciting news I've had in recent times. Probably the second most exciting thing happening apart from Nine Inch Nails new album

My first computer was a Commodore 64 with a tape recorder for loading games and a monochromatic (green tones) monitor. I can still remember playing Ghost 'n Goblins and other top notch games when i was err... along time ago. Not to mention that my first baby steps into programming where with BASIC on this machine.

I also had a friend a few years later that had a Commodore Amiga 500 that I thought was amazing, and it was on this machine that i saw (and heard) the first ever computer generated music video (Money for Nothing from Dire Straits). It was _way_ ahead of anything my 386 DX 40 Mhz could ever do at the time. Oh and there was also Golden Axe and Technotronic kept playing on the stereo. Man I love classic gaming!



While on the subject of how old i am (actually I'm 26 in case you're wondering, but I've been using computers since i was 6) here's other things i remember:
Going to Iron Maiden concerts and wearing Judas Priest, WASP and Venom t-shirts;
Wanting to look like Charles Bronson;
Buying a Sega Saturn;
Barrotes, Jerusalem and Friday the 13th viruses;
Giving up on computers when the battery on my 386 melted all over the motherboard;
Playing bass guitar for a Black Metal Band (and being acclaimed as the most promising new metal band on national radio by António Freitas (link to portuguese language page);

Wednesday, March 07, 2007

On the subject of goodwill

This is not good news for Microsoft. Their latest OS hasn't even begun to make its way into the corporate desktop and already the claims on unbreakable security are a thing of the past.

Or were they ever anything but marketing?

The question I most often hear regarding the transition for the new OS is "Why bother?" To answer this, I made a funny little mental exercise.

What would I do if I was in charge at Microsoft (or at least if they listened to me).

Well, to start with, I would take the number of available versions of Vista down from 7(5?) to only 3.

Vista Corporate Edition (VCE) - Drop the show off (Aero will be turned off by policies on most cases anyway);
Better security and networking. This would eliminate the need for mandatory hardware upgrades in the enterprise and would thus lead to wider embracing by CTOs and CFOs alike.

Vista Media Hub (VMH) - A version with some great visual apparatus, geared towards the home user with basic needs beyond media and internet access.

Aero would be a must, so maybe this could lead to a more reliable hardware certification \ standardization process (much needed IMHO) were Vista Ready meant "Ready to run full specs with full performance".

Vista Gamer (VG) - Recognizing that a vast majority of PC users mostly use their OSs (at home that is) to load and play games, Microsoft should make a version of their newest SO much to the liking of the one that powers their own Xbox 360.(Not necessarily compatible, though that would be a blast).

Networking and Security services striped to a minimum, very compact and hu.. lightweight. Take advantage of the relationships with Hardware Vendors and maximize performance.

Next if my list would be taking better advantage of what comes out of their own labs and projects (label it as beta, if you will) and deliver a companion DVD full of goodies like Photostory (does it still exist?) Expression (even a lite \ demo version) and Photosynth (for VMH).

Also a good option, would be throwing VirtualPC, SQL2005 and Visual Studio Express into a Companion DVD for VCE and finally XNA Game Studio for the Gamer version.

As for the Office suit, i wouldn't touch it (with a long stick).

Eliminate the fabricated need for upgrades (personally I’ll stick with Office XP for as long as I can, or must) and make it compatible with open-document standards for publicity if nothing else.

Finally on the server front. Well this is going to be a biggie... So I'll put it more as a wish list than anything else.

1- Native Support for "foreign" file systems.
2- Show us what WinFS can do. If it turns out not to be all that much adopt ZFS (ouch).
3- U-N-I-X C-O-M-P-A-T-I-B-I-L-I-T-Y L-A-Y-E-R (or SFU done right, or cygwin in a companion CD).
4- Gui-less version. With option for graphic administration from remote desktop or even trough a web browser. This would be a great selling point for Application, Web, DB and File servers. And for low-end servers too.

Ok, so most MSCEs would be left to dry without point and click. But the good ones would adapt, and the best ones won't tell the difference (if it can't be scripted, it can't be done, right?)

Monday, February 26, 2007

Search and Zip (revised and improved)

This is a little vbs script I wrote the other day. It's purpose is to find all log files in a given directory, create a zip archive (using 7-Zip command line interface) of each individual file (created before today, so I don't zip anything currently in use) and delete the original file.

I hope somebody else finds it useful... Although I know that someone can probably out best me with a Perl one-liner..

Here goes!

'Function: Compress and delete log files
'Description: Finds all files with the extension ".log"
'from inside the folder(s) passed as arguments, create a ".zip"
'archive with the same name and delete the original file
'Example: cscript compress.vbs d:\logs "d:\big app logs"

strComputer = "."
str7z = "C:\7-Zip\7z.exe"
i=0

If WScript.Arguments.Count = 0 then
WScript.Echo "Directory path missing. Usage: cscript zippit.vbs dir1 ""dir 2"" (etc)"
Else
'For each folder passed as an argument
For Each strArgument in WScript.Arguments
strDir = WScript.Arguments.Item(i)
Set oShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'fiel collection inside strDir folder
Set colFiles = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='"& strDir &"'} Where " _
& "ResultClass = CIM_DataFile")
'Process monitor; will report upon closed \ finished processes
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancedeletionevent " _
& "within 1 where TargetInstance isa 'Win32_Process'")

If colFiles.Count >0 Then

'for each file
For Each objFile In colFiles
'only logs mater.any other file is skiped

If WMIDateStringToDate(objFile.CreationDate) > now() And objFile.Extension = "txt" Then
'compression routine
oShell.Run ""& str7z &" a -tzip """& strDir &"""\"& objFile.FileName &".zip "_
& " """& strDir &"""\"& objFile.FileName &".txt"
WScript.Echo "Created the file "& strDir &"\"& objFile.FileName &".zip "

'log deletion routine
z = 0
'wainting Loop (sleep until zip is done)
Do While z = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
If objLatestProcess.TargetInstance.Name = "7z.exe" Then
'7z process ended; i can leave the waiting loop and delete the original file
objFile.Delete
WScript.Echo "Deleted the file "& strDir &"\"& objFile.FileName &"."& objFile.Extension &" "
z = 1
Exit Do
End If
Loop

End If
Next
End if

i = i+1
Next
End If

'change date format returned by wmi_script
Function WMIDateStringToDate(dtmDate)
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & _
Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate, _
13, 2))
End Function

WScript.Quit

'as with everything else on this blog.... Creative Commons apply to this code.

Friday, February 23, 2007

my version of this week in tech

Like most geeks I spend much of my off (work) time trying out software solutions just for the sake of knowing how it works and evaluating my options.

So this week I got interested in streaming again. Apple as a good offer. You should check it out. Not only is Darwin Streaming Server free, it is also open source (well not _exactly_ open source, but you can get the source), and they offer you pre-compiled binaries for Linux and Windows.

ESR, one of my personal heroes seems to have fallen out of love for Red Hat and is currently trying to land a job with Ubuntu. Mark Shuttleworth, it has been rumored, was seen buying a one way ticket to the next space shuttle for tourists (tm). Probably no relation what so ever between these events.

Steve Balmer said that Vista's poor sales are a consequence of pirating, giving linux lovers and CTOs all around the world another reason to suspect Microsoft’s stance on security. I mean, if they can't protect their own software...

Of course that since that they're being so generous with their licensing this time, I'm sure the adoption rate will not reflect the sales figures.

Mono is now supporting native Visual Basic code in their new release.

Sarcasm mode on:
Well, Mono belongs to Novell, Novell seems to be 0wn3d by Microsoft so I'm not surprised.
Sarcasm mode off:
Really, this is great news for me and, I'm sure, to some other ex-VB addicts.

Finally, it seems that Terrasoft (Yelow Dog Linux, anyone?) is giving me another reason to buy a PS3.