Command of the Week – sys_basher

I haven’t done a command in the week in such a long time that I hoped to semi resurrect into at least a monthly-weekly adventure.

The sys_basher command is an excellent tool to perform some tests on cpu, memory, and disk I/O reliability. The nice thing about it is you can just run the command and go without having to worry too much about the options.

If you choose to use some options, I’ve been doing the following to test memory on an old x4100 with 100 loops:

sys_basher -m -l 100

Keep the tool in mind when you want to stress test certain parts of your system.

Posted in software | Tagged , , | Leave a comment

Cool software to check out

Here are some software that I want to check out and play with when I have some time:

ansible – python to do tasks and plays distributively and fast with almost no learning curve.

drools planner – a way to solve cool problems like scheduling or traveling salesman

zend.to –  a clever way to stop scanning mail attachments and instead just upload it to a webpage. E-mail is not a file transfer protocol!

Posted in software, when I have time | Tagged , , | Leave a comment

AMS2300 upgrade to AMS2500 tip

Quick protip if you are going from an AMS2300 to an AMS2500, or even plan to in the future:

Leave 3U of space above the AMS2300.

The reason I say that is because the AMS2500 does not have any drive bays like the AMS2300. You will need to get an empty expansion shelf and transfer all 15 drives from the AMS2300 head to the empty one. If you don’t leave the space then you’ll have some extended downtime as all the shelves get reracked up 3U.

Posted in hardware, tips | Tagged , , , | Leave a comment

variables and quotes in bash scripts

I created the following function the other day because I also forget how the quotes and variables works in my bash scripts:


function printQuotes() {

        A="ASTRING"
        echo echo without quotes $A
        echo echo without quotes ${A} curly braces
        echo "echo quotes $A"
        echo 'echo single quotes $A'
        echo "echo quotes ${A} curly braces"
        echo 'echo single quotes ${A} curly braces'

}

Which results in:

echo without quotes ASTRING
echo without quotes ASTRING curly braces
echo quotes ASTRING
echo single quotes $A
echo quotes ASTRING curly braces
echo single quotes ${A} curly braces
Posted in software, tips | Tagged , , | Leave a comment

Compile Octave 3.6.2 for both CentOS 5 and CentOS 6

In the environment at my work, I usually have to compile newer versions of software for our clients to use. At the moment we have both CentOS 5 and CentOS 6 in production and I’d like to have to only compile a program only once and have it work in both.

Here’s what I did for octave/3.6.2:
1) Installed a bunch of dependencies on CentOS 5.8 box that I was missing:

sudo yum install ImageMagick-devel \
 gd-devel \
 glpk-devel \
 suitesparse-devel \
 qrupdate-devel \
 fltk-devel \
 qhull-devel \
 GraphicsMagick-devel \
 GraphicsMagick-c++-devel

2) Run the configure script and go! To get it to compile I had to remove the docs and curl section. I read somewhere on the mailing list that the versions of curl and zsh are too low and thus the issues. Last is the disabling of the hdf5, there’s a major version difference between CentOS 5 and 6 and causes octave not to work at all in 6.

tar -xvpf octave-3.6.2.tar.bz2
cd octave-3.6.2
./configure --prefix=/pkg/octave/3.6.2 \
 --without-curl \
 --enable-docs=no \
 --without-hdf5

3) Then the usual make and install:

make -j 2
make install
Posted in software | Tagged , , | 2 Comments

windows 7 gateway 0.0.0.0 from adobe software bonjour

This happened again at work and thought I would post the “solution” for future reference.

Problem: After an installation/update of an Adobe product, the Windows 7 desktop loses connecting to off the network. After doing an ipconfig, there was an additional default gateway of 0.0.0.0 set so that the user can’t access any computer off their subnet. Settings the configurations from dhcp to static doesn’t solve the problem for very long.

The “solution” was find on this microsoft forum and basically boils down to running cmd with Administrative privs and running the following:

"C:\Program Files\Bonjour\mDNSResponder.exe" -remove
Posted in broken and fixed, software | Tagged , , , | Leave a comment

ssh idle keepalive timeouts

I’v had to solve this problem a few times and thought that I would post it up here. The problem is basically that when ssh’ing into a machine in a remote location, sometimes your session will log off because a firewall or something in between is ending the connection.

The simple solution is to find the keepalive packet option and enable it on your ssh client.

On Windows using Putty:
I found the following configurations in the “Connection” section:
Seconds between keepalives (0 to turn off)
Enable TCP keepalives
Try setting it to 180 seconds and enabling the TCP keepalives.

On OSX:
Edit the /etc/ssh/ssh_config:
ServerAliveInterval 180

linux probably works the same as the OSX, but I’ve never actually ran into the problem on any of my connections.

Posted in software, tips | Tagged , , | Leave a comment

simple 1337 translator in python3

I’m playing around with some python3 and my little brother-in-law came up with the idea of a function that takes a string, does a 1337 translation on it, and returns it. I found the replace function that you can do with strings and came up with the following:

def eliteSpeak(word):
  leetWord = word.replace("e","3")
  leetWord = leetWord.replace("E","3")
  leetWord = leetWord.replace("l","1")
  leetWord = leetWord.replace("L","1")
  leetWord = leetWord.replace("o","0")
  leetWord = leetWord.replace("O","0")
  return leetWord

Granted I realized that I don’t know the 1337 speak conventions so I just did some simple replaces. Something like “Oh no, look out for the Listerine spillage.”

eliteSpeak("Oh no, look out for the Listerine spillage.")
'0h n0, 100k 0ut f0r th3 1ist3rin3 spi11ag3.'

If there’s a better way to do it, let me know. Oh btw, I used 2 spaces for formatting instead of tabs.

Posted in software | Tagged , , | Leave a comment

yum $releasever expands to %24releasever

Had this error when we were messing around with Centos 6.

ftp://ftp.server.com/pub/centos/mirror/%24releasever/os/x86_64/repodata/repomd.xml:
[Errno 14] FTP Error 550 : ftp://ftp.server.com/pub/centos/mirror/%24releasever/os/x86_64/repodata/repomd.xml

Couple of the trouble shooting steps I did was that I first straced it:

yum clean all
strace -f -o /tmp/yumoutput yum info gcc

I looked inside the /tmp/yumoutput and found that when yum would ftp to the mirror, it didn’t expand out the $releasever to be 6, but actually releasever:

20209 sendto(7, "CWD $releasever\r\n", 17, MSG_NOSIGNAL, NULL, 0) = 17

I got a ftp 505 error as a result and the fact is that /mirror/$releasever was not a valid path to the mirror. This path is defined in a /etc/yum.repos.d/local-mirror file and we are using the builtin variable $releasever so that we don’t have to update it every time the release changes.

My coworker found a page that includes a simple python script to run to get the releasever also:

python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'

Which resulted in:

Loaded plugins: fastestmirror
{'arch': 'amd64',
 'basearch': 'x86_64',
 'releasever': '$releasever',
 'uuid': 'a9aaaaa-6aa4-4aa0-a9aa-e2aaaaaaaa59'}

but really should result to:

Loaded plugins: fastestmirror
{'arch': 'amd64',
 'basearch': 'x86_64',
 'releasever': '6',
 'uuid': 'a9aaaaa-6aa4-4aa0-a9aa-e2aaaaaaaa59'}

There’s also the /var/cache/yum/arch folder and there was a $releasever folder in there.  Another indication that the $releasever was not expanding out.

We have set our Centos 5 servers to have the yum.conf setting for distroverpkg=centos-release-notes so that we don’t upgrade to the next minor point release on accident when yum updating. When we are good and ready to update, we change it to distroverpkg=centos-release and then do an update to the next point release. When we changed the distropkgver=centos-release in /etc/yum.conf, the yum just started to magically work. The python code translated the $releasever to be 6 instead of the text “$releasever” and I felt a sigh of relief at finding the problem.

The quest to find out why was next. Looking at the man yum.conf, I discovered this handy quote:

distroverpkg The package used by yum to determine the “version” of the distribution. This can be any installed package. Default
is redhat-release. You can see what provides this manually by using: “yum whatprovides redhat-release”.

Unfortunately, yum doesn’t work so I can’t use the command above. The following is the equivalent but using rpm query and using centos-release instead of redhat-release (which also works):

rpm -q --whatprovides centos-release

So here’s the result for my CentOS 5 box:

rpm -q --whatprovides centos-release
centos-release-5-7.el5.centos
rpm -q --whatprovides centos-release-notes
centos-release-notes-5.7-0

When doing it on the CentOS 6 server, I see the error:

rpm -q --whatprovides centos-release
centos-release-6-0.el6.centos.5.x86_64
rpm -q --whatprovides centos-release-notes
no package provides centos-release-notes

I checked the mirror, but wasn’t able to find any centos-release-notes for CentOS 6 so I may be out of luck until 6.1 comes out and the CR is removed or something else.

== Update 2012.04.22 ==

I forgot to up this post, but I found out awhile ago reading the centos release notes, that they removed the redhat-release-notes package and didn’t replace it with a centos-release-notes one.

Posted in software | Tagged , , , , | 4 Comments

touchpad pbworks power point presentations

We managed to get the HP Touchpad while it was on firesale and I couldn’t be happy about the cheap $99 investment we made. Unfortunately today, we noticed that the pbworks doesn’t allow us to successfully save a power point presentation that’s on their service. It just downloads a 207 byte file which is useless.

For now, we’ll just download it on a laptop, upload it to google docs, and then get at the presentation from there.

Posted in software | Tagged , , , | Leave a comment