Tuesday, June 5, 2012

Minor format tweaks to blog

aka: how to make your background image stay put using CSS

Someone mentioned that it would be nice if the background would stay put on my blog, so it was always there, rather than just at the top.

Since I'm in the process of learning html and css, figured I would see if I could do something about that.  Care to guess which CSS section I'm learning about right now? =-D

Before:
body {
background: #000000 url(<image_url_here>)  repeat-x scroll top center /* Credit for photo here */;
}

After:
body {
background: #000000 url(<image_url_here>)  repeat-x fixed top center /* Credit for photo here */;

}


I hope this makes the main blog a bit easier to read, and not seem like you're Lost in Space™ (weeeoooo!) when you scroll down.

I haven't been able to get the mobile working yet, so if you're looking at this on a too-smart-for-your-own-good phone and you know how to fix it, drop me a comment, please.  Or be patient; I should be there in a few more chapters :)

Also, I want to take this time to highly recommend www.murach.com.  They publish books that are excellent tools for learning technology, and are worth their weight in gold.  You won't find a better book for getting up to speed on a topic quickly, provided that they have a book that covers what you're looking for.

So, just in case anyone from murach.com is reading this, a few topics I'd like to request:
Perl, Python, Apache Administration, and testing automation.

In the meantime, if you're interested in those topics, stay tuned, I'll probably end up with something to "leak".

Monday, November 14, 2011

Method for cooking down Pumpkin

Hello again.  Been a while, been busy, and thought I'd write something unrelated to systems administration.

If you find this helpful, leave a comment.  Thanks for reading!

One of the things that has always frustrated me around Halloween was throwing out the pumpkin that was carved just a night or two ago.  If it's a reasonable size to carve, then you're talking about throwing out at least a couple of cans for each pumpkin.

If you've ever tried to cook pumpkin before, you know the amount of work involved, scraping out the insides (and getting seeds if you enjoy eating them), then cutting up the pumpkin to cook it, and trying to find a way to get the peel off without burning your fingers (I really hate that part), and then trying to turn it into puree.  So after trying several different things, here's what my wife and I have come up with.

This method minimizes the amount of work you'll have to put in, as well as any burns you might receive from handling hot pumpkin.

Stats for one pumpkin (reasonable carving size)
Total cook time: 2 hours
Total prep time: 1.5 hours w/ seeds, 1 hour w/o seeds
Total seeds: 1 cup (approx)
Total pumpkin yield: 1 quart

Step one: Cut pumpkin in half, seed, and scrape out stringy insides.

yes, getting the seeds can be a bit of a slimy mess, but if you enjoy eating them like I do, it's worth it.  For about 15 mins of work, you end up with about a cup of seeds per pumpkin, and they're easier to get out than sunflower seeds.

If you've carved your pumpkin, you've already gone through the process of cleaning out the inside, so just cut the pumpkin in half.

Step Two: Cut pumpkin into strips no more than 1" thick.

I find that holding the pumpkin with the outer shell towards you and pushing down on the handle end of the knife works well.  I also use the largest knife we have when doing this work.  Also, cutting a strip single that has the stem and the stub where the flower was (bottom) make it easy to remove these.

Step Three: With a vegetable peeler, remove the outer shell.

When I finally thought to do this, I was surprised how easy it was.  It's a bit more like peeling carrots than potatoes, and removes the shell quickly without much effort.  You'll want the peeler at an angle, rather than the whole blade flat on the pumpkin, or it will be harder to get started; once started, it's pretty easy to get under the shell.

Step Four: In a 6 qt pot, put in 1/2 cup water (enough to cover the bottom about 1/4"), and place the pumpkin in.  Cook covered for 1 hour over med-low heat.  Pumpkin is cooked when it cuts easily with a fork.

This helps to remove the water.  You'll start with 1/2 cup, but you might have to drain it a few times to avoid having it boil over.  You many also want to cut it into smaller pieces to get it into the pot (4-6" strips).

Step Five: Pack the pumpkin in a blender, mashing out as much water as possible.  Then, puree the pumpkin.

You can actually fit 1 whole pumpkin in a blender that holds a quart.  It is preferable to have a blender that also has a dispenser on the bottom, since this is the easiest way to get the pureed pumpkin out.  I use a potato masher to press the pumpkin in.  Also, you'll want to get as much water out now as you can, before you puree the pumpkin.

Step Six: Cook puree uncovered over med-low heat to remove water, stirring occasionally, until it makes a paste about the consistency of semi-thick oatmeal. (about 1 hour)

Your pumpkin is now ready to use in recipes (pie, scones, oatmeal, cookies, butter, etc.)

Friday, July 29, 2011

VTP on Cisco Switches in a Small Company (aka: my network just drops)

Sorry it's been a while.  Here's the most recent fun bang-head-here problem I was able to resolve.

Situation:

3 Cisco Switches in an office.  1x 3750, 2x 2960S

Every so often at random intervals, the network connections for all the clients would just vanish; connectivity through the main switch was fine (used Zenoss to monitor, only reported failure of the switches, and a printer beyond them), but couldn't get to any of the clients, and they couldn't use the network, let alone the internet.

Troubleshooting:
I tried everything I could think of to identify this problem.  checked spanning tree, checked logging to see if I could catch it (this was one of those really random problems, highly unpredictable), made sure the VLANs were set correctly, had Zenoss pulling snmp data for interface utilization % on the trunks, etc.

what I noticed was the following: graphs didn't show any vertical breaks, so the interfaces never went down, even though the network connections would drop.  This meant the switch was up, and there was no problem with the physical wiring, as well as the power to the switches.

after asking someone else more knowledgeable than me, he pointed me in the direction of VTP settings.

What I learned (they probably cover this in CCNA 101): VTP is a proprietary Cisco protocol used to simplify VLAN management on many many switches (think triple digits or higher), allowing Network admins to manage them all from one point.  Makes sense, cuts down the amount of mistakes and time to configure a switch fabric.  My problem was that the three devices that were installed in the company had not been configured correctly, and since they were all non-configured when they were added, they all became servers.  Apparently, they couldn't decide which switch was the authoritative switch, and when the switch designated as the true master would change, all the VLANs would be deleted off these switches, and then added back.  Net result was the switches looked like they were going down.  Highly unpredictable, highly annoying (to everyone).

Resolution:

Set the switches to VTP transparent mode.  commands were really as simple as:

log in
config t
vtp mode transparent
write mem

some things to remember are to check your vtp status to see where you are on a given switch (show vtp status), and that you need to make sure you are not using vtp pruning when you make the change.  The change does not prevent you from connecting to the switch (some reported a delay, but I didn't experience one), but if vtp pruning is in place, it can cause problems getting your clients to connect as you change switches in the environment.  Since the environment I'm in is so small, I just set vtp transparent, since I could set the vlans on those switches, and they would still forward vtp packets.

info that I used included the following:
https://supportforums.cisco.com/thread/2029581 (be sure to read the whole forum thread)
http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml (main page about VTP configuration and what it is and does)
http://www.cisco.com/warp/public/473/vtp_flash/
(this really helped with my understanding of VLAN Trunking Protocol, VTP; the first problem discussed is exactly what I was facing, called Problem #1, of all things)

something else I learned (again, probably CCNA 101) was that a good protection technique on making changes where you might possibly lose connectivity to a switch is to start with the following before you make your change:

reload in {mmm|hhh:mm}
<make your change>
reload cancel (after change is complete)

this allows you to work, and if something happens that you can no longer connect to the switch, it will reload the config that worked before you started.

I'm sure there are more knowledgeable networking folks out there, but this was how I solved this problem for the time being.  Simply putting this out there for anyone who could use it; like me when I run into this problem again. (=

Friday, May 27, 2011

Setting up SNMP on OSX 10 Xserve via SSH

setting up snmpd on MAC Server OS X via ssh

verify /usr/sbin/snmpd exists
 ls /usr/sbin/snmpd

verify /usr/share/snmp/snmpd.conf exists
 ls /usr/share/snmp/snmpd.conf

if snmpd.conf doesn't exist, run:
 /usr/bin/snmpconf -i (-i is required to write the file to the correct location)

    set the following options:
 
 default = all
 1 (snmpd.conf)
 1 (access control setup)
  3 v1/2c ro community name
   <ro_community>
  f
 4 (Agent operating mode)
  2 (system user agent runs as)
   root
  f
 5 (system information setup)
  1 (physical location of system)
   <system_location>
  f
 6 (trap destinations)
  2 (v2c trap receiver)
   <monitoring_system_ipaddr>
   [ENTER]
   [ENTER]
  3 (v2c inform receiver)
   <monitoring_system_ipaddr>
   [ENTER]
   [ENTER]
  5 (default trap sink community)
   <ro_community>
  f
 f
    q


starting snmpd:
 /usr/sbin/snmpd

restart snmpd:
 kill -HUP <pid>

finally, to make sure it runs at boot time:
=======================================================================================
from: http://scott.wallace.sh/2009/12/04/enabling-snmp-in-mac-os-x-10-6-snow-leopard/
---------------------------------------------------------------------------------------
Under Snow Leopard there is a slight change to the way services are enabled.
-w       Overrides the Disabled key and sets it to false. In previous versions, this
         option would modify the configuration file. Now the state of the Disabled key
         is stored elsewhere on-disk.

So, to enable the SNMP daemon correctly:
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
=======================================================================================

Monday, May 23, 2011

Configuring DNS Servers on OS X via SSH

Need to set up/change the DNS servers on a Mac OS X system, using SSH.  Command to use is networksetup.  For instance:

$ networksetup /?

for all it's gory details.

What concerns me today is just DNS config for the system.  So, without further adiou, commands are in bold:

user:~ localhost$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Ethernet 1
Ethernet 2
*Built-in Serial Port (1)
FireWire
user:~ localhost$ networksetup -getdnsservers Ethernet\ 1  (observe your character escape sequences)
192.168.1.10
192.168.1.9
user:~ localhost$ networksetup -getdnsservers Ethernet\ 2
192.168.1.10
192.168.1.9
user:~ localhost$ sudo networksetup -setdnsservers Ethernet\ 1 10.75.66.2
Password:
user:~ localhost$ networksetup -getdnsservers Ethernet\ 1
10.75.66.2
user:~ localhost$ sudo networksetup -setdnsservers Ethernet\ 2 10.75.66.2
user:~ localhost$ networksetup -getdnsservers Ethernet\ 2
10.75.66.2
user:~ localhost$

Friday, May 20, 2011

Making X work on RHEL/CEntOS 5 after VMWare P2V Import

Used the VMWare Standalone Converter running on my local machine to import a RHEL/CEntOS 5 Linux system, and afterward, was greeted with the following (this is cli, the gui had it's own errors):

-----snip-----
[root@qa01 ~]# startx
xauth:  creating new authority file /root/.serverauth.9175
xauth:  creating new authority file /root/.Xauthority
xauth:  creating new authority file /root/.Xauthority


X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: Linux 2.6.18-164.6.1.el5 x86_64 Red Hat, Inc.
Current Operating System: Linux qa01.localdomain 2.6.18-164.11.1.el5 #1 SMP Wed Jan 6 13:26:04 EST 2010 x86_64
Build Date: 16 November 2009
Build ID: xorg-x11-server 1.1.1-48.67.el5_4.1
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri May 20 12:28:27 2011
(==) Using config file: "/etc/X11/xorg.conf"
(EE) No devices detected.

Fatal server error:
no screens found
XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
      after 0 requests (0 known processed) with 0 events remaining.
[root@qa01 ~]#
-----snip-----


Some digging online led me to http://www.vmware.com/pdf/osp_install_guide.pdf

I realize it probably makes more sense to add the yum repo, but since I was in a hurry, I just pulled the files manually and did a local install.  The files I needed are listed below:

Files are located at: http://packages.vmware.com/tools/esx/4.1/rhel5/x86_64/

IMPORTANT!!! BUILD NUMBERS ARE CRITICAL!!!
      Make sure you get the build number for your version of VMWare and Guest OS

   vmware-tools-nox-8.3.2-257589.el5.x86_64.rpm

   vmware-tools-8.3.2-257589.el5.x86_64.rpm
   vmware-tools-common-8.3.2-257589.el5.x86_64.rpm

   vmware-open-vm-tools-8.3.2-257589.el5.x86_64.rpm
   vmware-open-vm-tools-common-8.3.2-257589.el5.x86_64.rpm
   vmware-open-vm-tools-nox-8.3.2-257589.el5.x86_64.rpm
   vmware-open-vm-tools-xorg-utilities-8.3.2-257589.el5.x86_64.rpm
   vmware-open-vm-tools-kmod-8.3.2-257589.el5.x86_64.rpm
   vmware-open-vm-tools-xorg-drv-mouse-12.6.4.0-0.257589.el5.x86_64.rpm
   vmware-open-vm-tools-xorg-drv-display-10.16.7.0-0.257589.el5.x86_64.rpm

Commands as follows:

wget http://packages.vmware.com/tools/esx/4.1/rhel5/x86_64/<package_name>
    (yes, this has to be done for each rpm)

wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

rpm --import VMWARE-PACKAGING-GPG-RSA-KEY.pub (this saves you from the --no-gpg-check)

yum localinstall <big_list_of_all_rpms_use_tab_complete>


So, now that you're done with all that, it's time to reboot.  Yes, this is needed (remember that kmod rpm you just installed?).  After the reboot, everything works with X just fine.

And now things work virtually like they did before.  (=

Tuesday, April 19, 2011

Setting up OpenFiler 2.3 for VMWare ESXi storage

so I'm looking to set up openfiler as a storage backend for VMWare ESXi, just wanted to include some notes here, since the examples I've found in the forums isn't what I wanted to set up (disk sizes were fairly small).

So, main thing to remember is that OpenFiler doesn't handle the automated partitioning of the hard drive you're installing it on.  Best info I've found on this (without purchasing the Manual) is on Greg Porter's Wiki.  He has much excellent info on Openfiler, and I would highly recommend reading through his info.  This list here is just intended to be a quick checklist of things that need to be done to get this set up.

really rough run-down:

1. Get disk set up in RAID 5 on Dell 2850 (or hardware of your choice), preferably in hardware RAID rather than software RAID.
2. Boot from Openfiler 2.3 install disk (x86_64 in this case.... what, you haven't downloaded it already? (=  )
3. Using Graphical install, manually partition the disk as follows:
       /boot : 100MB ext3, Fixed size, Force Primary
       / (root): 2048MB ext3, Fixed size, Force Primary
      swap : 2048MB swap, Fixed size, Force Primary
4. Finish install (time, root password, etc.)
5. update, update, update (I've had some issues with this from the webgui; however, per the last entry of this forum, using "conary updateall" from the command line worked just fine.)
6. see Greg Porter's Wiki about the iSCSI reboot issue to prevent your stores from vanishing from the network upon reboot.  Last thing you want is for your system to boot and your services to fail.

At this point, you should be able to log in to OpenFiler, configure your shares, and get rolling.