Tuesday, October 12, 2010

Solaris: How to get global zone information from non-global zone

Due to a variety of reasons like integration with monitoring, asset management, some notion that knowing the real box name will make things better :-) or a need to do something from the global zone like run dtrace, adjust resource allocations etc. you might sometime would like to know what is the Global Zone' where this container resides or the physical servers's IP address where this virtual container resides.

Just see if you can do a 'prtdiag' ; if so you are on a physical server else you are on a non-global zone.

Step 1: Log into the virtual container or non-global zone in question

Step 2 : NonGZ02# arp -a | grep NonGZ02 (grep the hostname/ ip address)
e1000g0 NonGZ02 255.255.255.255 SPLA 00:14:4f:0e:9f:b8

step 3 : NonGZ02## arp -a | grep 00:14:4f:0e:9f:b8

It will list you a set of arp entries matching that MAC address.

After this to save time either naming convention/ experience with the environment usually help.

If it is in Veritas, I also do a -

cat /etc/VRTSvcs/.vcshost , to get somewhat closer.

step 4: I logged in to GlobalZone01.perflab.com

And I find it in that list :

GlobalZone01# zoneadm list -iv | grep running
0 global running / native shared
1 NonGZ02 running /zones/NonGZ02 native shared
2 Proxy02 running /zones/Proxy02 native shared
.....
.....

And I see my non-global host running from there.

Hope it helps!!

DEBA




Tuesday, October 5, 2010

My First Wedding Anniversary !!

Today October 5th 2010, is my very first wedding anniversary. I still can't quite believe it's been a whole year! Probably sign of a healthy and successful marriage! Ah! someone rightly said in office, probably it is too early to go for this bold declaration!

So, today’s blog post will be short and sweet it will be off the topic but I just want to take this opportunity to greet my lovely wife 'Nandita'. This is true in my case - she has been so caring, supportive all the way even in the time when I have no time to keep my wet towel out to dry, and I see that pleasing confident eyes in her which says “keep doing what you are doing, I am there beside you, and everything will be just fine!”. So my wife deserves all this recognition for being such a wonderful wife, she is my best buddy now. I am very blessed to have you as my wife and couldn’t ask for more I thank GOD for you again.

Yeah during this period I could learn some tricks as well. I felt wives needs a lot of your attention(at all time?!) As someone rightly said - 'you should be taller, older, heavier, uglier, hoarser than your wife' ! Yes, I am paying proper attention to her. And I must say, every husband should.

She also is very sweet. I thought, after marriage( our one was a arranged marriage!) she wont allow me to drink at all. But I somehow accumulated so much of courage one day, that around my 3rd month of marriage, I told her very clearly that - I need to drink at least 1 bottle of beer every week. :-) and yeah, she agreed. I was very confused though, whether she actually wanted me to do so or test , but nay! she actually meant it. That day and today, I never actually dared or felt like to take any more permission as the show must go on. Be your own mentor! Same will happen in tonight's dinner party as well, which begins in a short while from now, no more permission ;-)

Anyway, thanks to everyone who has been wishing me through out the day. Love you all. It really means a lot to me...

-Cheers!
DEBU




Sunday, October 3, 2010

Trouble Uninstalling IE9?

Just couple of days back I wrote a post on IE9 beta release. I saw it buggy and was wondering if some of you has problem uninstalling this buggy piece from your PC. Let me tell you that - you can't simply go to Add/Remove program and uninstall it easily, like you have been doing it for other piece of software. Well, here is how to do it -

  1. Start -> Run -> appwiz.cpl
  2. Here you won't see any entry for IE9 in the main program list. Click on the 'View installed updates link' in the sidebar to see the installed updates.
  3. Scroll down till you see a section for Microsoft Windows and find "Windows Internet Explorer 9" in it.
  4. Right click on the entry and click on the 'Uninstall' button.
  5. After the update is removed you will be reverted to the last installed version of Internet Explorer on your PC.

This above steps are what I tested in Windows 7 .

Enjoy your earlier favorite(!) version of IE browser!!

-DK

Saturday, October 2, 2010

Script written in Win is not working in *nix environment?

Have you ever copied a bash or any other script written your favorite windows editor to UNIX environment and saw it does not work?

Yeah? Well its a Line terminator issue between windows and Linux environment. The enter key, in windows appends a CR and LF code into the end of the line; where in *nix only CR is appended at the end of the line.

Check the script with cat -v, if it display something ^M at the end of the line, that means this text file was created under windows environment. And CR LF is causing the execution of bash script to fail.


$cat -v WonderScript.sh

Once identified, this issue can easily be fixed with the dos2unix command.

$dos2unix WonderScript.sh
$chmod +x WonderScript.sh
$./WonderScript.sh

That's it !!

Cheers!
DEBU




Friday, October 1, 2010

du and df -h confusing stats?

Just now explained someone with example, thought to put it in my blogs as well -

Background:

If someone is running an application with a file open in a directory and the open file is removed, the du output reflects a reduced size for this directory. However, df does not show a reduced size.

..and the confusion begins becuase 'df' and 'du 'are showing contradictory stats.

We must know that - du reports the space used by files and folders--even this is more than the file size. df reports the space used by the file system. This includes the overhead for journals and inode tables and such.The difference is that whenever an application has an open file, but the file is already deleted, then it is counted in the df output (because the space is certainly not free) but not in du (because it is not being used by a file). All blocks in the file system remain allocated until the application that has the file open itself closes the file. And only after the file closure, df will show the reduced usage for the file system.

Below is the exercise to reproduce and understand it better -

[root@DebuTestBox ~]# dd if=/dev/zero of=/tmp/duTest.txt bs=1024 count=500000

When this is going on - from another terminal, remove the file duTest.txt

[root@DebuTestBox ~]# rm /tmp/duTest.txt
rm: remove regular file `/tmp/duTest.txt'? y

Now check -

[root@DebaTestBox ~]# lsof | grep "deleted"
java 4579 root 285u REG 253,0 0 3670130 /tmp/org.hibernate.cache.StandardQueryCache.data (deleted)
dd 16516 root 1w REG 253,0 106242048 3670125 /tmp/dutest.txt (deleted)
--truncated---

Hope it helps.


Now to resolve this issue - we need to figure out what those files are, its importance and relevance in your work space and if found fit to delete them , go ahead and fire the following command -

#lsof | grep "deleted" | awk '{print $2}' | xargs kill -9


Thanks/-
DEBAJIT


Sunday, September 26, 2010

IE9 Beta Release

Peoples are more familiar of the concept of Beta Release in the open-source world. Idea was - it can be tested by scores of real-world users, each using their own computer systems with varieties of Hardware and Software. And the conflict with the various programs or hardware gets reported real fast. I am not sure from when exactly Microsoft started doing that; anyway, Microsoft did a Open(!) Beta release of IE9 on last Wednesday.

I was actually very excited to see this release as it was much hyped on 'Chakra' javascript engine(uses multicore and hence faster than other java script engines), faster browsing, more web surface and some other features along with HTML5 and CSS3 support. Another interesting development is that IE9 will now support SVG, which it has shunned for years. This is a really huge leap forward. Does it mean that Microsoft wants to put their foot forward along with the web standard rather than its own?

I was always excited to see - when Microsoft will get their browser right, so that web developers can create better sites!! I downloaded and and installed it on my Windows7 PC, it installed fine. But whenever I tried to open it up, it displays this message saying " Internet Explorer has stopped working , windows is checking for a solution to the problem" and it goes in an infinite loop because of the tab recovery feature. I couldn’t even give it a spin because it stopped working automatically. And If my stats ae right, it crashed 5 times in that span of 10-15 mins.

I still have one of my desktop which runs XP, but unfortunately, IE9 is not available for Windows XP. (I guess there won’t be), probably because of the security model and XP now nearly 10 years old! Another reason is that graphical core on Windows XP works in a different way, so IE9 hardware acceleration just cannot work there.

Late Review; sheer disappointment!! But yeah, I look forward to see these catchy features when Microsoft releases it finally for the public as a stable product.

Ah! Happily back to my favorite Mozilla browser again!!

-DEBAJIT


Friday, September 24, 2010

SSL cert on windows IIS


I was taken aback yesterday when I got this request. Good to know stuff for *nix guys, never know when you get a similar request. :-)

1) Download new Trusted Root Cert.

2) Move the new certificate mynew.crt to server that needs update

Caution:

You can NOT simply double click on the cert once it is on the server as that will install the cert to the currently logged in users Trusted Authorities. Use the instructions below to install the cert for the entire server


  • Log into the server
  • Start run, type mmc on run line and hit enter
  • In the MMC Console click on File -> Add/Remove Snap-In
  • In Add/Remove Snap in window click on Add
  • In Add Standalone Snap-in window select Certificates and click on Add
  • In the Certificates snap-in window make sure Computer Account is selected and click on Next
  • In the select Computer window verify Local computer is selected and click on Finish, that window will close
  • Back in the Add Standalone Snap-in window click on Close, that window will close
  • Back in the Add/Remove Snap-in window click on Ok
  • In the MMC console left pane, expand Certificates
  • Expand Trusted Root Certification Authorities
  • Right click on Certificates and select All Tasks -> Import…
  • In the Certificate Import Wizard click on Next
  • At the next screen click on browse and browse to the location of mynew.crt and click on Next
  • Verify that it will be installing the cert to Trusted Root Certification Authorities and click on Next
  • Verify info on screen and click on Finish
  • From a command prompt, recycle IIS by running “iisreset /restart”
  • After IIS has been cycled test the web site
Cheers!
DK

  🔭 First Impression: Exploring Grafana Mimir              ... After Years with Thanos! Not an observability( OE ) purist, but I do appreci...