Archive

Posts Tagged ‘egypt’

updating osx for egypt’s dst changes

April 28th, 2011 No comments

as people in egypt know, dst was cancelled in egypt:

“…Egypt’s interim cabinet decided on Wednesday to cancel daylight saving time after a poll posted on its website showed the majority of Egyptians would approve the cancellation.” (via almasryalyoum).

so, what do us apple users do until apple releases a fix?  @vodafoneegypt suggested that people switch to the Harare time zone.  not my cup of tea.  thinking about manually changing your time?  bad idea if you have a twitter client.

so how do you properly fix it?  here’s a set of instructions that i adopted (based off of this post from argentina and this post from new zealand) to properly solve the problem in egypt.

updating osx

as people who have dealt with timezones before know, the timezones are updated via the zoneinfo database.  you can see more information on the database on wikipedia.

1.  download the latest tzdata file from here (currently, this links to 2011 version g, updated as of 4/25/2011, however, check here to see if there is a newer one).

2.  run the following commands:

mkdir a
cd a
tar xzf ../tzdata2011g.tar.gz
sudo zic africa

by the way, just for fun, open the africa file and search for egypt – you’ll notice all the different times egypt’s timezone rules changed :)   anyhow, at this point, your command line (terminal) time should be correct – verify it by typing date.  you’ll notice, however, that your system clock is still wrong.  let’s fix it…

3.  so the time in osx is not just affected by updating the zoneinfo database – you also need to update the icu database so that it also uses the latest zoneinfo database.  if you have xcode and want to build manually, download icu from apple (i am using 400.40, but you can check here if there’s a later one).  otherwise, jump to step 4b.

4a.  if you have xcode, run the following commands:

tar xzf ICU-400.40.tar.gz
cd ICU-400.40
cd icuSources/tools/tzcode
# ./icuSources/tools/tzcode/readme.txt tells us that placing a tzdata
# file in the tzcode directory will compile with that zoneinfo database

# copy the tzdata file from step 1 here
cp ~/Downloads/tzdata2011g.tar.gz .
cd ../..

# compile
./runConfigureICU MacOSX --with-data-packaging=archive
gnumake
# if you want, backup your current icu file first
cp /usr/share/icu/icudt40l.dat ~

# replace the data file only
sudo install -o root -g wheel -m 0644 -Sp data/out/icudt40l.dat /usr/share/icu/icudt40l.dat

4b.  if you don’t have xcode, you can download my icudt40l.dat file from here and install it by doing:

bunzip2 icudt40l.2001g.bz2
mv icudt40l.2001g icudt40l.dat
sudo install -o root -g wheel -m 0644 -Sp icudt40l.dat /usr/share/icu/icudt40l.dat

reboot your system and you should be good to go!

ios?
although technically speaking, the same steps for osx apply, the icu file is a different version (icu46l.dat) – i built icu4c-4.6.1 and pushed the dat file to my iphone, but unfortunately, it didn’t fix the problem.  unfortunately, i don’t have solution for this one yet :(

java developer?

if you are a java developer, you’ll notice that java’s time is also wrong…  this is because java also has its own timezone database that needs updating.  although, sun oracle provides a tool for fixing this, it is only up to 2011e (rather than 2011g) as of the time of this post.

you can verify that the time is wrong by running a program like this:

import java.util.Date;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.GregorianCalendar;

public class Test {
 public static void main(String[] args){
 Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("Africa/Cairo"));
 cal.setTimeInMillis(new Date().getTime());
 System.out.format("%1$tT (%1$tB %1$td %1$tY)", cal);
 }
}

sure enough, one hour off.   when the package is updated for the 2011g changes, you’ll download the latest version, extract it, and then run:

sudo java -Djava.vendor="Sun Microsystems Inc." -jar tzupdater.jar -v -u

if you were to do this now, you’d update to 2011e, which still doesn’t include the fix.

Categories: technology Tags: , ,

عسل وطحينة

June 13th, 2010 No comments

i wanted to write about my experiences in egypt, and so i started a new blog (i decided not to write those posts here because they’re not highly technical or programming related (or geeky)). you can find it at masr.whatstheplot.com.

Categories: website Tags:

2008 africa cup winners: egypt!

February 10th, 2008 1 comment

woot! egypt won the 2008 africa cup of nations! beautiful game, i only saw the last 20 minutes, but those were the 20 minutes that mattered. beautiful assist by zidane in a crazily intense moment, passing to abu trayka who scored :) incredible work of art!

i am not a big fan of sports, but this was one game i had to watch :) second cup win in a row, the last being against the ivory coast in 2006.

Categories: random Tags: ,

eid mubarak!

January 10th, 2006 2 comments

salam 3alaikum…
this post comes from our reporter in cairo. man sub7anAllah, this is the first 3eid i spend in cairo. i woke up, as usual, to the fajr athan. i got up, prayed, and went back to sleep, only to wake up a little later to the loud speakers broadcasting the people saying, “Allahu akbar, Allahu akbar, la illaha illa Allah… Allahu akbar, Allahu akbar.. wa lillahi al 7amd…”

so i got up, took a shower, and went… i went to a local masjid… after the prayer itself, most people left… but after that, i listened to the (interesting) khutbah – one of the interesting points made that i never really thought of is the fact that sub7anAllah, 3eids come right after a big pillar of islam or a big piece of worship… kinda as a reward.

anyhow… chilled the majority of the day – it was really cool though seeing the groups of goats, hearing the occaisional “baas”, and seeing everyone slaughtering them, seeing people move the dead goats around, cleaning them, skinning them, seeing rivers of animal blood in the streets, and seeing people selling the animal furs in the street.

… and at the end of the day, it rained. i think it was the first time i saw rain while i was in egypt. that’s all for now..

update: i came across this article about the eid salat khutbah on in… it quotes a 7adith which states that its not actually mandatory… i didn’t know this… but, of course, Allahu a3lam.

Categories: islam, random Tags: , ,

مصر

January 6th, 2006 No comments

my flight to مصر is in 4 hours insha’Allah. i’ll be back friday insha’Allah. its short, but on the bright side, i get a few days off of work and i get to celebrate eid there insha’Allah. eid mubarak to all in advance.

Categories: random Tags: ,