Jan
25

Installing Cisco License on C3560X

From the order, you will get a link to download the Electronic Product Activation Key, from Cisco.

Sign in to Cisco, follow the instruction and download the file. You will get a zip file with two PDF files

One of these two (eDelivery_xxxx.zip) will give you the Product Activation Key.

Follow the instructions again and go to http://www.cisco.com/go/license, fill in the forms to register the switch.

Use the following command on the switch to retrieve PID and SN

Switch#show license udi
Device#   PID                   SN              UDI
-----------------------------------------------------------------------------
*0        WS-C3560X-24T-L       FDO1511XXXX    WS-C3560X-24T-L:FDO1511XXXX

Fill in the forms and download the License File (.lic)

TFTP the License file on the Switch

Switch# copy tftp://192.168.1.2/01_FDO1511XXXX_20120112084019387.lic fla
Switch#$//192.168.1.2/01_FDO1511XXXX_20120112084019387.lic flash:
Destination filename [01_FDO1511XXXX_20120112084019387.lic]?
Accessing tftp://192.168.1.2/01_FDO1511XXXX_20120125084019387.lic...
Loading 01_FDO1511XXXX_20120125084019387.lic from 192.168.1.2 (via Vlan1): !
[OK - 1152 bytes]

Install the Switch License

Switch#license install flash:01_FDO1511XXXX_20120112084019387.lic
Installing licenses from "flash:01_FDO1511XXXXX_20120112084019387.lic"
Installing...Feature:ipbase...Successful:Supported
1/1 licenses were successfully installed
0/1 licenses were existing licenses
0/1 licenses were failed to install
Switch#
*Mar  1 02:07:10.000: %IOS_LICENSE_IMAGE_APPLICATION-6-LICENSE_LEVEL: Module name = c3560x Next reboot level = ipbase and License = ipbase
*Mar  1 02:07:10.848: %LICENSE-6-INSTALL: Feature ipbase 1.0 was installed in this device. UDI=WS-C3560X-24T-L:FDO1511XXXX; StoreIndex=1:Primary License Storage

Reboot

Find more information at http://www.cisco.com/en/US/prod/collateral/switches/ps5718/ps6406/white_paper_c11-579326.html

Jan
07

Scripting SSH / Telnet Session

Couple of years ago, I started my CCNA and working in an environment managing 100s of routers and switches. I was introduce to Tera Term during the course and was quite liked it then. The macro scripting didn’t quite seem stable though and didn’t give it much thought.
This week I decided to see what’s new. I don’t quite remember what the website was then, but it is now also available in version 4.72 at www.logmett.com with a set of new tools and sample codes. I haven’t tried logmett but did try the TTLEditor which is also nice. In the sample file the ssh2login.ttl (auto login with SSH2 protocol) gave me the starting point I needed to work on scripting multiple devices. A couple of hours later, I have a script that will:

  • Read a file for remote ip address to connect to
  • Connect to host
  • execute command
  • Log session in another external file

I’m not a programmer and the commands scared me quite a bit. Yet I was surprised to see how fast I start seeing result. Some commands seems to be duplicates, some just seem not to work. The “wait” command is the one that doesn’t work, yet, that is the one you expect to be using the most often to synchronize the command execution and the response from an inattended session. The work around was to put “pause” hoping the time allocated is enough for the response of the remote device. The programming level is quite old using “goto” rather than using functions. It can get quite confusing specially when reading other people’s program. Anyways, enough of ranting and more of coding..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
; File: ab_ssh2_backup.ttl
; Description: Backup running config of remote devices
; Environment: generic
; Update: 07 Jan 2012
; Author: Abdul Sandooya
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
fileopen addressfile 'D:\teraterm-4.72\ip.txt' 0
 
:loop
 
;read lines from file for ip addresses
filereadln addressfile hostname
if result goto fclose
 
username = 'admin'
password = 'OpenSesame'
; timeout used for waitregex commands
timeout = 3
 
; constructing connect command
msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg password
 
connect msg
 
; Look for regular expression and save the line of the result, expecting to get the hostname of the device.
waitregex 'CATALYST.*'
if result=0 goto RES_TIMEOUT
 
;Save regular expression captured (hostname of device) result
int2str s result
;messagebox inputstr 'inputstr'
 
; change the current directory where the log will be saved
changedir 'd:\Downloads'
 
; get a user name actually gets the username logon to the computer- can be used as a variable in the name of the file
getenv 'USERNAME' username
; get the date and time
gettime timestr "%Y_%m_%d"
; add the user name and the timestamp to the log file name
sprintf2 loggerfile 'Config_%s_%s_%s.log' inputstr hostname timestr
 
logopen loggerfile 0 0
 
logstart
sendln 'terminal length 0'
sendln 'sh run'
 
; Hard time with the waitln, pause was inevitable. This section is just to divert the attention of the user tracking the progress for 3 sec
waitln '#'
statusbox hostname 'Config Saved'
Pause 3
 
logclose
disconnect 0
 
; This wait actually works..
waitevent 2
 
; next ip address in the file, could have used a for loop now i'm thinking about it.. but same thing..
goto loop
 
:RES_TIMEOUT
;create file with error message, same directory where the logs are
fileerr = 'D:\Downloads\'
strconcat fileerr 'ConnectErr_'
strconcat fileerr hostname
strconcat fileerr '.log'
filecreate fhandle fileerr
goto loop
 
:fclose

Some useful reference pages :
TTL Command Reference Page

Other similar

Nov
29

How to read uncommented lines from a file in Linux..

how can I “cat” or “grep” a file to ignore lines starting with “#” ???.

grep -v ‘^#’ /etc/samba.conf | grep -v ‘^$’

Jun
22

Changing Catalyst 3560 IOS .tar

1. Backup your config files,
2. Format the flash

format flash:

3. copy and extract tar file

archive tar /xtract tftp://192.168.1.20/c3560-ipservicesk9-tar.122-55.SE.tar flash:

Jun
07

Microsoft Lync Online..

I’ve been staring at it for months.. looking quite complicated and lengthy.. (risky..) to install and configure.. Looking for a machine  strong enough to create A virtual environment consisting of a domain controller (WIN2008R2) with Exchange 2007 and Lync 2010 (to simulate our actual infrastructure) and 2 Windows7 clients. Preferably something I can access from home as well as from work.. (At work I don’t have the time to test and learn new stuff, home not really where I should be doing it either but that’s the way it is..) I tried my home server with Proxmox, but I quickly ran out of memory (damn Windows server!!). Eventually, installed it on my laptop (with 8Mbps of RAM and more that enough CPU).. on my Ubuntu partition (optimize the RAM) and Virtual Box. Eventually, I managed to get everything installed and did most of the documentation and configuration at work. It took a few tries but I got it going all in Virtual. It was long and tedious but very cool results. I eventually install it at work in less time it took me to install the three servers in Virtual box.

Oh yea, nearly forgot about DD-WRT. I needed to have a layer 3 separation between my test environment and the Internal/home or enterprise network going to the Internet. The reason is I didn’t want to broadcast the Netbios and Domain Controller information from the test environment to the local one. So after trying a couple, I simply used an image of DD-WRT in Virtual Box. Unfortunately, it doesn’t save the configs but that wasn’t a big deal, it’s set up and most important, it doesn’t take much mem..
http://rafeequl.wordpress.com/2010/07/12/how-to-run-dd-wrt-on-virtualbox/

Documentation credits and thanks to:
http://www.ocspedia.com/fe/Install_Microsoft_Lync_Server_2010.aspx?ArticleID=103

and
http://msunified.net/2010/11/22/lync-server-2010-features-and-how-to-configure-them/

 

For Microsoft users, get the Lync Client, Lync Attendee or just use the web apps..

For linux users, install the sipe plugin for Pidgin, chat functions work well..
http://sipe.sourceforge.net/install/

 

May
26

ISC-DHCP-SERVER on Ubuntu Natty

dhcp3-server doesn’t seem to work on Ubuntu Natty (11.03). For some reason it will install but /etc/init.d/dhcp3-server is not available.

To my surprise though, natty came with isc-dhcp-server. It took me a little while to figure out that to enable it, I only needed to copy and correct the subnet option int

/etc/dhcp/dhcpd.conf

subnet 192.168.1.0 netmask 255.255.255 {
range 192.168.1.0 192.168.1.100;
}

and set the interface on which I wanted to have DHCP to an ip address in that range, e.g.

$ ifconfig eth0 192.168.1.1

and start the service..

$ sudo /etc/init.d/isc-dhcp-sever start

et voilà..

Check the DHCP Request and distribution by

$ tail -f /var/log/syslog

Done..

 

May
15

360cities.com – Kariya

Our favorite park across the street..

Kariya2 in Canada

May
07

Removing encryption PDF files – Ubuntu

PDF forms are simple and neat and a great way of filling them up easily without the paper waste. But very often these forms are encrypted to avoid modification or what not, but than means you have to print it right away, so you have to fill it up one shot, not coming back and finish it later. If you don’t have a printer handy r you actually need to email the form (no signature required) you can always print it back in PDF. But if don’t always have the time to fill it completely and need to come back later to make modification, then you’d be happy to know that the encryption on these files are not that strong and you can take it out quite easily.

$ sudo apt-get install qpdf
$ qpdf –decrypt –password=mypassword input.pdf output.pdf
$ evince output.pdf #to check if it asks for password

via Removing encryption from legitimate! PDF files on Ubuntu | sandipb.net.

Apr
29

Ubuntu Natty; Unity: best of 3 worlds???

Finishing varsity back in 2003, I took my first course in Linux called “Windows and Linux, knowing both worlds”.  That was in Mauritius where the Apple world was not well known and probably too expensive to have a foot anyway near the Africa continent. When I first installed Natty yesterday and booted up with the Unity interface, there were mixed feelings about the change from the “awesome” compiz feature of slack wobbling windows and rotating cube desktops.However, I noticed that they tried to integrate the easy search option of Win7 and the Menu in the toolbar as in MAC. Ubuntu copying from these guys? I don’t think so, these options were already available if you knew how to customized your desktop with “gnome-do” for quick application search and “cairo-dock” for icon docking. The windows menu in the Menu bar was new to me, I have to admit but yet again, I’m not that fancy customizing my desktop. The idea of having it all pre-built in Natty was nice, but I really missed what really made Ubuntu really unique lately with the advance compiz features.

When I first tried to set it up again, Compiz setting manager kept crashing the windows management. I was sooo pissed.. I tried to boot back in with the classic interface but compiz-settings-manager really looked like broken. I didn’t know much about the windows managers I have to admit and not even enough to switch back to Metacity. Back at work Matthieu showed me how to switch back and forth between the two Window Managers ( $sudo metacity –replace / compiz –replace). Then he noticed that the bug wasn’t really compiz itself but when you switch from Desktop Wall to Desktop Cube, there are a few more check boxes that gets cleared. All you have to do is check them back and compiz all the nice features are back again.

At that point I totally gave up on Unity and switched back to Classic which is really good since I got my desktop just the way I liked it!!.. ?? but then, as I was getting ready to install gnome-do and cairo-dock, I thought about “moving on even when you’re not ready” philosophy and how it so often applies in our environment. The one thing you cannot change is “change”. The idea was neat and user friendly. The size of the icons on the dock makes you think that if you were using a netbook with touch screen, the workability would have been very nice. That might be a vision for the laptop makers since touch screens might become quite cheap in the future with the current tendencies and having a mouse pad or synaptic might phase out?? So let’s give it a try. Since compiz does work, let’s try Unity with Desktop Cube (set workspace to 4 columns and 1 row), wobbly windows, windows menu in the main menu, finger size icons on the dock.. let’s make the best of the 3 worlds.

Config on my Compiz-Settings-Manager

Check the small video using RecordMyDesktop on linux

http://www.youtube.com/watch?v=dBthtBeMZhs&feature=youtu.be

 

Apr
29

Installing flash firefox ubuntu natty 64bit

Weird how that wasn’t a necessary step before..

1. Get the Flash Player “Square” from Adobe
http://labs.adobe.com/downloads/flashplayer10_square.html

2. Thanks to http://www.myscienceisbetter.info

tar zxvf flashplayer10_install_linux_051508.tar.gz
sudo cp install_flash_player_10_linux/libflashplayer.so /usr/lib/mozilla/plugins/
rm -rf ~/install_flash_player_10_linux/

4. Use nspluginwrapper to install the plugin and link it to firefox
sudo nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/mozilla/plugins/
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/

EDIT: here is how to install flash player 10 on 64bit systems for Liferea and Vuze

sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/xulrunner-addons/plugins/

5. Start Firefox and type in the address bar about:plugins and press enter. You should get a result similar to this one:

Older posts «