Archive for September, 2007

Ad Blocking software might face some legal battles soon

Sunday, September 16th, 2007

Per this news article, it seems as though the next SCO-style legal fight could be over advertising, or more specifically, software that blocks ads from appearing.

What’s next, the AIAA sending you subpoenas because you run AdBlock Plus in Firefox? Rubbish.  I think this will be a very short-lived legal fight indeed. It’s one thing to violate TOS for a website, it’s another to go after customers. We’ll see how this pans out.

Until next time!

-LightningCrash

Use smbpasswd to change your Active Directory/Windows Domain password

Friday, September 14th, 2007

smbpasswd -U username -r domaincontroller

It’s that easy.

So if you’re a Linux guy stuck in a Windows workplace, there’s your solution, no RDP/VNC/VMware/walking over to Windows box needed!

Until next time,
-LightningCrash

Making Ubuntu boot in 19 seconds, pt2

Friday, September 14th, 2007

I wrote before about my experiments in Ubuntu boot times and mentioned doing a fresh install and just disabling the dhcp and network manager. I got a lot of good input and wanted to expand upon that.

Setup
My secondary workstation is a Dell GX270 with a 3.0GHz P4 processor, 1GB of RAM and a 40GB Seagate ST340014A hard drive. I blew away the existing install again, reinstalled Feisty with the default settings, specified my static IP, and updated via apt-get. The current kernel version is 2.6.20-16-generic i686.

Getting started
I installed bootchart via sudo apt-get install bootchart and rebooted. My boot time was 29 seconds.
My /etc/network/interfaces file again contained entries for eth1, eth2, ath0 and wlan0. I deleted all of these.
Again, the if-up, if-down, and pre and post-up had entries for wireless and avahi stuff i didn’t want, so I removed the following
sudo -s
rm /etc/network/if-down.d/avahi-autoipd
rm /etc/network/if-post-down.d/wireless-tools
rm /etc/network/if-pre-up.d/wireless-tools
rm /etc/network/if-up.d/avahi-autoipd
rm /etc/network/if-up.d/avahi-daemon
exit

I rebooted and checked my boot time again

I reprofiled my boot sequence, then rebooted: 23 seconds.

Sysv-rc-conf
At this point I installed and fired up sysv-rc-conf (sudo apt-get install sysv-rc-conf)
I disabled the following:

bluetooth
cupsys
hotkey-setup
hplip
powernowd
rsync
wpa-ifupdown

Boot time after removing the services: 22 seconds

At this point, bootchart seems to be limited by a few particular processes:
Disk-related:
khubd
scsi_eh 1
modprobe
rc

CPU Related:
udevd
ckbcomp
hald
Xorg

It looks like udevd is still loading wacom junk
sudo find /etc -name '*wacom*' -type f -delete
hehe, took care of that.
I also enabled concurrent shell scripts while I was at it.
Still at 22 seconds.
I cleaned up /etc/acpi, as there were a ton of modules loaded that I didn’t use: 22 seconds.
I installed prelinking and then rebooted: 22 seconds.
I blacklisted ipv6 and a handful of other modules that were loaded for no reason whatsoever: 22 seconds.
I reprofiled and rebooted: 20 seconds.
At this point it looks like readahead itself takes up about 5 seconds of uninterruptable I/O.

Now to try out some of the stuff that my readers posted.
mgarces said to try initNG. So I grabbed the deb files for initng and the initng ifiles from initng.org and did a dpkg -i initng*.deb
But it didn’t boot……so I googled and ran across this page. I followed the directions there and got it to boot. HAL is complaining and I don’t feel like troubleshooting it right now.
But wait, bootchart isn’t working either. Crap.
Oh, even better, eth0 didn’t come up.
sudo dpkg -r initng
sudo dpkg -r initng-ifiles
Bye-bye initng!

So I figured, why not play with the schedulers?
CFQ=22 seconds
deadline=23 seconds
noop=23 seconds
as=23 seconds

So, even now, nothing really helps.

Well, I’m really getting burned out, maybe there will be a part 3 for this sometime.

Until next time!
-LightningCrash

Getting Linux functionality on a Windows desktop.

Friday, September 14th, 2007

When I was forced to run Windows in a support environment, I was faced with a number of challenges. Mainly, how to get my favorite OSS functionality back in my Windows desktop. Luckily, there are many tools that can help you.
I’ll go through them in the order I usually install them on a Windows box, and add in some others that I’ve found and considered.

  1. BBLean
  2. BBLean gives you a Blackbox environment in Windows. I like BlackBox, especially in a Windows environment, and it’s probably the biggest visual indicator that you’re making progress in getting OSS on your Windows box.

  3. UnxUtils
  4. Oh how nice it is to have native GNU tools in Windows. I put the utilities into the Windows/System32 folder, renaming find.exe to gfind.exe, as Windows won’t let you replace find.exe (Who knew?)
    Notable programs in the package include dd, diff, grep, find, head, tail, gzip, gunzip, wc, tr, sed, gawk, and touch.

  5. Cygwin
  6. From Cygwin.com: “The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect.”
    Worth the install, definitely.

  7. GnuWin32
  8. GNUWin32 has Windows ports of GNU or other open source software. The list is much more comprehensive than UnxUtils, and you can pick and choose which packages you want to download. Useful if you want a native version of a specific tool not included in UnxUtils.

  9. PuTTY
  10. PuTTY gives you SSH to other machines, and also includes SOCKS proxying, port redirection, SCP, SFTP, and other useful tools for the command-line.

  11. BitVise Tunnelier
  12. This item isn’t GPLed, so it diminishes its value in my mind. However, if you need an easy client to just run a SOCKS proxy, do graphical SCP, or run SSH tunneling of any kind, the BitVise Tunnelier client is great for this. I don’t use it for CLI administrative tasks, as PuTTY does better terminal emulation, but it’s still very good at what it does. If you’re SSHed into a Windows box, it will let you do one-click, SSH Tunneled Remote Desktop sessions to the box you’re SSHed into. Which leads me to my next item….

  13. BitVise WinSSHD
  14. If you’re not a big fan of Cygwin but still want to SSH into a Windows box, get WinSSHD. This is a closed source SSH server for the Windows environment that runs as a service. It costs money, though, $40 for a personal license and $100 for a business license. This also only gives you 5 user licenses. Closed source, costs money, and a diminished value in my book. May be necessary for some, though.

  15. WinSCP
  16. If you wish they made a SmartFTP-like application to do SCP file transfers in Windows, you’re in luck. This program is open source and free as in beer. It’s definitely more secure than plain FTP, and the program is very polished. Tunnelier does some of the same things, but for large or complicated transfers, this is the way to get it done. Plus, Tunnelier is closed source.

  17. Unison
  18. There aren’t any particularly good Rsync options for Windows (except for via Cygwin), but Unison comes pretty close and brings you a lot of the same features. To synchronize folders, there is no other. Unison is also open source (GPL) and free as in beer!

You can find a veritable gaggle of other Open Source windows software via the OSSwin site. So if there’s something else you like in Linux but want in Windows, you might just happen to be in luck. We still don’t have Yakuake/Tilda or Compiz Fusion on Windows yet, but this will make Windows more tolerable for OSS geeks like myself, and give more functionality to the Windows power users.
That’s a Win/Win in my book.

Did I miss anything? If so, use the comments section to slap me upside the head.

Until next time!
-LightningCrash

batch rename with regexps

Thursday, September 13th, 2007

You may not know this, but when you browse to add photos to MySpace on Linux, it specifies *.jpg and a handful of other formats. This is perfectly fine in a Windows world, but MySpace must not remember hat Linux filenames are CASE SENSITIVE. So when I import photos to a folder and they’re all named IMG_0101.JPG, etc, they won’t show up in the MySpace upload form. So those 50 photos you want to upload of your last vacation won’t show up in the window.

So you try to use mv to rename them. Yes, mv will due globbing on filenames, but rename will do regexps.

cd ~/photos/dirwithphotos
rename 's/JPG$/jpg/' *.JPG

Done.
You can go further with it, too. For instance, if I want to rename the files, since they’re all named IMG_0203.jpg

cd ~/photos/icanhaslinux
rename 's/^IMG/icanhaslinux/' *
rename 's/JPG$/jpg' *

Easy enough, right?
You can do more, since you have the full suite of regexps available, but that’s just a start.
Grab the regexp cheatsheet and you can do even more unnecessarily complicated things!

woohoo!

Ubuntu no match for sex

Thursday, September 13th, 2007

I recently came across this article mentioning that Google searches for Ubuntu recently surpassed searches for Jesus.

At this point, I was curious. What else had Ubuntu surpassed?

Well, despite Ubuntu’s best marketing strategies, it has not surpassed sex, not by a long shot.
Ubuntu versus Sex - Google Trends

Ubuntu is very close to “friends” in search volume, however, and not too far away from “BMW.” The BMW is more likely to impress women than Ubuntu, though, so maybe you should skip the Linux User Group meeting and go to a BMW dealership instead.

How I loathe regexps….but wait….

Wednesday, September 12th, 2007

Well, I got frustrated with having to refer to documentation every time I wanted to do something with regexps, so I decided to find a cheat sheet. I hate regexps, but I love them too, you know?

Thankfully, www.ilovejackdaniels.com has a cheat sheet I don’t mind having. It’s more thorough than the others I’ve found and it comes in PDF and PNG formats. I had to print the PNG one, since evince printed the greys as solid black in the PDF version.

Anyway, check it out here.

I’ve been using regexps so much lately that I contemplated taping it over my second monitor. I settled for hanging it from the cube wall right next to it.

Until next time!

-LightningCrash

Enemy Territory: Quake Wars demo released, leaves Linux users out in the cold

Tuesday, September 11th, 2007

I was really excited to hear the the ET:QW demo was released yesterday. However, for reasons unknown, iD decided not to release Linux binaries of the demo.

But for as much as I like iD software’s products, and as much as I really, really want to play ET:QW, I’m not even going to consider buying it until there’s a release for the Linux platform.

I don’t usually take a hard-line stance on these things, but the only desktop I have that would even be capable of playing ET:QW is the centerpiece of all of the technology in my house, and I can’t “Just install Windows,” run ‘dd if=/dev/urandom of=/dev/sda’, or any other ideas you may have for screwing up my perfectly good build.

So you can take your Windows binary and shove it, oh tosser of the Vista salad. I’ll wait for the real thing.

Fortunately, the retail release should be followed in a few months by a Linux installer, so I only have to wave my middle finger in the air until, oh, November or December.

Analysis of 300 Digg top stories

Monday, September 10th, 2007

I wrote earlier about Digg Ubuntu headline analysis, but this time I decided to pull the top 20 pages of stories from the last year and run those through the counter. 300 stories later, here is the count of words within the headlines:

70 the
45 a
42 to
34 of
32 digg
25 you
25 s
22 in
22 and
21 pic
21 on
19 this
19 for
18 your
18 iphone
17 is
16 new
14 video
14 from
14 ever
14 apple
13 it
12 picture
12 i
12 google
12 best
12 amazing
11 t
10 how
10 d
9 with
9 website
9 firefox
8 why
8 what
8 vista
8 pics
8 not
8 free
8 at
7 like
7 kevin
7 have
7 buy
6 windows
6 should
6 one
6 most
6 james
6 gets
6 c
6 by
5 will
5 we
5 users
5 steve
5 right
5 photos
5 photo
5 my
5 make
5 mac
5 kim
5 jobs
5 ipod
5 if
5 dvd
5 drm
5 computer
5 as
5 an
5 all
4 worst
4 work
4 without
4 water
4 under
4 time
4 thing
4 that
4 system
4 so
4 shows
4 see
4 rose
4 riaa
4 pictures
4 photoshop
4 people
4 out
4 or
4 microsoft
4 launches
4 itunes
4 hacked
4 get
4 coolest
4 can
4 button
4 be
4 awesome
4 are
3 youtube
3 xp
3 world
3 woman
3 ve
3 up
3 unveils
3 tv
3 touch
3 store
3 something
3 sites
3 sign
3 show
3 seen
3 section
3 secret
3 save
3 re
3 pc
3 pay
3 page
3 over
3 other
3 old
3 no
3 net
3 needs
3 nbc
3 missing
3 me
3 list
3 linux
3 letter
3 laptop
3 key
3 internet
3 images
3 hd
3 got
3 good
3 geek
3 file
3 face
3 f
3 do
3 desktop
3 design
3 day
3 comment
3 comcast
3 colbert
3 cellphone
3 bill
3 b
3 anything
3 any
3 announces
3 almost
3 access
3 about
2 years
2 year
2 yahoo
2 would
2 worlds
2 wi
2 while
2 web
2 was
2 warning
2 wallpapers
2 w
2 use
2 ur
2 ultimate
2 two
2 tutorials
2 turn
2 tries
2 trick
2 traffic
2 totally
2 top
2 today
2 think
2 they
2 take
2 strangest
2 stop
2 stephen
2 stealing
2 steal
2 station
2 start
2 squad
2 space
2 some
2 site
2 shirt
2 search
2 screwed
2 screen
2 runs
2 revolt
2 results
2 responds
2 porn
2 plus
2 please
2 pirate
2 phone
2 perhaps
2 per
2 path
2 password
2 owned
2 own
2 open
2 online
2 officially
2 official
2 off
2 nsfw
2 now
2 nokia
2 nightmare
2 neighbors
2 need
2 myspace
2 music
2 mozilla
2 maps
2 makes
2 made
2 m
2 love
2 loses
2 look
2 logo
2 live
2 line
2 kill
2 kid
2 just
2 its
2 into
2 inside
2 idiot
2 high
2 hate
2 has
2 happens
2 had
2 hack
2 gmail
2 girl
2 gates
2 fun
2 found
2 first
2 fire
2 fiasco
2 fi
2 features
2 feature
2 every
2 effect
2 ebay
2 e
2 don
2 does
2 digging
2 desk
2 default
2 dear
2 cuts
2 customer
2 css
2 cracked
2 cover
2 could
2 cool
2 convert
2 connection
2 comic
2 com
2 color
2 cnet
2 clock
2 click
2 class
2 cheap
2 card
2 car
2 cake
2 but
2 business
2 building
2 build
2 browser
2 blue
2 blocked
2 billboard
2 been
2 back
2 around
2 anti
2 announced
2 animation
2 alex
2 again
2 ads
2 across

Some of the top items, when read in succession, are almost headlines in themselves!

Maybe next time I’ll pull a few thousand headlines. That sounds like a good project for tomorrow.

Edit: Trimmed off entries with only one result.

Xargs is your friend

Monday, September 10th, 2007

If you don’t know what xargs is, here’s the definition of xargs from Wikipedia:

xargs is a command of the Unix and most Unix-like operating systems which eases passing command output to another command as command line arguments.

It splits its often piped input at whitespaces (or the null character) and calls the command given as an argument with each element of the split input as parameter. If the parameter list is too long, it calls the program as often as necessary. It often covers the same functionality as the backquote feature of many shells, but is more flexible and often also safer, especially if there are blanks or special characters in the input.

This is often used in conjunction with the Unix commands find, locate and grep.

So, what can you do with xargs?

Well, let’s say you want to put up a torrent on a tracker, but you want to include a file with the MD5 checksums of every file. We’ll assume that the files you want to put on bittorrent are in /home/me/mytorrent/
To generate an MD5 sum of every file in the directory and dump it to a file, you can do the following:
find /home/me/mytorrent/ -type f|xargs md5sum >> /home/me/mytorrent/md5sums.txt

Now you’ve got a list of the MD5 sums for every file in the torrent you want to publish.

You can also use xargs to call grep to look inside files. For instance, if you’re editing a web page and you want to find all instances of a PHP class, you can execute the following:

find /home/me/mywebpage -name '*.php'|xargs grep -Hn adminClass

This will return a list of each file ending in php, and then for each item in the list, grep will check for the string adminClass. The -H flag will make sure that grep prints the filename in each match, and the -n flag will make grep print the line number as well.

xargs is an invaluable tool in command-line work because it prevents you from having to write a for or while loop in a shell script. xargs will run the command you specify on every line of output. Granted, find has an -exec capability, but xargs has its utility. Being slightly paranoid, you might like to check the output of a command before you pipe it to xargs or run an -exec in find. For instance, if you were removing everything in a cache directory, it would probably be better to pipe the find output to more first, and then after you have verified the output, you can pipe it to xargs rm -f -r

For usenet users, you can also use xargs to PAR check all of your files.

ls *.par2|xargs par -r

Windows users take heart, there is an xargs for windows in the Findutils package for Windows .

Have any other xargs tricks? Leave yours in the comments.