Posts Tagged ‘Israel’

Timezone for Israel on HP-UX 11i and above

Thursday, August 21st, 2008

While Linux vendors tend to maintain and publish the whole zone and daylight saving (DST) information, most legacy Unix vendors do not. Especially when it comes to such a small country such as Israel.

The following solution was tested for HP-UX B.11.31, and would probably work for all 11i versions.

Israel timezone is called IST. Israel daylight saving timezone is called IDT.

The quick and dirty:

Edit /usr/lib/tztab and append the following lines at the bottom:

# Israel daylight savings
# Added by Ez-Aton. years 2008 to 2011 only. Simple and ugly.
IST-2IDT
0 3 28 3 2008 5 IDT-3
0 1 5 10 2008 0 IST-2
0 3 27 3 2009 5 IDT-3
0 1 27 9 2009 0 IST-2
0 3 26 3 2010 5 IDT-3
0 1 12 9 2010 0 IST-2
0 3 1 4 2011 5 IDT-3
0 1 2 9 2011 0 IST-2

Save (this is a write-protected file, so force saving) and then edit /etc/TIMEZONE to include the following TZ directive:

TZ=IST-2IDT
export TZ

Assuming you sync your time using NTP, all future logins will have correct Israeli date and daylight savings.

For further information, you can check man tztab and man environ

A small update to the cellular browsing

Wednesday, July 2nd, 2008

I have uploaded a replacement wvdial.conf for the cellular entry below. Notice that for Cellcom in Israel, you need an init string AT+CGDCONT=1,”IP”,”internetg” . which is embedded into the file. For other cellular providers, you might need a different string.

For Cellcom users out there – this is the right init string. If you are on an “Cellular Internet” package, do not use AT+CGDCONT=1,”IP”,”WAPU” !

Dial-up in Israel through Orange 3G

Saturday, May 3rd, 2008

I have set up a small script to allow me to dial-up using my cell to the internet. The speed of the 3G connection is quite amazing, and this information would assist, I’m sure, others as well. I am using Bluetooth to communicate between my cell and my portable computer.

Steps:

1. Create an /etc/wvdial.conf with the following contents:

[Dialer Defaults]
Phone = *99***1#
Username = orange
Password = mobile54
New PPPD = yes
Modem = /dev/rfcomm1
Baud = 460800
Init2 = atz
ISDN = off
Modem Type = Analog Modem
Dial Attempts = 1
Abort on No Dialtone = off
Stupid Mode = on

2. Pair your mobile and your laptop (check it on the net). Get the hardware ID

3. Get the channel for DUN (or Dial-Up Networking)

4. Add this script in /usr/local/sbin/ (I called it “gprs”). Replace the zeros with your own hardware ID, and the number 4 (Nokia N95) with the channel you use:

#!/bin/bash
rfcomm connect 1 00:00:00:00:00:00 4 &
PID_BT=$!
echo $PID_BT
sleep 5
wvdial &
PID_WV=$!
echo $PID_WV
sleep 7
ifconfig
echo “Press on Ctrl+C to disconnect”

trap “{ kill $PID_WV; sleep 1; kill $PID_BT; exit; }” SIGINT

while true; do sleep 10; done

5. You need to run the script under “sudo”. Ctrl+C will exit and disconnect.

Good luck.

Rotate Beryl/Compiz cube from command line

Tuesday, February 19th, 2008

We are about to have a stand in a show in Israel. To pull some attention, I have searched for a method to automate a random rotation of the famous Beryl/Compiz cube.

An extension of the method provided in here (using macros) is demonstrated below, using a script.

This is a bit more complicated, as I have used the motions of the mouse to achieve a “show” out of it (just changing desktops isn’t enough nowadays…)

Check out below for the full script.

#!/bin/bash
# This script will rotate the cube one click on each direction each predefined
# timer.
# Written by ezaton at tournament.org.il
# Check out my technical blog “Running Systems” at http://www.tournmament.org.il/run

# Set timer (seconds)
TIMER=10
VERT_TIMER=1

# Possible directions? 4 (up, down, left, right. will be marked from 0 to 3)
# Addition – set it to give higher priority to side-stepping. So max is 10, and only 0&1 represent
# up/down
# Added 10 to represent 2xleft and 11 to represent 2xright
POSS=12

# Temp command file
TMP_FILE=/tmp/rotate.macro

function create_file {
# This function will create and secure the macro file
rm $TMP_FILE
if [ -f $TMP_FILE ]; then
echo “$TMP_FILE still exists”
exit 1
fi
echo “” > $TMP_FILE
chmod 700 $TMP_FILE
}

function run_macro {
# Run the actual macro
cat $TMP_FILE | xmacroplay $DISPLAY &>/dev/null
}

function left {
# This function will build the macro file for the “left” command
echo > $TMP_FILE
echo “MotionNotify 100 380” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 380” >> $TMP_FILE
echo “MotionNotify 130 380” >> $TMP_FILE
echo “MotionNotify 150 380” >> $TMP_FILE
echo “MotionNotify 170 380” >> $TMP_FILE
echo “MotionNotify 190 380” >> $TMP_FILE
echo “MotionNotify 210 380” >> $TMP_FILE
echo “MotionNotify 230 380” >> $TMP_FILE
echo “MotionNotify 250 380” >> $TMP_FILE
echo “MotionNotify 270 380” >> $TMP_FILE
echo “MotionNotify 290 380” >> $TMP_FILE
echo “MotionNotify 310 380” >> $TMP_FILE
echo “MotionNotify 330 380” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function up {
# This function will build the macro file for the “up” command
echo > $TMP_FILE
echo “MotionNotify 100 100” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 100” >> $TMP_FILE
echo “MotionNotify 100 120” >> $TMP_FILE
echo “MotionNotify 100 140” >> $TMP_FILE
echo “MotionNotify 100 160” >> $TMP_FILE
echo “MotionNotify 100 180” >> $TMP_FILE
echo “MotionNotify 100 200” >> $TMP_FILE
echo “MotionNotify 100 220” >> $TMP_FILE
echo “MotionNotify 100 240” >> $TMP_FILE
echo “MotionNotify 100 260” >> $TMP_FILE
echo “MotionNotify 100 280” >> $TMP_FILE
echo “MotionNotify 100 300” >> $TMP_FILE
echo “MotionNotify 100 320” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function right {
# This function will build the macro file for the “right” command
echo > $TMP_FILE
echo “MotionNotify 340 380” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 340 380” >> $TMP_FILE
echo “MotionNotify 320 380” >> $TMP_FILE
echo “MotionNotify 300 380” >> $TMP_FILE
echo “MotionNotify 280 380” >> $TMP_FILE
echo “MotionNotify 260 380” >> $TMP_FILE
echo “MotionNotify 240 380” >> $TMP_FILE
echo “MotionNotify 220 380” >> $TMP_FILE
echo “MotionNotify 200 380” >> $TMP_FILE
echo “MotionNotify 180 380” >> $TMP_FILE
echo “MotionNotify 160 380” >> $TMP_FILE
echo “MotionNotify 140 380” >> $TMP_FILE
echo “MotionNotify 120 380” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function down {
# This function will build the macro file for the “down” command
echo > $TMP_FILE
echo “MotionNotify 100 330” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 330” >> $TMP_FILE
echo “MotionNotify 100 310” >> $TMP_FILE
echo “MotionNotify 100 290” >> $TMP_FILE
echo “MotionNotify 100 270” >> $TMP_FILE
echo “MotionNotify 100 250” >> $TMP_FILE
echo “MotionNotify 100 230” >> $TMP_FILE
echo “MotionNotify 100 210” >> $TMP_FILE
echo “MotionNotify 100 190” >> $TMP_FILE
echo “MotionNotify 100 170” >> $TMP_FILE
echo “MotionNotify 100 150” >> $TMP_FILE
echo “MotionNotify 100 130” >> $TMP_FILE
echo “MotionNotify 100 110” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function fix_vert {
# Fixes a case of vertical extention (non-viewable screen)
sleep $VERT_TIMER
case “$1” in
1) down
;;
0) up
;;
esac
}

# Verify we have xmacroplay
which xmacroplay
if [ “$?” -ne “0” ]; then
echo “Missing xmacroplay. Install it”
echo “Use apt get install xmacro”
exit 1
fi

# Do we use X and have a defined display? Won’t work otherwise…
if [ -z “$DISPLAY” ]; then
echo “DISPLAY is not defined. Exiting”
exit 1
fi

create_file

# We start where all is viewable

while true; do
# Select direction
DIRECTION=$RANDOM
let “DIRECTION %= $POSS”
# Debug:        echo “*** $DIRECTION ***”
case “$DIRECTION” in
0) up
fix_vert 1
;;
1) down
fix_vert 0
;;
[2-5]) left
;;
[6-9]) right
;;
10)     left
left
;;
11)     right
right
;;
esac
sleep $TIMER
done

exit 0

Dyslexia at HP Israel

Wednesday, April 12th, 2006

For those of you not familiar with Hebrew, this entry won’t say much. For those of you who are familiar with it, it might say more.

HP Laptops are bundled with a pack of CDs, meant for easy reinstallation/recovery on their laptops. These CDs can be used as the quickest method to recover the laptop to its original state.

Since in Israel some laptops come with Hebrew Windows, and some come with English Windows, HP has decided to allow a per-customer selection. It means you get one CD for English Windows, and one CD for Hebrew Windows. It’s only natural that on the Hebrew Windows CD, you’ll have Hebrew text.

Hebrew is a funny language. written right to left, and not the other way around. It is not uncommon for a print sourced at a non-Hebrew country, or non-Hebrew related company to be written backwards, left to right. You get the hang of reading backwards when you’re long enough in the computers business.

If HP would have supplied a CD where the Hebrew text was spelled backwards, I wouldn’t even write an entry about it. However, they did that, but added letter replacements once a while. Look at the picture:

Dyslexia!

The title in Hebrew says something like (trying to imitate the letter swaps):

"Oepratins Gysmet Mocpactdiks"

It might have been "Operating System Compactdisk", but not quite. It goes on for every other Hebrew text on the CD, getting less terrible towards the bottom of the CD. Nice, still.

I’ve just had to put it here 🙂