Dr Quantum - Double Slit Experiment 


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
The Human Genome Project Video 




[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
Earl Hines & Jackie Byard 


[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink
0x0000007F - Failed to GetProcAddress on DiOfflineReinstallAllUpdates 
If you get the this while running postreflect command on Vista:

postreflect e:\Windows c:
0x0000007F - Failed to GetProcAddress on DiOfflineReinstallAllUpdates


you have to start the Windows Pe Tools command promt as Administrator. The paths are updated and the error "failed to getprocaddress on diofflinereinstallallupdates Failed: Error = 0x0000007f" is no longer present.

After running the PE Tools Command Prompt as administrator the promt should start at C:\Windows\system32 folder.

[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink
TME - Ethernetový teploměr, plugin pro Nagios  
Plugin pro NAGIOS pro odečítání teploty TME čidla od www.papouch.cz.

HTML/XML output z cidla:

<?xml version="1.0" encoding="iso-8859-1" ?><thermometer><title>Ethernet thermometer TME designed by Papouch s.r.o. - www.papouch.com</title><description>TME Serverovna</description><temperature>230</temperature><mintemperature>"N"</mintemperature><maxtemperature>"N"</maxtemperature></thermometer>


TME je teploměr s rozhraním Ethernet (IP teploměr). Má interní WEBové stránky a XML stránku s aktuální teplotou. Umí protokoly TCP, SNMP, SMTP (e-mail), MODBUS a SOAP. Teplotu snadno vložíte na Vaše stránky díky funkci HTTP GET.


Plugin: check_temp

#!/bin/bash

# version 1.0 (27/01/2008)

W_TEMP=250 # warning treshold
C_TEMP=300 # critical treshold
URL="http://192.168.24.221/tme.xml"

cd /tmp

wget -q --output-document=$$.xml ${URL}
if [ $? -gt 0 ]; then
echo "UNKNOWN - can't connect to sensor!"
exit 3
fi


XML=`grep "<temperature>" $$.xml 2>/dev/null #1>&2`; RETVAL=$?

[ -f $$.xml ] && rm -f $$.xml

if [ $RETVAL -gt 0 ]; then
echo "UNKNOWN - no data from sensor!"
exit 3
fi

TEMP=`echo ${XML} | \
awk -F"<temperature>" '{ print $2 }' | \
awk -F"</temperature>" '{ print $1 }'`

TEMP_DOT=`echo $TEMP / 10 | bc`

# temp is okay
if [ $TEMP -lt $W_TEMP ]; then
echo "OK - temperature is ${TEMP_DOT}C |${TEMP}"
exit 0
fi

# temp is over W_TEMP
if [ $TEMP -gt $C_TEMP ]; then
echo "CRITICAL - temperature is ${TEMP_DOT}C |${TEMP}"
exit 2
else
echo "WARNIG - temperature is ${TEMP_DOT}C |${TEMP}"
exit 1
fi


[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink
Connect securely to Windows Vista Remote Desktop 
Connect securely to Windows Vista Remote Desktop link.

[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
Linux: LVM unsorted 
Recovering from LVM Mirror Failure

LVM Administrator's Guide

What is an Highly Available LVM (HA LVM) configuration and how I implement it?



Snapshot:
lvcreate --size 100m --snapshot --name snap --permission r --verbose /dev/VolGroup00/LogVol00


 1058  dmsetup remove /dev/vg01
1061 dmsetup remove vg01-linux_pokus_1_5G
1062 cd /sys/block/dm-0/dev
1063 cat /sys/block/dm-0/dev
1064 cat /sys/block/dm-0/stat
1065 cat /sys/block/dm-0/uevent
1066 cat /sys/block/dm-0/dev
1067 cat /sys/block/dm-0/holders/
1068 cd /dev/vg01/
1069 ls -la
1070 rm linux_pokus_1_5G
1071 ls -la
1072 cd ..
1073 ls -la
1074 ls vg01/
1075 rm -rf vg01/
1076 ls -la
1077 lvs
1084 lvreduce --removemissing
1091 ll /dev/mapper/vg01-linux_pokus_1_5G
1092 rm /dev/mapper/vg01-linux_pokus_1_5G
1093 lvs
1100 pvcreate /dev/sde
1101 pvcreate /dev/sdf
1102 vgcreate vg01 /dev/sde /dev/sdf
1107 lvcreate -n sbs2008_programs_and_data_90G -L 90G vg01
1112 lvs
1113 lvremove /dev/vg01/sbs2008_programs_and_data_90G


Display disks in volume group
vgdisplay -v vg01 


[ add comment ] ( 6 views )   |  [ 0 trackbacks ]   |  permalink
XEN VM server with Linux HA 
The setup below uses XEN and HA components to provide smooth backgroud for running services on VM machines. The setup consists of two servers interconnected by Gbit crossover link which is mandatory for fast and reliable live VM migration and is also used for DRBD and heartbeat.

Software used here is DRDB, Linux heartbeat and XEN server with live VM migration functionality.

The /etc/hosts file:

192.168.50.3            xen1
192.168.50.4 xen2


Components installed for heart-beat:

heartbeat-stonith-2.1.3-3.el5.centos *
heartbeat-2.1.3-3.el5.centos *
heartbeat-gui-2.1.3-3.el5.centos *
heartbeat-devel-2.1.3-3.el5.centos
heartbeat-pils-2.1.3-3.el5.centos *
heartbeat-ldirectord-2.1.3-3.el5.centos


DRBD components:

drbd82-8.2.6-1.el5.centos
kmod-drbd82-xen-8.2.6-2
kmod-drbd-xen-8.0.13-2


The HA setup file (/etc/ha.d/ha.cf):

use_logd yes
bcast eth2
node xen1 xen2
crm on


The HA setup file (/etc/ha.d/authkeys):

cat auth 1
1 sha1 SOME_ID_STRING


XENd config file (/etc/xen/xend-config.sxp):

(xend-relocation-server yes)
(xend-address 'xen1')
(xend-relocation-hosts-allow '^xen1$ ^xen2$ ^localhost$')
(xend-unix-server yes)
(xend-unix-path /var/lib/xend/xend-socket)
(network-script network-bridge)
(vif-script vif-bridge)
(dom0-min-mem 256)
(dom0-cpus 0)
(vncpasswd '')


The other server must have:

(xend-relocation-server yes)
(xend-address 'xen2')
(xend-relocation-hosts-allow '^xen1$ ^xen2$ ^localhost$')
(xend-unix-server yes)
(xend-unix-path /var/lib/xend/xend-socket)
(network-script network-bridge)
(vif-script vif-bridge)
(dom0-min-mem 256)
(dom0-cpus 0)
(vncpasswd '')


Our DRBD file (/etc/drbd.conf) which is the same on both xen servers:

common {
protocol C;
}

resource r0 {

startup {
become-primary-on both;
}

syncer {
rate 51200;
}

net {
allow-two-primaries;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}

device /dev/drbd1;
disk /dev/loop7;
meta-disk internal;

on xen1 {
address 192.168.50.3:7789;
}
on xen2 {
address 192.168.50.4:7789;
}
}


To spawn heartbeat gui:

# /usr/bin/hb_gui &


To spawn XEN manager:

vm-manager


To check the cluster status:

crm_mon


============
Last updated: Sun May 25 09:46:30 2008
Current DC: xen1 (3ff2a9ca-13be-41a5-a8f8-2657402e32f2)
2 Nodes configured.
1 Resources configured.
============

Node: xen1 (3ff2a9ca-13be-41a5-a8f8-2657402e32f2): online
Node: xen2 (e61ad97b-2750-4cf4-a307-2a9c48929a2a): online

vm05_r (heartbeat::ocf:Xen): Started xen2

Failed actions:
vm05_r_monitor_0 (node=xen1, call=6, rc=1): Error


The DomU resource in Linux HA was created using HA management gui. You will need to set the 'Parameters' on at 'Resource' as follows: allow_migrate=true, this allows live migration of virtual machines.

Do not forget to set the path to virtual machine configuration file using xmfile parameter.

[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink
Apache: protecting directory content using .htpasswd 
Create htaccess definition file: /var/www/html/directory/.htaccess:

AuthType Basic
AuthName "Please enter username and password"
AuthUserFile /var/www/html/directory/.htpasswd
Require valid-user


Create new password file for the user and set initial password:

# htpasswd -c passwordfile username


cat /var/www/html/directory/.htpasswd
username:hAsHhaSH


Allow the apache to use the config in /etc/httpd/conf/httpd.conf:

<Directory>
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
</Directory>

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the
# AllowOverride directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from
# being viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

<VirtualHost host.domain.cz:80>
AccessFileName /var/www/html/directory/.htaccess
DocumentRoot /var/www/html/directory/
ServerName domainname.dom
ServerAdmin administrator@domainname.dom
</VirtualHost>


Do not forget to edit the other AllowOverride

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All


[ add comment ] ( 1 view )   |  [ 0 trackbacks ]   |  permalink
Apache /var/log/httpd/error_log: unable to check htaccess file, ensure it is readable 
It has nothing to do with htaccess file, the right reason is the apache "cannot read the directory or file". Set the folder permission to "750" and the folder group owner to apache.

Also check if the directory context is set to apache content when you are runing SeLinux.

# ls -lZ /directory/
# chcon -R -h -t httpd_sys_content_t /directory/path/


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Next> Last>>