Gnome-terminal cpu utilization fixed

Unix — Dillon @ 11:20 am

All of a sudden, gnome-terminal on Fedora core 2 was acting really strange. It was slow to open, slow to type, slow to close. Found a bug doc on redhat’s site although it was an older distro.

Eh, it’s worth a shot. Searched for the rpm on rpmfind.net.

Fedora ships with vte-0.11.10-5.1. So I upgraded vte with [root@fedora2 root]# rpm -Uvh [URL from rpmfind.net just like usual. The upgrade completed and immediately afterwards, gnome-terminal opened quickly again. I surprised that I didn’t have to restart X or log out of Gnome etc. Whatever was broken must have not been cached or in memory.

I guess I’m used to network type services like bind where you edit something and restart something and then the something works again. :)

Using sed to manipulate ctd type strings from Solaris

Unix — Dillon @ 1:47 pm

This is a very specific example. I found this tricky because regular expressions in sed isn’t the same as in Perl.

I wanted to take output from the format command in Solaris and just get a list of disks on the system.

I ran format and redirected the output to a file called disks.txt

– file: disks.txt –

0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0
/pci@1f,4000/scsi@3/sd@1,0
2. c1t32d0
/pci@1f,4000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf8ab02c,0
3. c1t33d0
/pci@1f,4000/SUNW,qlc@2/fp@0,0/ssd@w21000004cfb448ed,0
4. c1t34d0
/pci@1f,4000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf70fd3f,0
5. c1t35d0
/pci@1f,4000/SUNW,qlc@2/fp@0,0/ssd@w21000004cfa6efc4,0

Then I wanted just the ‘ctd’ names of these disks (ie: c1t35d0 being the last one).

– magical sed trick –

cat disks.txt | sed -n 's/\(.*\)\(c[0-9]*t[0-9]*d[0-9]*\)\(.*\)/\2/p'

This should output:

c0t0d0
c0t1d0
c1t32d0
c1t33d0
c1t34d0
c1t35d0

The one thing I can’t figure out is how to run format in a non-interactive way for scripting. It seems you have to resort to using the path_to_inst file. I did something like this in my humble project easylun.

More on samba, winbind on Solaris

Unix — Dillon @ 2:01 pm

Here’s how you can get the samba home directories to be created on the fly:

(more…)

samba, winbind and solaris

Unix — Dillon @ 3:17 pm

This is a repost for formatting

Winbind-Solaris Documentation
Naag Mummaneni getnag at rediffmail.com
Thu May 2 11:10:54 GMT 2002

Next message: Winbind-Solaris Documentation
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

——————————————————————————–

Hi,

I just configured my Solaris box to logon to my Windows 2k Domain after working on it for three days.I am sorry to say that I have found no documentation for setting up Samba-winbind on solaris.And I feel that a Prestigious opensource project like Samba shouldnt be blamed for this.So I modified the documentation that come with samba & prepared this one for “solaris” so that no other administrator will face problems that I did. I hope the Samba group will put this documentation part in the distribution.Please find the attached doc file for the documentation.

Thanks
Naag Mummaneni(getnag at rediffmail.com)
——————————————————–
(more…)

Samba3, winbind and active directory – how it looks when it’s done

Unix — Dillon @ 12:25 pm

There is lots of community information about how to setup winbind and Samba3 to move your *nix box towards a single sign on paradigm, but not much about what it actually looks like or how it operates in the end.

First, Samba. The point of this setup is to not to create a unix account for everyone who will use the network share/drive. In a large company, such a setup would make any System Administrator cringe. Our goal is to create a share that looks like a normal Windows file server that appears to be a part of a domain (as in, they don’t get some annoying login prompt when they use it); seamless integration is what we want.

So far this article is the best thing I’ve seen for a Samba3+Winbind+Active Directoy setup guide. In the end, I had a file share (called public) that I could browse to without a local UNIX login. Although I have a local UNIX account, logging in as DOMAIN\me was clearly seperate from my local UNIX account. This was a concern for me since I didn’t want a situation where the Domain Controller goes down and I can’t admin a box.

Samba3 can be setup so that home directories are created automatically when people browse to it. smb.conf has comments in it that help point you in the right direction.

Here you can see how it separates the DOMAIN homes from the ‘local’ homes. Neat idea of having a DOMAIN subdirectory. (please note that my Active Directory domain in this example is ‘DOMAIN’ and my username is ‘me’ both locally and on the AD domain ‘DOMAIN’)

me@box / $ ls -l /home
total 12
drwxr-xr-x   5 root    root  4096 Sep 29 14:41 DOMAIN
drwx------  26 me      users 4096 Sep 29 15:13 me

Then if you look at /home/DOMAIN:

me@box / $ ls -l /home/DOMAIN
total 12
drwxr-xr-x  3 DOMAIN+me   DOMAIN+Domain Users 4096 Sep 29 16:54 me
drwxr-xr-x  2 DOMAIN+bob  DOMAIN+Domain Users 4096 Sep 29 16:15 bob
drwxr-xr-x  3 DOMAIN+jane DOMAIN+Domain Users 4096 Sep 29 10:43 jane

Pretty neat. Winbind at work showing that home directories are owned as we might hope. /home/DOMAIN/me is shared to me only when I access the samba server logged in from my XP machine as the user DOMAIN\me. This is exactly like plain-vanilla samba home directory sharing.

Access control lists work also to provide NTFS-like security even from a windows machine. If you right-click on a folder on my samba server, set permissions on the permissions tab, you’ll see the acls if you use the getfacl utility.

The screen dump below shows that I (DOMAIN\me) created a folder named ‘blee’ and granted permissions to DOMAIN\bob just like a normal windows share. I didn’t set the ACL permissions using a UNIX box, thus proving that ACLs = NTFS type permissions.

me@box public $ getfacl blee
# file: blee
# owner: DOMAIN+me
# group: DOMAIN+Domain40Users
user::rwx
user:DOMAIN+bob:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:DOMAIN+bob:rwx
default:group::---
default:mask::rwx
default:other::---

Using gcj under gentoo

Unix — Dillon @ 3:54 pm

If you follow the instructions off of gentoo’s website (they are very good instructions) for x86 on 2004.1 then you end up with a system that doesn’t have gcj. Here’s what I did to get it working.
(more…)

Using Perl instead of awk or sed

Unix — Dillon @ 11:29 am

You want to use Perl to process things on the command line but you don’t want to write/save a file. You want to replace sed with something more clunky. :)


[user@server tmp]$ ls / | perl -e 'while (){ print $_; }'
bin
boot
dev
etc
home
initrd
lib
lost+found
misc
mnt
opt
proc
root
sbin
tmp
usr
var
[user@server tmp]$ ls / | perl -e 'while (){ print "/" . $_; }'
/bin
/boot
/dev
/etc
/home
/initrd
/lib
/lost+found
/misc
/mnt
/opt
/proc
/root
/sbin
/tmp
/usr
/var

Finding busy disks with iostat and awk

Unix — Dillon @ 2:40 pm

So you want to find busy disks in solaris? Maybe you want a quick iostat summary? Need an easier way to find slow disks? Getting percent busy info from iostat is easy with awk. Usually any disk with %busy greater than 0 (some people prefer >= 2) is a sign of a slow disk.


iostat -xcn|awk '$10 > 0{ print $10"%" " - " $11 }'

Or perhaps you want to see how many disks are considered ‘slow’ in your system:


echo `iostat -xcn|awk '$10 > 0{ print $10"%" " - " $11 }'|wc -l` out of `iostat -xcn|wc -l`

An example md.tab on an E450

Unix — Dillon @ 6:41 pm

The E450 has a potential of 20 internal disks, none of them labeled in any particular order (ctd numbers) and it was a pain to configure most of them as a big stripe.

Here’s the md.tab I created, note the u02 section showing how to string 7 disks (slice 2 is the whole disk) all together. Note that the line wraps aren’t shown so don’t recklessly copy and paste.

# Root Mirror MetaDevices
# root
/dev/md/dsk/d11 1 1 /dev/dsk/c0t0d0s0
/dev/md/dsk/d12 1 1 /dev/dsk/c0t1d0s0
/dev/md/dsk/d10 -m /dev/md/dsk/d11
# swap
/dev/md/dsk/d21 1 1 /dev/dsk/c0t0d0s1
/dev/md/dsk/d22 1 1 /dev/dsk/c0t1d0s1
/dev/md/dsk/d20 -m /dev/md/dsk/d21
# u01
/dev/md/dsk/d61 1 1 /dev/dsk/c0t0d0s5
/dev/md/dsk/d62 1 1 /dev/dsk/c0t1d0s5
/dev/md/dsk/d60 -m /dev/md/dsk/d61
# /export/home
/dev/md/dsk/d81 1 1 /dev/dsk/c0t0d0s7
/dev/md/dsk/d82 1 1 /dev/dsk/c0t1d0s7
/dev/md/dsk/d80 -m /dev/md/dsk/d81
# u02
/dev/md/dsk/d101 7 1 /dev/dsk/c0t2d0s2 1 /dev/dsk/c0t3d0s2 1 /dev/dsk/c2t0d0s2 1 /dev/dsk/c2t1d0s2 1 /dev/dsk/c2t2d0s2 1 /dev/dsk/c2
t3d0s2 1 /dev/dsk/c3t0d0s2
/dev/md/dsk/d102 7 1 /dev/dsk/c3t1d0s2 1 /dev/dsk/c3t2d0s2 1 /dev/dsk/c3t3d0s2 1 /dev/dsk/c4t0d0s2 1 /dev/dsk/c4t1d0s2 1 /dev/dsk/c4
t2d0s2 1 /dev/dsk/c4t3d0s2
/dev/md/dsk/d100 -m /dev/md/dsk/d101
# staging
/dev/md/dsk/d111 2 1 /dev/dsk/c5t0d0s2 1 /dev/dsk/c5t1d0s2
/dev/md/dsk/d112 2 1 /dev/dsk/c5t2d0s2 1 /dev/dsk/c5t3d0s2
/dev/md/dsk/d110 -m /dev/md/dsk/d111

tg3 problem and resolution on poweredge 2650

Unix — Dillon @ 8:43 pm

I had a flaky network problem where high loads (fast downloads from tux.org or sun.com) would cause a hang or complete drop of all network connections on the box. Originally, I had plugged in two CAT5 cables hoping that it would be one of the gbit ethernet ports but that had no effect.

When the network went down I was unable to ping or do anything network related until someone physically walked to the box and did a service network restart. It was quite annoying since this box was in a remote location.

The error message that appeared in /var/log/messages was:

Mar 17 16:45:14 {servername} kernel: tg3: tg3_stop_block timed out, ofs=3400 enable_bit=2

Eventually, I found (with help of a coworker) that the box was reachable when it was ‘down’ on the local subnet. I could ssh in from a box on the same subnet and fix the problem. Not a bad workaround but the crashing was fairly easy to produce. About 1 or 2 minutes of ~300KB (bytes, not bits) of fast downloading would cause the “Broadcom Corporation NetXtreme BCM5700 Gigabit Ethernet (rev 12)” to die.

This was running Fedora Core 1. I had a similar box (a poweredge 1750) that was running RedHat9 working fine. I was very confused because the linux kernels were very close in version numbers.

I googled and found many people with the same problem. In the past I’ve fixed problems like this by using a generic driver like `tulip’ or something. I eventually tried a different network driver in this vein of thought. My /etc/modules.conf file had

alias eth0 tg3
alias eth1 tg3

At the top, so I tried depmod e1000 which spit out a bunch of IRQ errors meaning that the driver couldn’t find the appropriate hardware. I tried bcm5700 which linux didn’t have compiled in by default. I wasn’t about to do a whole kernel recompile for one stupid driver. I tried e100 and it returned no errors. This was happy.

lsmod showed that e100 was loaded although showing “0″ in the “Used By” column. That’s ok. So maybe I can use the e100 driver for eth0 or eth1 … but this still didn’t explain why I was able to get to the box (on eth1) on the same subnet.

Then I found the answer which as of now seems to be the answer. netstat -nr shows this {ips changed to protect the innocent}:

[root@server /]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.0.0.96 0.0.0.0 255.255.255.224 U 0 0 0 eth1
10.0.0.96 0.0.0.0 255.255.255.224 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.0.97 0.0.0.0 UG 0 0 0 eth0

Note that 0.0.0.0 (the default route) is specifically going through eth0. Now it makes sense. So I changed alias eth0 tg3 -> alias eth0 e100, ran depmod -a, rebooted a few times and heavy downloads have been running smoothly for 27 minutes now.

I’ll update this if this solution turns evil. :} For now, the e100 is metal. \m/

« Previous PageNext Page »
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2012 SQUARISM | powered by WordPress with Barecity