Sharpen some skills with fun at Project Euler

December 25th, 2009

My coworker sent me this fun website of programming projects to do. They are math related so you know the formula to help optimize your solution, even better for you. Each project has a question that involves some mathematics and you get a submission form to submit your answer to see if you are right.

The website is at http://projecteuler.net/ and I really recommend anyone to register and go down the list of projects to do. I’m doing mostly in java at the moment but I would love to try using C# as well as some of the other variants built on java like groovy or scala.

So far I’m on project 3 and having a blast solving these problems!

what flash version am I running in my browser

December 9th, 2009

is a question I always ask myself. I have the following page bookmarked to find the answer:

http://www.adobe.com/software/flash/about/

Remove zfs filesystem from zone in solaris 10

December 5th, 2009

Sifting through some documentation, I couldn’t find a little walkthrough of how to remove a zfs filesystem from a zone. I’ve seen plenty of docs for adding zfs filesystems to zones. The process is very simple once I gave it a try:


$ mount |grep disk02
/export/disk00/zones/zonehost/root/export/disk02 on tank_001/zfs_fs_disk02/read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=4010008 on Thu Nov 19 15:28:20 2009

root@globalhost 13:23:24 /
$ umount /export/disk00/zones/zonehost/root/export/disk02

root@hostname 13:25:05 /
$ zonecfg -z zonehost

zonecfg:zonehost> info

fs:

dir: /export/disk02

special: tank_001/zfs_fs_disk02

raw not specified

type: zfs

options: []

zonecfg:zonehost> remove fs dir=/export/disk02

Running info again will show that there isn’t an fs anymore associated with the zone. Now exit back into the global zone and change the zfs mountpoint back from legacy to where your zf’s default mountpoint was before:

zfs set mountpoint=/tank_001/zfs_fs_disk02 tank_001/zfs_fs_disk02

Ubuntu Karmic Koala out tomorrow!

October 28th, 2009

By the time you read this you should head over to http://www.ubuntu.com and get the newest release of Karmic Koala!

I’ve been running the beta for awhile on my desktop and the new bootup is blazing fast. My computer has crashed a lot less as well which is a problem I’ve had since I built my computer.

I’m hoping to get the moblin karmic somehow to work on my little eee pc 901. We’ll see next week hopefully if I have time.

ignore files in git

October 28th, 2009

A common problem we have in our git directories are files that are generated automatically. You can do a simple thing to prep for things by creating a .gitignore file in the root of your git directory. For example here is one of mine:

generated.conf
*.swp
RCS/

In this example I do a couple things.

  1. ignore the file generated.conf that gets created nightly by a script.
  2. ignore all files that end with .swp. This is useful just in case I’m using VI on a file somewhere in the directory.
  3. ignore the folder named RCS. There’s some legacy still here ;) .

There you go! Enjoy ignoring those files. Check out the untrack files in git post I made awhile ago.

apache and php over nfs doesn’t work after a kernel patch in Solaris 10

October 14th, 2009

Now we are running 141414-10 but php files in directories not local (mounted via nfs) now don’t work. We get a 504 timeout problem when displaying the webpages. PHP files local to the server work fine though and html files mounted anywhere do to.

Looks like 141414-10 got obsoleted yesterday and removing this patch and 141932-02 did get things working again. I may try checking out the replacement patch of 141444-09 and see if it still causes the same problem.

patchrm 141932-02
patchrm 141414-1 did get things working again.

Hardware Virtualization Acceleration HP HDX16t

October 13th, 2009

is not supported by the BIOS! One of these was purchased recently and we decided to get the Intel Core 2 Duo P7550 which according to Wikipedia had at the time said it was a chip that supported VT. Of course it got changed after we ordered it on October 11th, line 403. Too bad the upgrade was $100 to this CPU when we really didn’t need it.

After talking with HP support they did offer to replace the laptop with the cheaper CPU that I would have got, but it was going to take too long to do the exchange, so I declined their offer. They also mentioned that this laptop will never have support for the hardware virtualization acceleration. If it’s a deal break, the Dell Studio XPS I believe have it in their BIOS and chips, but you should make sure before you buy it unlike what I did at HP.

Be a zfs ninja

October 12th, 2009

Finally get to watch Ben Rockwood’s “Becoming a ZFS ninja” talks. Go check them out now!

Now!
http://cuddletech.com/blog/pivot/entry.php?id=1075

Patch to solve problems

October 12th, 2009

For the last few months, our T1000’s have been randomly hanging in the morning time. The only solution was to reset the machine so it start working again.

After attempting to use scat to analyze the core dump, there was just too much information going on. We have 9 zones on these machines and at the time of the hang, there was over 3k processes. The next step was sending Sun the core dump and they quickly found the problem using scat!

Basically we had some nfs threads stuck in top_end_sync() and top_begin_sync() until we break’d and sync’d where it obviously stopped.

I was directed the following bug:
6710329 – ufs top_begin_sync, top_end_sync hang

And then the fix was already released in patch 139483-05 that is obsoleted by 139555-08. I was at the kernel revision below that one which means I could have been close to fixing it accidentally on the next patch cycle.

quick disk usage check

October 8th, 2009

Here’s a quick one liner for checking your disk usage your current working directory (cwd):

nice -n 19 du -ks * | sort -rn | awk '{print $1 "KB\t", $1 / 1024 "MB\t", $2 }'

Some sample output looks like:

5459316KB 5331.36MB 2008.11
4960112KB 4843.86MB 2009.06

Some notes:

  • Doesn’t check for hidden files/folders.
  • The $2 argument prints out the name of the file or folder, but if there’s a space in the name, it’ll only print whatever is before the space in the file.