Thursday, 28 November 2013
Interacting with Nodemanager
I want to get simple information from a remote running WebLogic NodeManager. Thanks to http://pietermalan.blogspot.nl/2012/04/interacting-with-nodemanager.html I found out how to do that using TELNET>.
Monday, 18 November 2013
Keyboard layout in Centos
I downloaded an image of Centos from http://virtualboxes.org/images/centos/. How strange when I start the image and look upon an Italian keyboard layout... How in my name can I fix this. Lucky I'm not the only one who had that problem: http://flyingunix.blogspot.nl/2007/07/keyboard-layout-in-centos.html.
Tnx Alina
Tnx Alina
Tuesday, 15 October 2013
NTP synchronisation in RHEL the right way
I'm managing about 28 servers at the moment, a developer came up to me this morning telling me his machine was more then one minute late. Auch, embarrassing situation here I thought. Did I do something wrong? All servers are synced with ntpd on the same central timeserver. How can it be that one server is way off? Digging the internet on so called experts didn't help much, most use ntpd and are done. So why is the server off?
Well it seems when a server is off too much on boot time, ntpd will just not work anymore. That was a new for me. The catch is that servers don't sync on boot with ntp, they sync with the hwclock. If the clock is way off a certain threshold ntp will just silently fail. How can I fix the problem so the server will boot, set time correct and keep it correct?
Open your /etc/rc.local file and add ntpdate to it (use any time server you want), then sync the hwclock:
# sync time
ntpdate -sb pool.ntp.org
hwclock --systohc
Now after boot, sysinit is run, then rc.local, the time is updated, the hwclock is synced, then the services in rc.d will start. Because we still use ntpd the server time will stay in sync till next reboot; where it is synced on boot et cetera.
Tnx to:
http://nuclearfusionreactor.blogspot.nl/
http://www.rgrjr.com/linux/ntp.html#ntpdate-boot
Well it seems when a server is off too much on boot time, ntpd will just not work anymore. That was a new for me. The catch is that servers don't sync on boot with ntp, they sync with the hwclock. If the clock is way off a certain threshold ntp will just silently fail. How can I fix the problem so the server will boot, set time correct and keep it correct?
Open your /etc/rc.local file and add ntpdate to it (use any time server you want), then sync the hwclock:
# sync time
ntpdate -sb pool.ntp.org
hwclock --systohc
Now after boot, sysinit is run, then rc.local, the time is updated, the hwclock is synced, then the services in rc.d will start. Because we still use ntpd the server time will stay in sync till next reboot; where it is synced on boot et cetera.
Tnx to:
http://nuclearfusionreactor.blogspot.nl/
http://www.rgrjr.com/linux/ntp.html#ntpdate-boot
Wednesday, 29 May 2013
Shrink your VirtualBox disk
After working in my VirtualBox RedHat installation my disk grew to 27Mb. I want to make is smaller so it can fit on the left over space of my 5.6Mb SSD.
Fill the disk with 0's and delete the zero file:
Fill the disk with 0's and delete the zero file:
$ dd
if
=/dev/zero of=~/delete.me
$ rm ~/delete.me Start the Virtial Box Manager and fix the disk:
|
Monday, 26 November 2012
Trap, thread and monitor
I just want to dump three great resources for bash hacking. First of all a list with some handy resources. Second if about making your script aware of the ctrl-z combo and third a bash script that spawns a couple of threads.
1. http://bash.cyberciti.biz/shell/monitoring/
2. http://hacktux.com/bash/control/c
3. http://blog.apokalyptik.com/2008/12/11/using-wait-and-for-threading-in-bash/
It certainly helped me monitoring some disc space usage during an installation.
1. http://bash.cyberciti.biz/shell/monitoring/
2. http://hacktux.com/bash/control/c
3. http://blog.apokalyptik.com/2008/12/11/using-wait-and-for-threading-in-bash/
It certainly helped me monitoring some disc space usage during an installation.
Wednesday, 3 October 2012
Redirect bash output to file and screen
So you have made a nice new script in bash. Fancy you! Alas it has to log to a file and to screen. That might sounds simple, and it is, check this out:
exec > >(tee ${LOGFILE}) 2>&1
WTH? Well just redirect all output (error and out) to a subprocess which tee's it (write to screen and to log).
exec > >(tee ${LOGFILE}) 2>&1
WTH? Well just redirect all output (error and out) to a subprocess which tee's it (write to screen and to log).
Use WLST functions inside Jython classes
Using WLST can be frustrated because all of the global functions that seemingly cannot be used inside classes. Putting functions in classes and making re-usable libraries is common practice in the current development world. Most developers would like to avoid spagetti-monsters; although some still seems to like the idea of spagetti with tomato sauce.
To use the global commands of WebLogic's WLST import the correct module:
import wlstModule as wlst
wlst.connect('weblogic','welcome1','t3s://localhost:7002')
wlst.redirect('/var/log/weblogic.log')
Thanks to: http://stackoverflow.com/questions/8252846/wlstmodule-connection-information-lost
To use the global commands of WebLogic's WLST import the correct module:
import wlstModule as wlst
wlst.connect('weblogic','welcome1','t3s://localhost:7002')
wlst.redirect('/var/log/weblogic.log')
Thanks to: http://stackoverflow.com/questions/8252846/wlstmodule-connection-information-lost
Subscribe to:
Posts (Atom)