All posts by bsdman

Currently working as an IT Manager. Worked for an OIT company as a Network Engineer in 2011. Worked for a Medical IT company as the Network Administrator 2009-2011. Worked as the Senior Systems Administrator at a computer reseller from 2005-2009. Worked as a Computer Consultant for several small companies from 2007-2009. Worked as a Computer Technician at a computer reseller from 2002-2004.

Install .NET 3.5 on Windows 8

We recently rolled out an image for Windows 8.1 for corporate use. Unfortunately some of the products that I use require .net 2.0+ to be installed. I remember from my Win7 days that I can simply go to Programs and Features, and then turn Windows features on or off, then select .net framework 3.5 (includes 2.0 and 3.0).

Unfortunately I was receiving the following error:

0x800f0906: “Windows couldn’t connect to the Internet to download necessary files. Make sure that you’re connected to the Internet, and click Retry to try again.”
0x800F081F: “The changes could not be completed. Please reboot your computer and try again.”

Dang. Work around (Thanks J3 and http://msdn.microsoft.com/en-us/library/hh506443(v=vs.110).aspx)

Mount the Windows Installation Image
Either pop in your windows 8.1 CD or double click on the ISO (running Windows 8+ allows you to mount ISO by double clicking, win7- needs some sort of ISO mounting kit)

Command Line Install
Open a command prompt with Admin credentials (run as admin if necessary)
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs

Explanation Of Arguments

/Online targets the operating system you’re running (instead of an offline Windows image).
/Enable-Feature /FeatureName:NetFx3 specifies that you want to enable the .NET Framework 3.5.
/All enables all parent features of the .NET Framework 3.5.
/LimitAccess prevents DISM from contacting Windows Update.
/Source specifies the location of the files needed to restore the feature (in this example, the D:\sources\sxs directory).

Rancid and Dell Switches

Running rancid for all of our cisco gear is pretty nice, but we’re acquiring more and more non-cisco (dell/F10) switches for our iSCSI 10Gb and 40Gb needs. Price is a major contributor to that shift.

Anyway, we needed to add Dell PowerConnect 8132 and 8132F switches to the monitor.

This is geared towards the Debian/Ubuntu install I did in an earlier post. Files are from GIT (https://github.com/dotwaffle/rancid-git/tree/master/bin)

Download the required bin files
cd /var/lib/rancid/bin
wget http://it.thelibrarie.com/utilities/dlogin
wget http://it.thelibrarie.com/utilities/drancid
chmod +x dlogin
chmod +x drancid

Edit the Rancid manufacturer file
nano rancid-fe
Under %vendortable add the Dell brand
'dell' => 'drancid',
Save and Exit

Open your router.db file
nano /var/lib/rancid/IMO/router.db

Set your switch in the database
your.dell.switch:dell:up
Save and Exit

Either run rancid or wait until your cron job kicks off
sudo -u rancid -H /usr/bin/rancid-run


****EDIT 4/2/14****
So I ran the dlogin/drancid against one of my Dell switches and was receiving the following error in my /var/log/rancid/newestfilehere:

exec failed router manufacturer dell: No such file or directory

Dang, that’s no good.

cd /var/lib/rancid/bin
./dlogin IPADDRESS_OR_NAME_OF_DEVICE

-bash: ./dlogin: @EXPECT_PATH@: bad interpreter: No such file or directory

Well that solves that issue.

nano /var/lib/rancid/bin/dlogin
Add this to the very top:
#!/usr/bin/env expect
Save and quit
./dlogin IPADDRESS_OR_NAME_OF_DEVICE

root@rancid:/var/lib/rancid/bin# ./dlogin fp-dell8132sw1
fp-dell8132sw1
spawn ssh -c 3des -x -l dellsw fp-dell8132sw1
The authenticity of host ‘fp-dell8132sw1 (10.20.209.000)’ can’t be established.
RSA key fingerprint is 0b:05:08:c1:00:e9:00:30:0d:00:00:00:00:00:00:00.
Are you sure you want to continue connecting (yes/no)?
Host fp-dell8132sw1 added to the list of known hosts.
yes
Warning: Permanently added ‘fp-dell8132sw1,10.20.209.000’ (RSA) to the list of known hosts.
dellsw@fp-dell8132sw1’s password:

FP-DELL8132SW1>enable
Password:********

Success!

And make sure you do the same to @PERLV_PATH@: bad interpreter: No such file or directory
nano /var/lib/rancid/bin/drancid
Add the following to the top of the file

#!/usr/bin/perl -w

Save and close
./drancid to verify

EDIT!!!
apparently my hosting company doesn’t like me having perl, python, or other scripts laying around in a directory with no index page. So here’s the tarball of the files:
Tarball of 3 files

BYOBU Infinite Scroll Fix

Installed BYOBU (easier for me to use than screen) on my security-onion
(http://blog.securityonion.net/2012/02/byobu-and-security-onion.html)
apt-get install byobu

Execute byobu
byobu
F9 and set Byobu to launch automatically

Configuration (Pre-12.04 Ubuntu)
byobu-config
Toggle status notifications
Scroll down space bar to disable the logo
Tab to apply and then exit

Configuration (12.04 and later Ubuntu)
byobu-select-backend
Select Screen

Using BYOBU
Control + a = start of menu (F9 for more settings)
Control + a, c = create a new screen
Control + a + a = last screen used
Control + a, 0 = screen 0
Control + a, 3 = screen 3

Weblog Super Cache Issue

On this site I run weblog with automatic updates enabled. I noticed, about a week or so ago, that I saw the following at the top of all of my pages:

define( ‘WPCACHEHOME’, ‘/home/bsdman/it.thelibrarie.com/weblog/wp-content/plugins/wp-super-cache/’ ); //Added by WP-Cache Manager

Well that’s less than fun, but I don’t really care enough to fix it. Unless that’s also screwing with the CSS and making it difficult to see the entire article under the theme I use… The scroll bar was present, but the bottom of the page cut off a lot of the instructions. Awesome.

Lots of searching and I find out that member “stealingsand” is very helpful. http://wordpress.org/support/topic/warning-wp-super-cache-caching-broken-the-script-advanced-cachephp-could-not

I performed the following:
SSH into your box
nano /weblog/wp-config.php

define( ‘WPCACHEHOME’, ‘/home/bsdman/it.thelibrarie.com/weblog/wp-content/plugins/wp-super-cache/’ ); //Added by WP-Cache Manager

This was listed at the top instead of after the ?php section. I just moved it down with the other defines, saved, and exited. Fixed!

iSCSI and iSCSIadm

On a development Oracle environment we were running Oracle (RHEL 6.x) on a Dell PowerEdge R510 server and connected via iSCSI to a SuperMicro NAS (Nas4Free 9.1.x) on a bonded 1Gb ethernet switch (LACP on Cisco). We then changed out the one SuperMicro NAS for an updated and larger NAS and reconnected to the Oracle environment. Unfortunately we also saw attempts to contact the old/retired NAS on iSCSI.

View all iSCSI sessions
iscsiadm -m session

tcp: [2] 10.10.0.137:3260,1 iqn.2013.us.temp.zfs.freenas1:disk0
tcp: [3] 10.10.0.138:3260,1 iqn.2014.us.temp.zfs.freenas2:disk0

Logout of an iSCSI connection
iscsiadm -m node --targetname "iqn.2014.us.temp.zfs.freenas2:disk0" --logout

Logging out of session successful

Discover all available iSCSI on a host
iscsiadm -m discovery -t st -p IPADDRESSOFHOST_ORGROUP

Login to all discovered iSCSI
iscsiadm -m node --loginall=all

Login to specific iSCSI target
iscsiadm -m node -T FQN_IQN:DISK_NUMBER -l -p IPADDRESSOFHOST_ORGROUP

Linux Copy Changed Files

I had a CentOS box that needed to backup files to another NAS system.

So I ran the following:
cp -rufT /source/dir/ /mnt/nas/dest/dir/
Everything copied without a hitch. I then edited one of the files and ran the copy command again. I was greeted with:

cp: overwrite ‘/mnt/nas/dest/dir/file’?

I forgot that CentOS, among other major providers, has an alias for the ‘cp’ command when running as root.

nano /root/.bashrc
Comment out the cp line
Rerun the copy command

Cisco Callmanager Custom Ringtone

I’ve verified the steps work (with some deviation required) for CM 4.x through 8.x

As I have access to both Windows and Linux, I have directions that may utilize either one of these platforms.

Save your file as a .wav. I ended up using VLC Player to convert/stream to a .wav file.

On linux (with sox installed)
sox -t wav MYWAVEFILE.wav -t raw -r 8000 -U -b 8 -c 1 NEWFILE.raw resample -ql

Next steps are not well described, but I may expand them later.

Open your callmanager web page
Login on the OS Administration portal
Grab the ringtone.xml file (mine was in the / dir) (TFTP files)
Edit this based on your current ring tone files (follow along like a template)
Upload both the newly edited ringtone.xml and the ringtone.raw
Login on the Unified Serviceability portal
Tools > Services Feature
Restart the TFTP service

Check your phone and verify you can see the new ringtone. I found that certain models (7940) didn’t like ringtones longer than ~5 seconds whereas others (7945) were totally fine.