Monday, December 19, 2011

Find directory with biggest number of files / directories

Today we had a problem related with a number of files in a directory. We needed to find directories with a biggest number of files / directories in it. Here is a small shell script that will list directories and a number of files/directories in each directory.

find . -type d|awk {'print "echo -n "$1".\"\t\"; ls "$1"|wc -l"'} > /tmp/do; . /tmp/do|sort -k 2 -n -r |more

Explaining it a little bit:

"find . -type d" - find all directories bellow current directory
"awk {'print "echo -n "$1".\"\t\"; ls "$1"|wc -l"'} > /tmp/do" - generate a script that will print a directory name (echo -n), make ls in this directory and count a number of lines from ls (wc -l)
". /tmp/do" - execute generated script
"sort -k 2 -n -r" - sort the result using second column (-k 2) as numerical (-n) and in reverse order (-r)

Monday, February 22, 2010

iPhone takes too long to sync

After changing a notebook I got a following problem. My iPhone was taking an eternity to sync with iTunes. I made a restore - no solution. I made a restore as new iPhone - same problem. After googling a little bit I found that this can be related with "Sync Photos" option. At the moment that I disabled "sync photos" - my iPhone was synced in a couple of minutes.

Problem: iPhone is taking too much time to sync on Windows 7.
Possible solution: Try to disable "Sync Photos" option.

Sunday, November 8, 2009

VMware crashes after updating (upgrading) of host OS (to CentOS 5.4)

If you have in your hostd.log something like this:

Nov 07 21:19:12.648: Worker#23| Caught signal 6 -- tid 31543

this can be related with update(upgrade) of host OS.

After upgrading of a host OS (CentOS 5.3->CentOS 5.4) I got an issue - a guest OS started to crash. Searching around for a possible cause I found bug post in CentOS bug tracker. Seems that issue is related to glibc update (last version is glibc-2.5-42) and a fix is to downgrade to previous version on host OS (glibc-2.5-34).

To be sure that your downgrade of glibc worked - check the size of libc-2.5.so. I got an issue on downgrade (even with --oldpackage rpm was not willing to replace a libc), and that's why I lost some hours trying to figure out what is going on. So, be sure to check the size of the files after downgrade. It can save you some hours :)

Tuesday, August 4, 2009

Twitter tip

RT @ryancarson: Top tip: You can put a "+" on the end of any http://bit.ly link and see, real time, the pace at which that link is getting shared and clicked

Tuesday, July 7, 2009

VMware troubles

Well, I'm not a hardware guru, but from my experience I figured out the following:


Dell Servers + QLogic HBA + IBM Storage = troubles
Dell Servers + Emulex HBA + IBM Storage = working ok
Dell Servers + QLogic HBA + EMC Storage = working ok

Other one issue is:

Any server + Any HBA + Any storage - Fiber Channel Switch = troubles (unclean filesystem on Linux guests with EXT3 filesystem)

Monday, May 25, 2009

"Network Connection Closed Unexpectedly" error while using svn+ssh

If you got a "Network Connection Closed Unexpectedly" error while using svn+ssh (here is a nice HOWTO) then you should comment (or remove) "mesg y" in /etc/bashrc or in $HOME/.bashrc


Worked for me as a charm :)

Monday, February 16, 2009

iPhone speaker too low

Well, I got a simple accident - "Mozart Chocolate Liqueur" were split over my iPhone 3G. I quickly clean it out, but... Next day I noticed that my iPhone speaker was too low. I was not able to hear it ringing. After looking around for solution I found a post telling that this can be caused by dust. Seems that this is my case (ok, not dust, but a creamy liqueur...). 

So, I put some music on my iPhone and start carefully cleaning the microphone hole with a needle. After just a few holes I made on the "dust" - I was able to hear that volume had increased. So I finished up cleaning by putting a needle just a little into every tiny hole of the speaker protection and everything worked like a charm. My speaker volume came back to the normal level (or even louder).

Just in case that you have a doubt on which one is speaker and which one is microphone on your iPhone - here is a picture:

Wednesday, December 3, 2008

How to sync Google Contacts and Calendar with iPhone

I've been looking for some simple solution to sync Google Contacts & Calendar with my iPhone on the air (without syncing with my notebook). Finally I found a solution that seems to be working like a charm.



Setup process is quite simple and straigh forward. 

Friday, August 22, 2008

cfmenu and cfgrid overlap

If you are using <cfmenu> and <cfgrid> and you have an overlapping of the menu items by cfgrid header (a part of menu is hidden behind cfgrid header) you must add to your CSS a following style:


#myMenuId .yuimenu {
z-index: 300003;
}

This problem is caused by some "yui" CSS style with z-index set to 1, while grid related styles have z-index bigger than 200000.

Friday, July 25, 2008

ESX host not connecting to Virtual Center

We got following problem some days ago:

One of our ESX (version 3.5) hosts, after crash, was not connecting to Virtual Center (version 2.5).

Solution:
  • Restart management service on ESX host
service mgmt-vmware stop
service mgmt-vmware start
  • Restart Virtual Center service on Virtual Center server (stop/start on service VMware Virtual Center in Services)

One more stuff - if you have a lot of memory on your hosts (16 GB or more) I would recommend you to increment amount of console memory on your host to 800 MB. You can do this in "Configuration" tab for host in your Virtual Center console.