K3bert

It just is

Wednesday, May 6, 2009

syslog consuming 100% cpu - SOLVED!

Finally figured out. Can't explain how it happened, but I know what happened.

A couple of months ago, I dropped my MacBook and the hard drive froze. I was able to replace it with no issue. I went to install Leopard, but the DVD couldn't be read. So, I reinstalled Tiger and opened a support case...bottom line, when I dropped the laptop, the DVD can't read double density DVDs anymore.

Why is this significant? It's not, but part of the story.

When I took my laptop in because I couldn't get Leopard installed, the store installed via an external drive. The result from this upgrade was that the /etc/periodic/daily/500.daily was renamed /etc/periodic/daily/500.daily.applesaved and the original file was replaced with a new version.

When the periodic daily job was run, both files ran. The problem is that the 500.daily.applesaved file is for some reason not compatible. The line in the backed up file that was causing the problem was:

syslog -p -k Time lt -7d -o -k Time lt -3d -k Level ge 4 -o -k Time lt -1d -k Level ge 6


Don't know why it caused the problem, but it did. The full content of the file that was backed up follows. Once I removed the .applesaved file, it worked like a champ.

#!/bin/sh -
#
# @(#)daily 8.2 (Berkeley) 1/25/94
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
host=`hostname -s`
bak=/var/backups

echo "step 1"
echo "Removing scratch and junk files:"

if [ -d /var/rwho ] ; then
cd /var/rwho && {
find . ! -name . -mtime +7 -exec rm -f -- {} \; ; }
fi

# Clean up junk files.
#find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \
# \( -name '[#,]*' -o -name '.#*' -o -name a.out -o -name '*.core' \
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \
# -a -atime +3 -exec rm -f -- {} \;

# Clean up NFS turds. May be useful on NFS servers.
#if [ "${host}" != "localhost" ]; then
# find / -name .nfs\* -mtime +7 -exec rm -f -- {} \; -o -fstype nfs -prune
#fi

if [ -d /tmp ]; then
cd /tmp && {
find . -fstype local -type f -atime +3 -ctime +3 -exec rm -f -- {} \;
find -d . -fstype local ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
>/dev/null 2>&1; }
fi

if [ -d /var/spool/fax ]; then
echo "step 2"
echo "Removing scratch fax files"
cd /var/spool/fax && \
find . -type f -name '[0-9]*.[0-9][0-9][0-9]' -mtime +7 -delete >/dev/null 2>&1;
fi


# remove system messages older than 21 days
msgs -c

if [ -f /var/account/acct ] ; then
if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
echo "step 3"
echo "Gathering accounting statistics:"
cd /var/account
if [ -f "acct.2${gzext}" ] ; then mv -f "acct.2${gzext}" "acct.3${gzext}" ; fi
if [ -f "acct.1${gzext}" ] ; then mv -f "acct.1${gzext}" "acct.2${gzext}" ; fi
if [ -f "acct.0${gzext}" ] ; then mv -f "acct.0${gzext}" "acct.1${gzext}" ; fi
cp -pf acct acct.0
if [ -x /usr/bin/gzip ]; then gzip -9 acct.0; fi
sa -s > /dev/null
fi

#if [ -d /var/db/netinfo ]; then
# echo ""
# echo "Backing up NetInfo data"
# cd /var/db/netinfo
# for domain in *.nidb; do
# domain=$(basename $domain .nidb)
# server=`nicl -t localhost/$domain -statistics | grep tag | awk '{print $3}'`
# if [ $server = master ] ; then nidump -r / -t localhost/$domain > $bak/$domain.nidump; fi
# done
#fi

echo "step 4"
echo "Checking subsystem status:"

echo ""
echo "disks:"
df -k -l
echo ""
dump W

if [ -d /var/spool/mqueue ]; then
echo "step 5"
echo "mail:"
mailq
fi

echo "step 6"
echo "network:"
netstat -i

echo "step 7"
if [ -d /var/rwho ] ; then
ruptime
fi

echo "step 8"
printf %s "Rotating log files:"
cd /var/log
for i in system.log; do
if [ -f "${i}" ]; then
printf %s " ${i}"
if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
if [ -f "${i}.6${gzext}" ]; then mv -f "${i}.6${gzext}" "${i}.7${gzext}"; fi
if [ -f "${i}.5${gzext}" ]; then mv -f "${i}.5${gzext}" "${i}.6${gzext}"; fi
if [ -f "${i}.4${gzext}" ]; then mv -f "${i}.4${gzext}" "${i}.5${gzext}"; fi
if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}" "${i}.4${gzext}"; fi
if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}" "${i}.3${gzext}"; fi
if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}" "${i}.2${gzext}"; fi
if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}" "${i}.1${gzext}"; fi
if [ -f "${i}" ]; then
touch "${i}.$$" && chmod 640 "${i}.$$" && chown root:admin "${i}.$$"
mv -f "${i}" "${i}.0" && mv "${i}.$$" "${i}" && if [ -x /usr/bin/gzip ]; then
gzip -9 "${i}.0"; fi
fi
fi
done
if [ -f /var/run/syslog.pid ]; then kill -HUP $(cat /var/run/syslog.pid | head -1); fi
echo "done rotating"

# Prune the main syslog output file (/var/log/asl.log)
# Delete all messages after 7 days (-k Time lt -7d)
# Delete Warning (Level 4) and above after 3 days (-k Time lt -3d -k Level ge 4)
# Delete Info (Level 6) and above after 1 day (-k Time lt -1d -k Level ge 6)
echo "step 9"

syslog -p -k Time lt -7d -o -k Time lt -3d -k Level ge 4 -o -k Time lt -1d -k Level ge 6

echo "step 10"
if [ -f /etc/daily.local ]; then
echo "step 11"
echo "Running daily.local:"
sh /etc/daily.local
fi

if [ -f /etc/security ]; then
echo "step 12"
echo "Running security:"
sh /etc/security 2>&1 | sendmail root
fi

Labels: , , , , ,

add to: facebook del.icio.us

Sunday, October 26, 2008

Praise to Time Capsule

Last week, I dropped my MacBook in our living room. The net result? A failed hard drive. After a quick trip to Best Buy, I picked up a new drive and later that night had it plugged in.

I suspect why you would find that so amazing...well, it's not. The amazing part is my Super Drive worked with the original Tiger install disks but not Leopard. What the? Dropped in a The Matrix, and it worked. Now I'm really perplexed. I've heard so many good things about Apple support, so I give them a call. After a few troubleshooting steps, still could not resolve the issue and they created an appointment for me at my local Apple store, for the same day none-the-less!

I promptly arrive for my 5:45pm appointment and after some additional troubleshooting, the customer service rep declared something was wrong with my Super Drive. He gave me 2 options for getting it fixed, and needless to say both were the 1/4 the original price of the laptop. A third option he offered was to not fix it and pick up an external drive (this is what I'll do, seeing how that will only set me back about $125). The tech then offered to install Leopard for me from an external drive, which I did.

Thirty minutes later, I walked out with Leopard installed. But, what's so cool, while it was installing, we were chatting and came up with the hypothesis that the issue with my Super Drive was that it could no longer read dual layer DVDs. After all, I was able to install Tiger (single layer DVD) and not Leopard (dual layer DVD). Either way, I was very satisfied.

Now for the cool part. Thanks to my Time Capsule and Time Machine, I only lost 3 days of work, which I really didn't loose as I hadn't done any work in the three days.

So, kudos to Time Capsule + Time Machine, there is another satisfied Apple customer in me.

Labels: , , , ,

add to: facebook del.icio.us

Friday, October 10, 2008

And you think your system handles a high transactional volume?

My buddies at work always start chuckling when we look at some performance stats on our middle tier system. We proudly proclaim how we are pushing 5 transactions / second with a quarter second response time on average. This is all somewhat tongue-in-cheek, as we are very aware that this is child's play.

So, when I was reading the Amazon Web Services Blog about how they peaked out 70,000 transactions / second, I could help but laugh harder. Damn, I wish I had the opportunity to work on that type of system.

"Our customers are keeping S3 pretty busy too. To give you an example of what this means in practice, the peak S3 usage for October 1st was over 70,000 storage, retrieval, and deletion requests per second."
.

Goes to show just how small of a fish I really am in this big ocean.

Labels: , ,

add to: facebook del.icio.us

Wednesday, September 3, 2008

Getting free WiFi (when it isn't exactly free)

Came across a website discussing ways to work around WiFi at airports requiring you to drop $10 to use. I found it intriguing enough and thought I would share. I haven't tried it yet, but it makes sense. I think the hosting companies of wireless networks in public places will work fast to patch this up.

The premise of the work around is to exploit 303 redirects of images. If you can fake the browser into requesting an image instead of a web page, you avoid the redirect to the page requiring you to pay and viola, you have access to the internet without paying for it.

Thinking about it, this is an area of opportunity. When you are in the airport, they'll sign you up for a full day's access at any airport. Why not give a free 15 minute stint on the web so you can quickly check email. I would like the opportunity to check my emails, but don't want to pay the $10 for it.

Here's the how to: Hacking a commercial airport WLAN

Labels: , , ,

add to: facebook del.icio.us

Saturday, March 8, 2008

What I hate about the Internet is...having to select my credit card type

In case if you didn't know, you can determine the type of credit card, i.e., Visa, Master Card, Amex, and etc. by looking at the number you enter. The prefix and width (including spaces) for the major credit card types are:

CARD TYPES............PREFIX................WIDTH
American Express.....34, 37....................15
Diners Club..............300 to 305, 36........14
Carte Blanche...........38..........................14
Discover...................6011.......................16
EnRoute...................2014, 2149.............15
JCB..........................3............................16
JCB..........................2131, 1800..............15
Master Card.............51 to 55..................16
Visa..........................4...........................13, 16

Therefore, it stands to reason that by looking at the prefix of a credit card, you can derive the type of the card. And finally, as a programmer, I know that Verisign does not require you to send in the type, only the number itself and a few other bits of information.

Labels: , , , , ,

add to: facebook del.icio.us

What I hate about the Internet is...everyone wants you to create an account

It never fails...any website you shop on...they want you to create an account when you check out.

Why?

When I go to my local mall and buy something in my favorite shop, the store doesn't ask for my address, phone number, email address or any other personal information. Normal shopping experiences include an exchange of pleasantries with the sales person, handing over cash, debit, or credit card...and obtaining a receipt and walking away with the goods.

Why shouldn't shopping on the Internet be any different?

Labels: , , , , , ,

add to: facebook del.icio.us

What I hate about the Internet is...

While messing around on the Internet, again...I realized I was obsessing over the useability of the Internet and websites I visit. Most of the thoughts are along the lines of what could be better about websites, what sucks about websites, and what's missing. Therefore, I'm going to (but no promises on how often I will update) create a new series of posts regarding these very thoughts.

For the one person who reads my blog somewhat consistently, stay tuned for the first post.

Labels: , , , ,

add to: facebook del.icio.us

Saturday, January 19, 2008

Network Printing and Canon PIXMA MX310

Purchased the Canon PIXMA MX310 all-in-one office printer tonight and the heat was on to get it to work for the MacBook over a wireless network. I have the DLINK DPR-1260 wireless router/booster/print server which does not have any support for Mac OS X. Therefore, turned to the CUPS drivers in the Gutenprint project. As it turns out, Gutenprint does not have the exact driver for the PIXMA MX310, but you can use the MP-150 driver.

To get everything working, I did the following:
  1. Downloaded and installed the drivers
  2. Went to Print & Fax setup and added a new printer
  3. Selected HP Jet Direct - Socket for the Protocol
  4. Entered the address: 192.168.x.xx:9100 (9100 is the port assigned by the DLINK print server)
  5. Entered the queue name assigned by the DLINK print server
  6. Selected Canon PIXMA MP150 - CUPS+Gutenprint v5.0.2 in the Print Using box
Viola, I'm printing like a champ over the network from both our MacBook and PC system. Copying works great, faxing works great, but still have to figure out to get the scanner to work.

Labels: , , ,

add to: facebook del.icio.us

Sunday, January 13, 2008

ZFS File System...now that's big

As I surfed the Internet tonight, came across an article about the ZFS File System. Not being familiar with it, I did a bit of reading to learn more, as that is what one may due when trying to learn.  Anyway, looking on WikiPedia, I found an interesting assertion that frankly, made my head hurt.

If a billion computers each filled a billion individual file systems per second, the time required to reach the limit of the overall system would be almost 1,000 times the estimated age of the universe.

Wow, not that's a lot of data.  Makes you wonder how much it really is...ok, maybe not.

Labels: , , , , ,

add to: facebook del.icio.us

Saturday, December 29, 2007

Flight Status using Google SMS

Tonight, while reading through Lifehacker, came across a great post on checking flight status using Google SMS. Apparently, by sending a text message to Google SMS like "Southwest Flight 48", you will receive a message back with the status of the flight. As a frequent traveler, this is way cool.

Labels: , , , ,

add to: facebook del.icio.us

Friday, December 28, 2007

Unable to Connect to Windows XP Network Share from Mac OS X

Over the Christmas Holiday, I finally decided to take on the challenge on why I could not connect to a share on my Windows XP computer from my MacBook.

When I would try to go to Network -> Gandalf (my Windows XP machine name) and connect, I would receive an invalid alias error and ask if I wanted to fix or delete it. Trying to fix it lead to a dialog box to select a file...not knowing what to select, I canceled out of it. When I tried to delete the alias, I would receive an insufficient permissions alert to delete the alias.

To make sure I could access my Windows machine, I tried telnet and had no problem connecting. Therefore, I validated the credentials I was using were correct. After several hours of searching the web, I finally found the solution. The problem was with the Windows share. By default, Windows Professional uses a "simple mode" for granting permissions to the share. Don't confuse the share permissions with the directory permissions. Despite granting users ability change files in the share, I still couldn't access it.

The solution was to open Windows Explorer and go to Tools -> Folder Options -> View -> Advance Settings -> Uncheck "Use Simple file sharing (Recommended)". Then, after this, go back to your share and right click and select Sharing and Security -> Sharing -> Permissions and make sure the user account you are trying to access the share with is included in the Share Permissions List.

As it turns out, with Simple File Share Mode, Windows XP only grants the Guest user account access to the share which I disabled. By granting my specific user credentials to the share, viola, problem solved.

Labels: , , ,

add to: facebook del.icio.us

Wednesday, December 5, 2007

Dirty Santa

While catching up on my news today, read an article from the Associated Press about a Microsoft Messenger Santa bot talked dirty to kids. The Santa bot allows kids to chat with Santa through MSN Live messenger about what they would like for Christmas. Apparently, by directing the conversation the right way, you could get Santa to talk dirty to you. For example:

One of the publication's writers replicated the chat Monday. After declining the writer's repeated invitations to eat pizza, a frustrated Santa burst out with, "You want me to eat what?!? It's fun to talk about oral sex, but I want to chat about something else."

A Microsoft spokesman had the following comment about the bot:

Sohn said Santa's lewd comment was sparked by someone "pushing this thing to make it do things it wasn't supposed to do."

Now, if that isn't the response of a developer, I don't know what is.

Labels: , , ,

add to: facebook del.icio.us

Saturday, November 10, 2007

No keyboard found, press F1 to continue

Over the last week, been working to remove some spy ware, trojan horses, and other viruses that recently got onto my mother-in-laws computer. During one of the reboots, I got an error message during the system check:
No keyboard found, press F1 to continue.
Hmmmm, would like to if the keyboard was found.

Labels: , , ,

add to: facebook del.icio.us

Saturday, October 6, 2007

Humanized.com...putting the human back into customer support

From an earlier post, I raved about Enso, a product produced by Humanized.com. If you haven't tried out Enso and you work on a PC, you have to. It makes working on the PC easy by killing the need for your computer mouse! I love it.

I have installed it on all of my PC based computers, including my work laptop. The other day, I had just restarted my laptop for the first time after installing Enso and much to my dismay, the application crashed. Not only did it crash, it opened a window telling me it crashed and asked to send the information to Humanized.com. I nearly dismissed the window and had all but un-installed the software when I thought, what the heck, I'll go ahead and submit the information.

Then, within a few hours of my submission, I received an email! Yes, an email, with a real person on the end of it. After picking up my jaw from the floor, I read the email.

Hello Kevin,

Sorry Enso crashed for you. Thanks for reporting the bug. Enso needs to have access to your "My Documents" directory, because it stores its "learn as open" targets in a directory inside that one. It looks like your "My Documents" directory is on a network share (also known as a file server). Is that the case? If so, then if the network share is unavailable at the time that Enso tries to start up, this kind of crash will be the result. Some users have reported that restarting the server which hosts the network share fixes the problem. You might ask your network administrator to try doing this. In the long run, we need to fix Enso so that it won't crash in this situation, but will just quietly keep trying to read the directory until the network share becomes available. In the meantime, I'm afraid there's not much that you can do about the problem. Changing "My Documents" to point at a local directory on your hard drive would fix it, but I understand that this might not be an option for you.

Once again, I'm sorry for the inconvenience.
xxx xxx, Humanized, Inc.
I replaced the person's name with "xxx xxx" to respect the employees privacy. But yes, there is a real explanation to why the software crashed! I have now reconfigured the program to point to a local directory on my laptop and thanks to the outstanding humanized support I got, I am one happy customer. Oh, by-the-way, did I mention that Enso is free? Or at least the beta product is free. I didn't realize that there was a commercial product available, but now that I just found that out, I'm marching over right now to purchase their non-beta product Enso Launcher.

When was the last email you received from Microsoft offering an explanation to why a Windows crashed and subsequently reported to Microsoft?

Labels: , ,

add to: facebook del.icio.us

Tuesday, October 2, 2007

Death to the computer mouse

Today, I was very fortunate to come across a company that is interested in making computers more use able. What? How? Enso.

The What:
Having to change programs to perform simple tasks—for example, making a quick calculation, or looking up a definition—breaks your concentration, takes you away from the task at hand, and wastes your valuable time. Enso lets you do common computing tasks easier and faster than ever before. You get a huge productivity boost and a simpler digital life.
The How:
Enso is dead simple to use. You just hold down the Caps Lock key and type an Enso command, which is displayed in a translucent overlay. Once the command is typed, you simply release the Caps Lock key to activate it, and the overlay disappears. If you type fast, it all happens in a flash.
What does this mean? It makes using the computer, well, more useful. If you watch the video, the Atul Varma, the Vice President of the company, gives a real world example of when you are typing a letter to your mom and want to tell her about something you purchased. If you bought 4 widgets at $2.99, unless you are a mathematical genius, would need to get a calculator and type in 4 * 2.99. If you are using Windows XP, getting a calculator may mean using the mouse to move the cursot to Start -> Programs -> Accessories -> Calculator. Or, if you are really lazy, open the drawer of your desk, pull out your calculator that saw you through Algebra.

Ha! Finally, I found someone else that thinks there are better ways to use the computer. Download the software and find out how.

Labels: , ,

add to: facebook del.icio.us