GURU4HP

Saturday, May 25, 2013

BlueScreenView - BSOD viewer


If you've used Windows for any length of time, chances are you've seen a Blue Screen of Death. You're lucky when it's only a bad driver and your system reboots politely. When you're unlucky, it could be something more serious, such as a hardware failure. Either way, it's a sign of system instability. Unfortunately, a BSOD is usually cryptic. Factor in the fact that Windows usually reboots itself automatically within a short period of time--with no assurance that you won't get the same error--and you can see the need for BlueScreenView v1.1.
BSV opens, displays, and interprets the data saved in minidump (*.dmp) files which are usually found in C:\Windows\Minidump after a BSOD. You must have Windows set to save a "small memory dump" which may be done in for My Computer\Properties\Advanced\Startup and Recovery\Settings in XP for instance. In XP, this is generally the default behavior.
Once you've pointed BSV at the minidump folder (you can't just drag and drop or open a minidump file with program) you'll be able to see the exact programs and dlls involved in the crash, all the dlls running at the time, or even a simulated BSOD. For experienced users this helps diagnosis the cause of the crash in a minimal amount of time. For less savvy users, you'll be able to tell the more-savvy user you're talking to on the phone more about what happened.
This little utility has found a home in my toolkit. I don't see as many BSODs as I used to, but when I do, BlueScreenView makes it a snap to see the dump info. Stay stable, my friends.

Download link: http://downloads.pcworld.com/pub/new//utilities/bluescreenview_setup.exe
at May 25, 2013 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Thursday, May 16, 2013

Time Machine for every Unix out there

Original article can be found here: http://blog.interlinked.org/tutorials/rsync_time_machine.html

Using rsync to mimic the behavior of Apple's Time Machine feature

rsync is one of the tools that have gradually infiltrated my day to day tool-box (aside Vim and Zsh).
Using rsync it’s very easy to mimic Mac OS X new feature called Time Machine. In this article I’ll show how to do it, but there is still a nice GUI missing – for those who like it shiny.

What Time Machine does

Time Machine makes a snapshot of your files every hour. The files are usually stored on a external hard drive connected to your Mac via USB or Firewire. Earlier Leopard versions (ADC preview versions) had the ability to make the backups to a remote drive (I’ve heard).
So if you lose a file, or did a devastating change to one of your files, simply go back in time until you find your file or a version that’s not corrupted.
Incrementally backing up all files every hour so that you can access them in reversed chronological order isn’t that hard with standard Unix utilities like rsync. The only missing thing is a nice GUI for which Apple is known to be quite good at.

Making full backups in no time every hour

You can use this method to make a backup every hour or every ten minutes if you like. There are many many features you can tune or configure to your own taste – excluding files that are larger than 1GB for example.
So, here the command to make the backup:
rsync -aP --link-dest=PATHTO/$PREVIOUSBACKUP $SOURCE $CURRENTBACKUP
Lets go through the parameters step by step.
  • -a means Archive and includes a bunch of parameters to recurse directories, copy symlinks as symlinks, preserve permissions, preserve modification times, preserve group, preserve owner, and preserve device files. You usually want that option for all your backups.
  • -P allows rsync to continue interrupted transfers and show a progress status for each file. This isn’t really necessary but I like it.
  • --link-dest this is a neat way to make full backups of your computers without losing much space. rsync links unchanged files to the previous backup (using hard-links, see below if you don’t know hard-links) and only claims space for changed files. This only works if you have a backup at hand, otherwise you have to make at least one backup beforehand.
  • PATHTO/$PREVIOUSBACKUP is the path to the previous backup for linking. Note: if you delete this directory, no other backup is harmed because rsync uses hard-links and the operating system (or filesystem) takes care of releasing space if no link points to that region anymore.
  • $SOURCE is the directory you’d like to backup.
  • $CURRENTBACKUP is the directory to which you’d like to make the backup. This should be a non-existing directory.
As said earlier, rsync has many many features. To exclude files over a certain size for example, use the option --max-size (unfortunately this is not available on the rsync version shipped with Mac OS X Leopard). The man page or the documentation can give you plenty of ideas in this direction.
So much for the theory of the most important command for our purpose. Here a simple script that makes an incremental backup every time you call it:
#!/bin/sh

date=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -aP --link-dest=$HOME/Backups/current /path/to/important_files $HOME/Backups/back-$date
rm -f $HOME/Backups/current
ln -s back-$date $HOME/Backups/current
The script creates a file called “back” appended by the current date and time, for example back-2007-11-13T22:03:32 which contains the full backup. Then there is a symbolic link called “current” which points to the most recent directory. This directory-link is used for the --link-dest parameter.
You should look at the --exclude parameter (or better, --exclude-from= parameter) and learn how to exclude certain files or directories from the backup (you shouldn’t backup your backup for example).
The script above only works on the local machine because making links on a remote machine needs some extra work. But not much:
#!/bin/sh

date=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -azP --link-dest=PATHTOBACKUP/current $SOURCE $HOST:PATHTOBACKUP/back-$date
ssh $HOST "rm -f PATHTOBACKUP/current && ln -s back-$date PATHTOBACKUP/current"
The -f parameter for the rm command is used to supress error messages if the current directory is not present, which would in turn prevent the link to be created.
To get that working you either use a public/private key authentication scheme or something else to avoid typing in your password. Another possibility is, of course, to mount the remote file-system on the local computer using the above script.
On my setup the script takes about 6 seconds to synchronize 46968 files and 29GB – this takes 20MB for the file structure (with no actual files to transfer of course). But afterwards, I have a complete backup of my system in a new directory.
On a much bigger setup (1.2 million files and 50GB of data) the backup takes about 30 minutes and takes about 3GB of space (just for links!), so it isn’t exactly free, but very convenient.
The space needed for the backup is determined by the shape of your directory structure. On the larger setup I have lots of Maildirs and a very deep directory structure so it takes much more space than my home-directory backup above. 3GB is quite a lot, but 20MB doesn’t hurt.

Advanced rsync parameters

Additional to the parameters described above, I usually employ a combination of these parameters in my backup:
  • --delete and --delete-excluded this tells rsync to remove files from my backups either if they are gone on my local machine, or if I decided to exclude them from my backup.
  • --exclude-from=FILE the file specified here is a simple list of directories of files (one per line) which should not be backed up. My Trash folder oder some .cache folders are candidates for this file.
  • -P is used to give more information on how far the backup is, and how many files are to be backed up. Additional it could resume an interrupted transfer (which doesn’t apply here because we create a blank backup each time we call the script).
  • -x this one is important because it prohibits rsync to go beyond the local filesystem. For example if you backup you Linux-root partition, you should not include the /proc directory because rsync will get stuck in it. -x excludes all mounted filesystems from the backup which is probably what you want in most cases.

Hard-Links

Each file in a directory is a link to the actual data on your hard-disk. The file-system keeps track of how many links to a area point, and only if the last link is deleted, the whole area gets deleted (in contrast to soft-links, these are pointers to the file-name, not the contents).
Here an illustration of two backups with three files each. File1 and File2 are the same in both backups, only File3 changed between Backup1 and Backup2. So in Backup2, File3 (changed) has to point to a different area than File3 in Backup1.

BTW, there is a nice project for Linux out there which provides the same functionality as Time Machine including a nice GUI which is also based on rsync and the procedure presented here.

The End

Credit: The initial idea for this approach came from Mike Rubel – rsync snapshots.
Also interesting if you have to cope with Windows: Optimal remote backups with rsync over Samba.
There are quite a few approaches out there which more or less do the same, but rsync is available on virtually every Unix out there (even the DSL with its 50MB footprint includes rsync). So using other tools might be more convenient, but I’ll stick with the omnipresent rsync.
rsync offers the possibility to store only the differences to the previous backup (using --compare-dest which should point to a full-backup instead of --link-dest). It then doesn’t make links to the unchanged files, it just leaves them out. This way you get an incremental backup without the “directory-overhead” of the --link-dest approach. But you have to be extremely cautious which one of older backups you delete because the newer backups just don’t contain some of these files (think of full-backups as checkpoints)! Using the --link-dest you can delete all backups but the last and you still got all the files, so I’m happy to pay 20MB per backup for this safety.

Full script

Here my full script with additional features:
#!/bin/sh

date=`date "+%Y-%m-%dT%H_%M_%S"`
HOME=/home/user/

rsync -azP \
  --delete \
  --delete-excluded \
  --exclude-from=$HOME/.rsync/exclude \
  --link-dest=../current \
  $HOME user@backupserver:Backups/incomplete_back-$date \
  && ssh user@backupserver \
  "mv Backups/incomplete_back-$date Backups/back-$date \
  && rm -f Backups/current \
  && ln -s back-$date Backups/current"
at May 16, 2013 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Saturday, March 9, 2013

Upgrade CentOS 6.x to CentOS 6.4

Upgrade with yum update

Official way to do upgrade:
yum update
Official way to do update is first clean all, second update glibc, yum, rpm and python packages and then update other packages like following:
yum clean all
yum update glibc* yum* rpm* python*
yum update

Reboot

reboot

Check CentOS 6.4 (Final) release info and Check your entire system

cat /etc/redhat-release
## Output ##
CentOS release 6.3 (Final)
Following needs redhat-lsb package
lsb_release -a
## Output ##
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.4 (Final)
Release:        6.4
Codename:       Final
at March 09, 2013 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Tuesday, January 8, 2013

NVIDIA @ CentOS 6.3 / Red Hat 6.3

Q: What is the proper procedure to identify, locate, & install the correct nvidia drivers for Centos 6 on a Lenovo W510?
A: Here's a quick sequence, to help the next person, of what I'd recommend, based on what I learned from this thread:

0. Test if you 'need' to install the nvidia driver:
$ locate libvdpau_nvidia.so ==> mine reported nothing found
$ cat ~/.xsession-errors ==> mine reported errors as shown below:
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Note: There should be a better test of 'need'; but this was my only indication that "I" needed the nvidia driver!

1. Identify your kernel version:
$ uname -r
REPORTED:
2.6.32-279.5.1.el6.x86_64
Note: I'm not sure how this is relevant, but somehow it is (I ask others to clarify for us).

2. Identify your graphics card
$ /sbin/lspci -nn | grep VGA
REPORTED:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT216 [Quadro FX 880M] [10de:0a3c] (rev a2)
Note: I'm not sure how relevant the [10de:0a3c] information is - but some sites indicate it's important.

3. Identify the latest version of the graphics drivers for that kernel version:
a) Go to Nvidia support http://www.nvidia.com/page/support.html
b) Go to download drivers
c) Enter the product type (Quadro), series (Quadro FX Series), and product (not found).
Note: The Quadro FX 880M didn't appear on this list, so I 'chatted' with Nvidia support.
Eventually Nvidia support pointed me to the latest available driver version here:
http://www.nvidia.com/object/linux-display-amd64-304.37-driver.html
Note: You'll compare this latest version & support information with the latest available at El Repo in the next step.

4. Compare the Nvidia version with the latest available El Repo version:
http://elrepo.org/tiki/Driver+Versions
Note: Search for "nvidia" and you'll find the latest version to be "nvidia 295.40".

5. Enable the El Repo repository (if not already installed):
$ sudo rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
$ sudo rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm
Note: Skip this step if El Repo is already enabled.

6. Install that latest version from the El Repo repository:
$ sudo yum --enablerepo elrepo install kmod-nvidia
$ sudo yum --disablerepo=\* --enablerepo=elrepo install nvidia-x11-drv-32bit
Note: Do not install from the ATrpms repository!

Or, if you want the absolute latest in the El Repo testing repository:
$ sudo yum --enablerepo elrepo-testing info kmod-nvidia
$ sudo yum --enablerepo elrepo-testing install kmod-nvidia
$ sudo yum --disablerepo=\* --enablerepo=elrepo-testing install nvidia-x11-drv-32bit

7. Reboot

8. Test if you have installed the correct driver:
$ locate libvdpau_nvidia.so
NOW REPORTS:
/usr/lib/vdpau/libvdpau_nvidia.so
/usr/lib/vdpau/libvdpau_nvidia.so.1
/usr/lib/vdpau/libvdpau_nvidia.so.304.37
/usr/lib64/vdpau/libvdpau_nvidia.so
/usr/lib64/vdpau/libvdpau_nvidia.so.1
/usr/lib64/vdpau/libvdpau_nvidia.so.304.37

$ cat ~/.xsession-errors
No longer reports VDPAU errors.

QUESTION:
Is there a better way to test for the lack of the right driver & for the correct installation of the right driver?
at January 08, 2013 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Thursday, December 27, 2012

Introduction: Scripting your Brocade Fibre Channel switches

HOW-TO collect data from multiple brocade switches

Got tired as a SAN administrator after logging into all your Fibre Channel switches to perform just one configuration change? Well, I did and I decided to find a way to perform basic configuration tasks by script.
We all know how to remotely manage a Brocade fibre channel switch. If you have lots of time, you are using the WebTools. If you have only minutes left during a working day, you know almost all FabOS commands by heart, connecting to the switches using ssh.
On the top of my wishlist was the possibility to schedule an upload of the switch configuration. That’s why I started with this little project. At least the start was very easy. After spending several hours using ssh to connect to the switches the command to save the config was rapidly written down:
configupload -all -ftp 10.0.0.1,configupload,fcswitch01-today.txt
(For testing purposes the account configupload is configured without a password.)

That’s the beginning. Let’s now connect to the switch to execute this command. I choose to use Expect as a programming language. With this language it is very easy to respond on interactive commands, like snmpconfig. The idea is to build a framework, that can be used for all kinds of commands you can execute on a fibre channel switch. In Expect, you can connect to a Brocade switch using ssh with the command
spawn ssh -l admin fcswitch01
The nice part of Expect is in my opinion, you can describe what you will see. So what will happen, when setting up a ssh connection to fcswitch01 using the account admin? You will be asked to enter your password. So you can describe that as follows.
expect "*password: "
Now you can send your password within the script.
send "password\r"
The \r represents a hard return. If the password of the admin account is really “password”, you now will be logged on into the switch.
Again, you have to describe what the output of the ssh terminal, would be if you logged on by yourself. Afterwards, you can issue the command you want to execute. Finally you have to exit the session in a decent manner. This would be scripted as follows.
expect "*admin> "
send "configupload -all -ftp 10.0.0.1,configupload,fcswitch01-today.txt\r"
expect "*admin> "
send "exit\r"

At this point we have written a script that allows us to upload a switch configuration of a particular switch. Unfortunately a fibre channel SAN mostly consists of multiple switches. We don’t want to have one script per switch. We need to use some variables in the script and make the script more general. Besides that, I don’t think the presence of the account and the password in the script is a safe way.
To enhance the script, I usually use three text files. One is containing all the switches in the fabrics and the file is called switches.txt. For naming purposes I make sure name resolution is working for the switches. If customers don’t want to add them to DNS, I always edit the hosts file of the management server. A second file user.txt only contains the account used for login. In the third file password.txt the associated password is written.
The three files are opened read-only at the first three lines of the script:
set file [open ~/tools/switches.txt r]
set pass [open ~/tools/pass/password.txt r]
set account [open ~/tools/pass/user.txt r]

The user and password are put into a variable, so we can use that variable in the script. We use the command gets for it. gets reads one line of the text file.
gets $pass admpw
gets $account admin

Next to do, is to go to the file switches.txt and read one line after another and perform some actions to the switch. That is done in the following way.

while 1 {
if {[gets $file fcsw] == -1} break
commands
}
At the end I usually declare another variable in which the current date is set. I will use this date in the filename for the switch config.
set date [timestamp -format %Y%m%d]
When we combine al this programming, we will get the following script. I normally use this script every night to have a daily backup of all switch configurations.
set file [open ~/tools/switches.txt r]
set pass [open ~/tools/pass/password.txt r]
set account [open ~/tools/pass/user.txt r]
set date [timestamp -format %Y%m%d]
#--
gets $pass admpw
gets $account admin
#--
while 1 {
if {[gets $file fcsw] == -1} break
#--
spawn ssh -l $admin $fcsw
expect "*password: "
send "$admpw\r"
expect "*$admin> "
send "configupload -all -ftp 10.0.0.1,configupload,$fcsw-$date.txt\r"
expect "*$admin> "
send "exit\r"
}

The beauty of this script is maybe not the programming, but the reusability of it. Replace the command of the configupload with any other command you need to execute. This is a very fast way to make sure you have consistent configurations of all your switches. I will attach a script in which snmp settings are configured. You can also see how you can deal with interactive commands also with Expect.

at December 27, 2012 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Tuesday, December 11, 2012

HOW-TO: Qualcomm Gobi 2000 under linux


yum -y install gcc
cd /tmp
wget http://www.codon.org.uk/~mjg59/gobi_loader/download/gobi_loader-0.7.tar.gz
tar xvzf gobi_loader-0.7.tar.gz && cd gobi_loader-0.7
make && sudo make install
cp /lib/udev/rules.d/60-gobi.rules  /etc/udev/rules.d
/

Now you have to get the firmware images from the Lenovo website. This is a windows executable- get the latest and greatest directly from the Lenovo support page or here. You will have to extract the contents - either you have a Windows(R) machine running somewhere, or use wine for it...  yeah, I know...

The installer will extract the firmware files into %Program Files%\QUALCOMM\Images\Lenovo\.

Now you will see several directories named 0-12, and UMTS. According to the information found on this thinkwiki page, they break down as follows:

Dir Image Dir Image
0 Vodafone Image 1 Verizon Image
2 ATT Image 3 Sprint Image
4 T-Mobile Image 6 Generic UMTS Image
7 Telefonica Image 8 Telecom Italia Image
9 Orange Image 12 DoCoMo Image
UMTS Default Firmware

Now, use your imagination to get the best out of your WWAN - for me the UMTS ran fine on 5 not listed (south-, centralamerican and asian) operators, too - but that may vary. Obviously, should your operator be listed, choose the according directory and then substitute below's with your favourite directory "id" (e.g. 2 or 12 or UMTS or...):

http://www.thinkwiki.org/wiki/Qualcomm_Gobi_2000

how to activate GSM modem:

/lib/udev/gobi_loader -2000 /dev/ttyUSB0 /lib/firmware/gobi
 
at December 11, 2012 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Friday, November 9, 2012

WR1043ND OpenWRT Hacks

If you are interesting how you can tweeak you WR1043ND route under OpenWRT, you can check this link:

http://knowhow.bart.prokop.name/install/openwrt/wr1043nd
at November 09, 2012 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...

  • How to shutdown 3PAR
    I recently did the power down of a datacentre containing a 3PAR and wanted to quickly cover off the steps that I followed to power off and...
  • Reset iLO4 certificate
     During troubleshooting of issue at my customer in OneView, I have noticed that there is a SSL certificate issue with one of iLO4 of BL460ge...
  • HP ILO SSL_ERROR_BAD_MAC_ALERT Firefox Chrome
    The wonderful security updates in Firefox (and Chrome) will give you the dreaded SSL_ERROR_BAD_MAC_ALERT . So no more ILO for you  How to ...

Search This Blog

  • Home

About Me

My photo
Mladen Komac
View my complete profile

Blog Archive

  • ▼  2020 (3)
    • ▼  November (1)
      • How to use DiskSpd to simulate Veeam Backup & Repl...
    • ►  October (1)
    • ►  September (1)
  • ►  2018 (2)
    • ►  October (1)
    • ►  August (1)
  • ►  2017 (4)
    • ►  October (1)
    • ►  August (2)
    • ►  January (1)
  • ►  2016 (9)
    • ►  September (1)
    • ►  July (2)
    • ►  June (2)
    • ►  April (2)
    • ►  March (2)
  • ►  2015 (4)
    • ►  November (2)
    • ►  October (1)
    • ►  January (1)
  • ►  2014 (12)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  April (1)
    • ►  March (4)
    • ►  January (2)
  • ►  2013 (19)
    • ►  December (1)
    • ►  November (1)
    • ►  October (2)
    • ►  September (6)
    • ►  July (3)
    • ►  June (2)
    • ►  May (2)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (47)
    • ►  December (2)
    • ►  November (1)
    • ►  October (4)
    • ►  September (8)
    • ►  August (10)
    • ►  July (3)
    • ►  June (3)
    • ►  May (2)
    • ►  April (2)
    • ►  February (3)
    • ►  January (9)
  • ►  2011 (23)
    • ►  December (2)
    • ►  November (1)
    • ►  October (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (1)
    • ►  January (3)
  • ►  2009 (1)
    • ►  December (1)

Report Abuse

Pages - Menu

  • Home

Blogroll

Blog Archive

  • ▼  2020 (3)
    • ▼  November (1)
      • How to use DiskSpd to simulate Veeam Backup & Repl...
    • ►  October (1)
    • ►  September (1)
  • ►  2018 (2)
    • ►  October (1)
    • ►  August (1)
  • ►  2017 (4)
    • ►  October (1)
    • ►  August (2)
    • ►  January (1)
  • ►  2016 (9)
    • ►  September (1)
    • ►  July (2)
    • ►  June (2)
    • ►  April (2)
    • ►  March (2)
  • ►  2015 (4)
    • ►  November (2)
    • ►  October (1)
    • ►  January (1)
  • ►  2014 (12)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  April (1)
    • ►  March (4)
    • ►  January (2)
  • ►  2013 (19)
    • ►  December (1)
    • ►  November (1)
    • ►  October (2)
    • ►  September (6)
    • ►  July (3)
    • ►  June (2)
    • ►  May (2)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (47)
    • ►  December (2)
    • ►  November (1)
    • ►  October (4)
    • ►  September (8)
    • ►  August (10)
    • ►  July (3)
    • ►  June (3)
    • ►  May (2)
    • ►  April (2)
    • ►  February (3)
    • ►  January (9)
  • ►  2011 (23)
    • ►  December (2)
    • ►  November (1)
    • ►  October (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (1)
    • ►  January (3)
  • ►  2009 (1)
    • ►  December (1)

Link with me !



View Mladen Komac's profile on LinkedIn

About

Awesome Inc. theme. Powered by Blogger.