Archivio

Archivio autore

ioquake3: no bot on Quake 3 Arena

31 gennaio 2012 Nessun commento

OS: Fedora 16
ioquake3: ioquake3-1.36-7.1.x86_64

If, after installing ioquake3 and copying pak0.pk3 and pak8.pk3 from Quake 3 Arena original CD to ioquake3/baseq3 of your installation folder, you can’t see any bot playing, do the following:

  • unzip pak0.pk3 from baseq3 folder
  • enter botfiles directory
  • rename chars.h to carsh”
  • zip all files you have extracted
  • rename from .zip to .pk3

Enjoy :)

 

SOURCE:
ZiNk comment on “How to fix missing bots in ioquake3 in linux” article

Categorie:Linux Tag:

How-To: set master monitor on a dual head configuration on Ubuntu 11.04

5 settembre 2011 Nessun commento

OS: Ubuntu 11.04 (Natty Narwhal)
Video Card: Intel Integrated Graphic Card
Video output: 1 DVI, 1 VGA

The system “Monitors” application let you set the disposition of the two monitors, which is left and which is right, but it doesn’t let you decide which is the master (or 0 and 1).
By default, the system set the VGA monitor as master but I want it to be the slave and configure the DVI monitor to be the primary.

Run xrandr to view how monitors are named and what are used:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
massimo@bebop:~$ xrandr
Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192
VGA1 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024      60.0*+   75.0
   1152x864       75.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1
HDMI1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 337mm x 270mm
   1280x1024      60.0*+   75.0
   1152x864       75.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1
DP1 disconnected (normal left inverted right x axis y axis)

In my case, the DVI connection is identified as HDMI1.
Now shut off the VGA monitor

1
xrandr --output VGA1 --off

Shut off the DVI

1
xrandr --output HDMI1 --off

WARNING: doing this will disable both of your monitors!
Keep the terminal on top and write next command blindly.

Set the HDMI1 interface as primary

1
xrandr --output HDMI1 --auto --primary

Enable the secondary and put it to the right of the primary

1
xrandr --output VGA1 --auto --right-of HDMI1

Enjoy :)

 

 

SOURCE: ubuntuforums.org – [ubuntu] Changing master monitor in dual set-up

Categorie:Ubuntu Tag:

How-To: increase color depth in XP Mode

22 giugno 2011 Nessun commento

If you want to increase the color depth in the Windows Virtual PC called “Windows XP Mode” (like I’m running inside my Windows 7 Professional):

  1. In the Windows XP operating system (remote system), click on Start menu, then Run.
  2. Type GPEdit.msc to open Group Policy Editor.
  3. Navigate to Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services.
  4. In the right pane, double-click on the Limit Maximum Color Depth setting.
  5. In the Properties dialog, select radio button of Enabled, and then set Color Depth value to 24 bit or Client Compatible
  6. Click OK when done.
  7. Restart the Virtual PC.

Enjoy :)

 

SOURCE:
How To Increase Color Depth and Quality of Windows XP Accessed Via Remote Desktop or Terminal Services

 

Categorie:Microsoft Windows Tag:

Change vMA keyboard layout

4 giugno 2011 Nessun commento

Edit /etc/sysconfig/keyboard

1
sudo vi /etc/sysconfig/keyboard

replace KEYTABLE to your language set (in my case italian)

1
KEYTABLE="it"

Reboot vMA.

 

Enjoy :)

Categorie:Ubuntu Tag:

How-To: script to shutdown ESXi Free via an USB UPS monitoring tool

7 aprile 2011 2 commenti

Introduction

The purpose of this How-To is to let an USB UPS (in my case an APC Back-UPS 800VA) communicate to ESXi to shutdown or suspend VMs and then shutdown host in case of power failure.
The source script’s author is helux where if you can find the original thread and the original script in the sources links at the bottom of this article.
I have customized the script with a logging system and with an option to decide if to suspend or shutdown the virtual machines.

 

The problem

Due to the fact that, since VMWare ESXi 3.5U4, read and write access from RCLI (Remote Command Line Interface) has been disabled, we are unable to use scripts like ghettoUPSHostShutdown.pl written by lamw (William Lam).
Our only possibility is to install the USB UPS monitoring tool in a Virtual Machine, then communicate to ESXi via SSH and then run a script copied on the ESXi itself.

In my case I have an Ubuntu Server 10.10 installed as a Virtual Machine. Here I have installed apcupsd software to monitor the UPS.

 

Create ssh keys

I have generated an SSH key for root to let the VM communicate with ESXi.

1
sudo ssh-keygen

Do not set a passphrase for the private key otherwise we can’t automate the process.
After having enable the SSH server in ESXi, transfer the public key of the VM to ESXi

1
sudo ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.0.100

Change the path to the public key file and the IP address of the ESXi.

 

The script

Download the script with wget in your linux VM or copy and paste the content in a new document

powerdown-esxi4.x_v0.5

Edit the script and, at the beginning, customize it on your needs, such as enable logging system, set the log file, decide what VMs should do (suspend, shutdown) etc.

1
2
3
4
5
6
7
# Set here if you want to suspend or shutdown the Virtual Machines
# Options available: suspend ; shutdown
VM_STATE=suspend

# To enable logging, set the following variable to 1
LOG_ENABLED=1
LOG_FILE=/vmfs/volumes/4c55e39f-3d85baef-7253-e0cb4e42250b/powerdown-esxi4.log

Then transfer powerdown_esxi4. to ESXi

1
scp powerdown_esxi4.1_v0.4.sh root@192.168.0.100:/bin

Please note that if you transfer a text/script file from Windows via vSphere Client to a datastore, a line feed “^M” will be added so the file will be unusable.
If you want you can wget it.
Now login into your ESXi server and make powerdown_esxi4.sh executable

1
chmod +x /bin/powerdown_esxi4.1_v0.4.sh

 

Change UPS monitor software behaviour

We have to tell our UPS monitor software that during the Shutdown Sequence he has to run our script.

Network UPS Tools

Edit /etc/nut/upsmon.conf, change the line

1
SHUTDOWNCMD "/sbin/shutdown -h +0"

and call a custom script instead

1
SHUTDOWNCMD "/usr/local/bin/nut-shutdown.sh"

Create the script /usr/local/bin/nut-shutdown.sh

1
2
#!/bin/sh<br />
ssh root@192.168.0.100 'powerdown-esxi4.sh'

The problem with Network UPS Tools and my APC UPS

I encountered 2 problems using my APC UPS:
1) NUT can’t power on my APC after power outage
2) My APC has ups.delay.shutdown= 20
That means that the amount of time the UPS will wait before shutting down is only 20s. I saw that I need at least 1:10 min, so I had to change it to 90s.
I did it with

1
sudo upsrw -s ups.delay.shutdown=90 -u local_mon -p mypass apc@localhost

but after a service restart, the UPS loses this setting.

apcupsd

Edit /etc/apcupsd/apccontrol this way

1
2
3
4
5
doshutdown)
echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
ssh root@192.168.0.100 'powerdown_esxi4.1_v0.4.sh'
${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
;;

The problem with apcupsd and my APC UPS

As stated in 2 thread in VMWare Communities:
ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
apcaccess: status output minimal when using USB device passthru on ESX

There is a problem in the USB passthrough of APC UPSes: apcupsd doesn’t recognize many parameters.
However essential parameters like LOADPCT (Percent Load Capacity), BCHARGE (battery charge), TIMELEFT, MBATTCHG (Minimum Battery Charge), MINTIMEL (Minimum Time Left) are properly recognized so we can continue using our script.
At the moment it is the best solution I have found.

 

Compress everything and generate oem.tgz

To load the ssh key and the script at system boot, you have to add it to /bootbank/oem.tgz, as ESXi will clear everything that doesn’t belong to the system itself.
If you don’t have any oem.tgz, create it with

1
tar -cvzf /bootbank/oem.tgz .ssh/ /bin/powerdown_esxi4.1_v0.4.sh

If you have already an oem.tgz for something else, extract the content to a folder, as the tar installed in ESXi doesn’t support appending of files,

1
2
mkdir oem
tar -xvzf oem.tgz -C oem/

copy the script preserving the directory structure of /bin

1
2
mkdir /bootbank/oem/bin/
cp /bin/powerdown_esxi4.1_v0.4.sh /bootbank/oem/bin/

copy also the ssh key

1
cp -R /.ssh/ /bootbank/oem/

compress again the archive

1
2
cd /bootbank/oem/
tar -cvzf /bootbank/oem.tgz `ls -A`

Enjoy :)

 

 

SOURCES:
VMWare /etc – ESXi U4 Ends Free Version Read and Write Access from the RCLI

VMWare Communities: esxi shutdown script for ups monitoring by helux

VMWare Communities: ghettoUPSHostShutdown.pl

vuemuer.it – Spegnere ESXi tramite un UPS APC