Posts

Count number of repeating characters in powershell, ugly and dirty way

Recently I was asked to write a script to count the number of times each letter appears in a text file. This script ignores case sensitivity. I am working with a copy of War and Peace from Project Gutenberg. It reminded me of the MapReduce/Hadoop tutorial I'd followed on the Apache website to count the number of words in a collection of books. Here's the script, please suggest a better approach if you dare: #Artem Ervits - version 0.0.1 #this script counts a number of times each character appears in a file, case insensitive $names = Get-Content "C:\Users\are9004\Desktop\wnp.txt" $a = 0; $b = 0; $c = 0; $d = 0; $e = 0; $f = 0; $g = 0; $h = 0; $i = 0; $j = 0; $k = 0; $l = 0; $m = 0; $n = 0; $o = 0; $p = 0; $q = 0; $r = 0; $s = 0; $t = 0; $u = 0; $v = 0; $w = 0; $x = 0; $y = 0; $z = 0 foreach($name in $names) { for($i = 0; $i -lt $name.Length; $i++) { if($name[$i] -contains 'a') { $a++; } ...

Identify uncompressed tables in SQL Server database with Powershell

Today I will illustrate how to check whether data compression is enabled on your SQL Server. This script is highly flexible and you may adjust it to your liking. I will only concentrate on compression today, in the next installment I will show how to modify this script and get other things done on your database server. #This is how you comment in Powershell v.2 for big paragraphs <# Artem Ervits Database Services Group Check whether compression is enabled Ver. 1.0.1 01/04/10 Added prompt to enter server name Ver. 1.0.0 12/07/10 Initial Script #> #cls is an alias for clear screen cls #you may take input from a list of servers in your txt file but we’re going to concentrate on one server at a time right now. #$hostname = Get-Content "C:\servers.txt" echo "Please Enter Server Name:" #This next line will prompt you to enter a SQL Server N...

New Android developer

I am finally writing mobile apps people! I am happy to announce that I finally sit down to develop mobile apps based on Android. I have tons of ideas and no time to implement them all. My friend and big inspiration, Felix is the driving force behind this and I am picking his brains as well as providing him with app ideas. Stay tuned for release! --Artem

New Linksys E3000 stock firmware and DD-WRT support!

I was left out of aftermarket firmware game once I got a new Linksys router as a birthday gift. This is no longer a problem because DD-WRT now supports my E3000. I prefer Tomato firmware myself because I find it more stable but as they say, beggars can't be choosers. I also found that there were three more stock firmware updates available on the Cisco site. I have a new project to do! Tomato DD-WRT --Artem

Another reason to hide SSID

With recent news of Google collecting SSIDs and passwords while mapping Google Street View, comes this tip from Pauldotcom.com. Apparently, if you plug in the mac address that comes with SSID on a Google map, Big Brother can zero-in on your exact address. Add this to your long list of paranoia. Reconfigure your routers not to broadcast the SSID! --Artem

SQL Server on Solid State Disk

Hello, it's been awhile :)! I had a pleasure attending a workshop for running Oracle apps like PeopleSoft on SQL Server. Yes, there are shops that do that. The workshop also covered J.D. Edwards, Siebel and SAP applications on SQL. Even though I don't deal with any of these apps, I have learned a lot from just attending. Contact me if you would like to get the trainer's information. Anyway, the most amazing part of the workshop was when the instructor showed us his server setup at home. His Windows 2008 server contained SSD storage and one SQL Database resided on it. He ran an undocumented command BACKUP DATABASE DBonSSD TO DISK = 'NUL:' just to display reads that occur during backup and the speed was an amazing 1300 MB/s. Then just to show the difference, he ran the same command on a database that resided on local disk, the speed was 80MB/s. I am convinced! If you're interested, the SSD vendor is Fusion IO and I am sure you won't have a problem finding it. ...

You should watch Engadget Show with Steve Balmer

I watched the show the other day and came away really impressed. I hate to admit but I actually liked Steve somewhat. He was soft of honest and funny about Microsoft. He talked about Windows 7, Zune, Windows Phone, XBOX and other stuff Microsoft is busy with. It was a good interview. No chairs were harmed during the filming of the show...