Network manager broken after uninstall indicator network

After I test indicator network, i don’t like it. So uninstall indicator network by Synaptic Package Manager. But network manager can’t work after uninstall indicator. network manager alter “networking disable”.
I search some way to fix it, lots of ways are not good.

Here is my way to fix it:
Edit /etc/NetworkManager/nm-system-settings.conf
change “managed=false” to “managed=true
And uninstall “connman” in Synaptic Package Manager.

It works after reboot.

Ref: http://www.omgubuntu.co.uk/2010/05/help-test-ubuntu-10-10s-proposed-network-indicator-applet-ppa/

Get the size of data table in SQL Server

Get the row count and size of data table is very important in SQL Server.
These infomation about data table can select by stored procedure “sp_spaceused”.

usage of “sp_spaceused”: http://msdn.microsoft.com/en-us/library/ms188776.aspx

To get all table’s infomation by the following SQL:

CREATE TABLE #t(name VARCHAR(255), ROWS BIGINT, reserved VARCHAR(20), DATA VARCHAR(20), index_size VARCHAR(20), unused VARCHAR(20))
EXEC sp_MSforeachtable "insert into #t exec sp_spaceused '?'" 
SELECT * FROM #t ORDER BY name
DROP TABLE #t

based: http://www.cnblogs.com/drc/archive/2007/11/29/977189.html

Count file in Linux

Count file in a directory:

ls -l |grep "^-"|wc -l

Count file in a directory, include subdirectories:

ls -lR|grep "^-"|wc -l

Count subdirectory in a directory:

ls -l|grep "^d"|wc -l

Count subdirectory in a directory, include subdirectories:

ls -lR|grep "^d"|wc -l

Some experience about ZFS

ZFS is a good file system, it can manage lots of disks.
I have three 1G harddisks when I use ZFS beginning. In accordance with my experience, raid 5 is my first choice. Raid 5 is called raidz in ZFS. Suppose my pool is named nas, I created this pool by the following command:

zpool create nas raidz c9d0t0 c9d1t0 c9t2d0

After create pool, check the pool statu:

$ zpool status -v nas
  pool: nas
 state: ONLINE
 scrub: none requested
config:
 
        NAME        STATE     READ WRITE CKSUM
        nas         ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            c9t0d0  ONLINE       0     0     0
            c9t1d0  ONLINE       0     0     0
            c9t2d0  ONLINE       0     0     0
 
errors: No known data errors

It’s time to consider to expand the capacity when this pool is full.

After I get a 2G harddisk, I have two choice:
1.replace a old disk in the pool;
2.Add the new disk into the pool.

I wouldn’t waste a disk, so I choose the second.

I checked some document, raidz don’t support add a new disk to raidz. If I use the following command:

zpool add nas c9t3d0

the new disk will add to the pool by raid 0. It isn’t what I want.

So, the raid 1 + 0 is recommended in the future.
Create raid1 pool first. Create another raid1 and add the new mirror to the old pool by raid0, when it need to add new disks.