A few thoughts and notes.
Please visit A Fun Forum - MudnCrud.com.

RedHat – NIC Status

August 18th, 2009

ifconfig -a in RedHat does not provide link status sooooo.  After a bit of digging it turns out there is a cool tool that will.

# /sbin/ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes:
10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:
10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes

Ultra2 Backup Boot Disk Script

August 18th, 2009

This script is a bit crude but it does work if the system is not real busy.  Another solution is to use SVM and mirror the disks.  The problem there however is; if a disk is lost and the system goes down it will not come up since SVM needs a quarum (over half) with the metadb’s. 

 I use the below scipt plus dump a flar to another system.  I really need to convert this disk to cpio.

#!/bin/csh
#
# This script backs up the primary to secondary hard disk on an ultra class machine.
# c0t0d0 is the primary disk
# c0t1d0 the secondary disk
# s0 is / s3 is /var s7 is /work.

# This partitions the secondary disk to match the primary disk of same geometry.
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s – /dev/rdsk/c0t1d0s2

# Make backup directory mount points if not present.
if (! -d /root1) mkdir /root1
if (! -d /var1) mkdir /var1
if (! -d /work1) mkdir /work1

# Unmount the partitions of secondary disk if they are mounted.
if ( -e /root1/lost+found) umount /dev/dsk/c0t1d0s0
if ( -e /var1/lost+found) umount /dev/dsk/c0t1d0s3
if ( -e /work1/lost+found) umount /dev/dsk/c0t1d0s7

# Newfs partitions of the secondary disk.
newfs -v /dev/rdsk/c0t1d0s0 < /dev/null
newfs -v /dev/rdsk/c0t1d0s3 < /dev/null
newfs -v /dev/rdsk/c0t1d0s7 < /dev/null

# Mount secondary disks
mount /dev/dsk/c0t1d0s0 /root1
mount /dev/dsk/c0t1d0s3 /var1
mount /dev/dsk/c0t1d0s7 /work1

# Dump from primary to seconday
ufsdump 0sf 5000000 – / | (cd /root1; ufsrestore rf – )
ufsdump 0sf 5000000 – /var | (cd /var1; ufsrestore rf – )
ufsdump 0sf 5000000 – /work | (cd /work1; ufsrestore rf – )

# Install boot block on secondary disk
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0

# Update motd
echo `uname -rsvi`” Primary disk” > /etc/motd
echo “Backup copy on “`date` >> /etc/motd
echo `uname -rsvi`” Secondary disk” > /root1/etc/motd
echo “Backup copy on “`date` >> /root1/etc/motd

# Change /root1/etc/vfstab to enable boot disk1
sed ‘s/c0t0/c0t1/g’ /etc/vfstab > /root1/etc/vfstab

# Unmount backup disk.
umount /dev/dsk/c0t1d0s0
umount /dev/dsk/c0t1d0s3
umount /dev/dsk/c0t1d0s7

Sun – E450 Offline hot swap drives

August 18th, 2009

list drives

# cfgadm -al

unconfigure drive

cfgadm -c unconfigure c2::dsk/c2t3d0

verify

cfgadm -al   (the disk should no long be listed and can be hot swapped)

 For E250’s

# ssaadm remove_device c0t0d0s0

Solaris – find

August 18th, 2009

# cd /work && find . -type d -exec ls {} \;

find the approximate number of files/inodes
#find /work -xdev -exec ls -id {} + | cut -c-11 | sort -u | wc -l

find 20 larges files over 90 days old.

# find /work/ftp/local -mtime +90 -print -type f -exec ls -la {} \; | sort -r -n -k 5,5 | head -20

remove files older that 60 days.
# find . -mtime +60 -exec rm -f {} \;

find largest files within last 30 days
# find /work/ftp/pub -mtime -30 -type f -exec ls -la {} \; | sort -r -n -k 5,5 | head -40

list size of directory in MegaBytes
# ls -lR | awk ‘{total +=$5};END {print “Total size: ” total/1024/1024 “MB” }’

find the 20 largest files
# find /tmp -type f -follow -print | xargs ls -l | sort -r -n -k 5,5 | head -20

look recusivly down for any file >= to 1meg then list path

#find . -size 1000000c -ls  #

# find . -mtime -1 -type f -print
finds all files that have been modified within the last 24 hours

# find Members/ -type f -print0 | xargs -0 grep “examplestring”

find files by user

# find . -name SCCS -prune -o -print

In the above example the find command finds all files in the Members
directory each file that is found is then searched using grep for
the text “examplestring”

Fast alternative to cp -pr
# find . -depth | cpio -pdmv /path/tobe/copied

To find files owned by a user, please use the following command
# find . -user <USERLOGIN ID> -a -type f -print

Find SUID and SGID programs
# find . \( \( -perm -04000 -a -perm +011 \) -o \( -perm -02000 -a -perm +01 \) \) -print

Astroman – Lyrics

August 18th, 2009

 

 

Here I come to save the day

A little boy inside a dream just the other day
His mind fell out of his face and the wind blew it away
A hand came out from heaven and pinned a badge on his chest
It said Get out there, man, and do your best ooh…

They call him Astro Man
And he’s flyin’ higher than
That faggot Superman ever could

Oh, they call him Cosmic Nut
And he’s twice as dense as Donald Duck
And he’ll try his best to screw you up
The rest of your mind
Oh, regard my baby, come on!

Astro Man, flyin’ across the sky two times higher
than that old faggot Superman ever, ever could
Ever could, yeah
Ha

There he goes, there he goes
Where he stops, no one knows
There he goes, there he goes, ya…
He’s tryin’ to, tryin’ to blow out the rest of your mind
He’s gonna blow out the rest of your mind
Talkin’ about lookin’ for peace of mind
Astro Man will leave it in pieces
Have you put our trouble behind him, yeah
Make you fly around in pieces
Yeah, blow out the rest of your mind
Astro Man will blow out the rest of your mind
He’s gonna blow out the rest of your mind
hoo-hoo, ye-ye-ye-yeah… blow out the rest, blow out the rest of
your mind

Solaris UFS Sizing Checks

August 18th, 2009

df  – How much disk space is used

du  – lists disk usage
quot   – filesystem ownership and usage

# df -k /dev/dsk/c0t0d0s0, df -k /exports

du -k  — size in KiloBytes

du -s   — size in 512-byte blocks

du -a  — number 0f blocks used

list files size in reverse order

# du -ad /work | sort -nr

Number of files and space used by user

# quote -f /dev/dsk/c0t0d0s0

inode usage

# /usr/bin/df -F ufs -o i

List of the size of the dirs within a dir

# du -sk *

used files

#df -g /export | awk ‘/total files/ { t=$9 } /free files/ {f=$1} END { print t-f }’

list disks that have more than 9% disk space used

# df -kl | tr -d % | awk ‘/^\/dev/ {if($5>7){print}}’

Number of kilobytes free

# df -b

Detail list in 512 byte block

# /usr/xpg4/bin/df -P /work

If you can find a copy of xdu it is a nice graphic interpretation of what is hogging space

# du -k | xdu

Do not remeber where I stole this from or I would give credit

Find large files moved or deleted and held open by a process
# find /proc/*/fd -links 0 -type f -size +2000 -ls
Description
The total disk space displayed by df -k may not match the total of
du -k for the same file system, there may have been a file that was
deleted or moved when a running process still had it in use.

The OS can not actually delete the file until the process has
stopped. This command will display the file and the process id that
you can use to stop the process. Once the process has been
stopped the disk space will be freed.

Solaris UFS

August 18th, 2009

Create new file system

# newfs /dev/dsk/c0t0d0s0

Specify certain percentage of free space (minifree) upon filesystem creation

# newfs -m 8 /dev/dsk/c0t0d0s0

View minifree value for a filesystem

# fstype -v /dev/rdsk/c0t0d0s0

Change the minifree percentage on a filesystem

# tunefs -m 4 /dev/dsk/c0t0d0s0

Check Consistency of a file system

# fsck /dev/rdsk/c0t0d0s0

correct/repair consistencies of file system

# fsck /mountpoint

list alternative super blocks to boot from

# newfs -N /dev/dsk/c0t0d0s0

Boot from alternate boot block

# fsck -o b=32 /dev/rdsk/c0t0d0s0

Enable root login with ssh

January 17th, 2009

edit /etc/ssh/sshd_config

change PermitRootLogin to yes  (by default this is set to no)

svcadm refresh svc:/network/ssh

svcs -l ssh

Prior to Solaris 10 you must stop and start ssh

# /etc/init.d/sshd stop
# /etc/init.d/sshd start

Thanksgiving Weekend

December 1st, 2008

It was a nice Thanksgiving Day Weekend.
Thursday
The final ride of the Low Key Hill Climb series.  The ride started at 9:30 which meant getting up at 7 AM.  Mei had just returned from China and I was on the tail end of the flu so getting up was just a little problematic.  Once up and moving preparing for the ride and gearing up went quickly.

We arrived at the start with plenty of time to register, warm up and prepare.  Mike and Joan showed up.  Mike rode as part of team Mudncrud.  Joan rode on up ahead.

The start as always was aggressive.  I tend to fall behind then work in pulling people in.  I thought I was doing well, the main peleton had gone on ahead but I thought I was doing OK after that since I held my own after being dropped by the peleton on the first of the three hills that make up the Mount Hamilton hill climb.

Hill one establishes your over placement in the race.  Hill two and three is where the incremental adjustments take place.  I made my adjustments on hill three passing a dozen people or so.  Over all I thought that I had done well enough to break the median point.  But that just did not happen, my placement ended up just below the median once again.

In the overall 2008 Low Key Hill Climb standing I ended up 31 out of 127 men.  Mei ended up 4th out of 47 women.

Mei and I finished the day sharing a Hot Pot while watching the moving Phantom of the Opera.  Mmmm she is such a good cook.

Friday
was a little more casual.  We started late and made friends with one of the neighbors cats.  We then got dressed up and went and saw the performance Phantom of the Opera in San Francisco.  After the performance we went out for a nice bite to eat.

Saturday
Jeff Gilbert was in town and we had made plans to do some bolting down at the Pinnacles.  On the approach to our planned climb we started to gear up for the approach chimney when I realized that I had forgot my harness.  So we went down the slope to work on a kind of cool  looking line that looked “5.4”.

Jeff took the first lead.  Jeff did not want me to use my belt loops to belay so I rigged up a swamy out of a length of cordallet.  Jeff got up about 12′ or so and got to a cruxy section so he put in the first bolt from stance.

I put in the next two.  I felt good about the third bolt since I actually managed to climb above the bolt below and even climb above a couple of cams placed in pockets while wearing a swamy.  In addition we bolted from stance.  Just a little old school action.  Of course our 5.4 ended up a bit more 5.8.

Jeff put in the last bolt of the day while racing the sunset.  We were able to start the hike back with a bit of daylight but it was fairly dark when we got to the car.

Sunday
Last weekend while Mei was in China Derek, Leo and I attempted a Coe 10k.  We came up a mechanical short of success.  Overall that was a fun day and we came fairly close to success.

New day new ride, Mei was back in town so this time Mei, Derek and I went for the 10K.

The route Hunting Hollow, Coit Road, Grizzly Gulch, Spike Jones, Tim Trail, Grizzly Gulch, Dexter, Willow Ridge, Domino Pond, Cattle Duster, Grapevine, Coit Road, Mahoney Meadows, China Hole, Manzanita, Headquarters, Flat Frog, Middle Ridge, Poverty Flat, Jackass Trail, Poverty Flat, Corral Trail, Narrows, Mahoney Meadows, Lone Spring, Mahoney Meadows, Coit Road, Hunting Hollow.

All told we ended up riding a bit over 11K and riding just under 45 miles.  WhooHoo success.  The temps were real good even though it was a bit chilly in the morning and after the sun went down.  We managed to get all the way back down Coit Road before dusk settled in.  fairly close to the final paved road out we rode up on a couple pushing their bikes.  Mei had not picked up her mandatory piece of trash so she donated a CO2 cartridge that got the couple back up and running long enough for them to ride to the parking lot.

By the time we got to the parking lot it was dark and we were all very hungry.  Derek agreed to join Mei and I at Black Bear for a hearty celebratory dinner.  The fates punished Derek, he received his dinner a couple of minutes before they brought out our dinner.  Being proper he waited with a large plate of food in front of him until our food was also delivered.  We tried not to stare and salivate to much.

After dinner we went our separate ways.  Getting home around 9 PM we unpacked the car and showered.  Mei had one tick in her side we gently removed it and stuck it to a piece of tape but somehow it managed to escape in the middle of the night.

It was a very full weekend with a little bit of everything.

Republican Morality, aka I cannot tell a lie

September 4th, 2008

examples: Clipped from the news.

PALIN: “I have protected the taxpayers by vetoing wasteful spending … and championed reform to end the abuses of earmark spending by Congress. I told the Congress ‘thanks but no thanks’ for that Bridge to Nowhere.”

THE FACTS: As mayor of Wasilla, Palin hired a lobbyist and traveled to Washington annually to support earmarks for the town totaling $27 million. In her two years as governor, Alaska has requested nearly $750 million in special federal spending, by far the largest per-capita request in the nation. While Palin notes she rejected plans to build a $398 million bridge from Ketchikan to an island with 50 residents and an airport, that opposition came only after the plan was ridiculed nationally as a “bridge to nowhere.”

PALIN: “There is much to like and admire about our opponent. But listening to him speak, it’s easy to forget that this is a man who has authored two memoirs but not a single major law or reform — not even in the state senate.”

THE FACTS: Compared to McCain and his two decades in the Senate, Obama does have a more meager record. But he has worked with Republicans to pass legislation that expanded efforts to intercept illegal shipments of weapons of mass destruction and to help destroy conventional weapons stockpiles. The legislation became law last year. To demean that accomplishment would be to also demean the work of Republican Sen. Richard Lugar of Indiana, a respected foreign policy voice in the Senate. In Illinois, he was the leader on two big, contentious measures in Illinois: studying racial profiling by police and requiring recordings of interrogations in potential death penalty cases. He also successfully co-sponsored major ethics reform legislation.

PALIN: “The Democratic nominee for president supports plans to raise income taxes, raise payroll taxes, raise investment income taxes, raise the death tax, raise business taxes, and increase the tax burden on the American people by hundreds of billions of dollars.”

THE FACTS: The Tax Policy Center, a think tank run jointly by the Brookings Institution and the Urban Institute, concluded that Obama’s plan would increase after-tax income for middle-income taxpayers by about 5 percent by 2012, or nearly $2,200 annually. McCain’s plan, which cuts taxes across all income levels, would raise after tax-income for middle-income taxpayers by 3 percent, the center concluded.

Obama would provide $80 billion in tax breaks, mainly for poor workers and the elderly, including tripling the Earned Income Tax Credit for minimum-wage workers and higher credits for larger families.

He also would raise income taxes, capital gains and dividend taxes on the wealthiest. He would raise payroll taxes on taxpayers with incomes above $250,000, and he would raise corporate taxes. Small businesses that make more than $250,000 a year would see taxes rise.

MCCAIN: “She’s been governor of our largest state, in charge of 20 percent of America’s energy supply … She’s responsible for 20 percent of the nation’s energy supply. I’m entertained by the comparison and I hope we can keep making that comparison that running a political campaign is somehow comparable to being the executive of the largest state in America,” he said in an interview with ABC News’ Charles Gibson.

THE FACTS: McCain’s phrasing exaggerates both claims. Palin is governor of a state that ranks second nationally in crude oil production, but she’s no more “responsible” for that resource than President Bush was when he was governor of Texas, another oil-producing state. In fact, her primary power is the ability to tax oil, which she did in concert with the Alaska Legislature. And where Alaska is the largest state in America, McCain could as easily have called it the 47th largest state — by population.

MCCAIN: “She’s the commander of the Alaska National Guard. … She has been in charge, and she has had national security as one of her primary responsibilities,” he said on ABC.

THE FACTS: While governors are in charge of their state guard units, that authority ends whenever those units are called to actual military service. When guard units are deployed to Iraq or Afghanistan, for example, they assume those duties under “federal status,” which means they report to the Defense Department, not their governors. Alaska’s national guard units have a total of about 4,200 personnel, among the smallest of state guard organizations.

FORMER ARKANSAS GOV. MIKE HUCKABEE: Palin “got more votes running for mayor of Wasilla, Alaska than Joe Biden got running for president of the United States.”

THE FACTS: A whopper. Palin got 616 votes in the 1996 mayor’s election, and got 909 in her 1999 re-election race, for a total of 1,525. Biden dropped out of the race after the Iowa caucuses, but he still got 76,165 votes in 23 states and the District of Columbia where he was on the ballot during the 2008 presidential primaries.

FORMER MASSACHUSETTS GOV. MITT ROMNEY: “We need change, all right — change from a liberal Washington to a conservative Washington! We have a prescription for every American who wants change in Washington — throw out the big-government liberals, and elect John McCain and Sarah Palin.”

THE FACTS: A Back-to-the-Future moment. George W. Bush, a conservative Republican, has been president for nearly eight years. And until last year, Republicans controlled Congress. Only since January 2007 have Democrats have been in charge of the House and Senate.

“Stein says that as mayor, Palin continued to inject religious beliefs into her policy at times. “She asked the library how she could go about banning books,” he says, because some voters thought they had inappropriate language in them. “The librarian was aghast.” That woman, Mary Ellen Baker, couldn’t be reached for comment, but news reports from the time show that Palin had threatened to fire Baker for not giving “full support” to the mayor. ”

The official investigation into Gov. Palin’s firing of Public Safety Commissioner Walt Monegan. Steve Branchflower, the lead investigator, began trying to arrange a deposition of the governor days before her veep selection. And despite claiming executive privilege to shield requested emails, up until that point Palin had promised full cooperation with the probe.

Now, however, she is refusing to submit to questioning by Branchflower unless he and the legislative committee that appointed him agree to relinquish control of the investigation and turn it over to a state review board made up of three Palin appointees.

Yesterday, Palin took the unusual step of having her lawyer, Thomas van Flein, file an ethics complaint against her with the state’s Attorney General. This, she hopes, will lead the AG to give the investigation to the aforementioned state personnel board. Unless that happens, and Branchflower agrees to close down his investigation, she will refuse to testify.

Reported that her son is going into the military because he was given a choice by the judge- drug charge

« Prev - Next »