Search Results 

Results tagged “howto” from Nothing new here

In some cases, you will want to know the y-coordinate of the top corner of your webpage, relative to the top corner of the screen (the absolute on-screen position). One of such cases could be a Selenium Test with a java.awt.Robot action.

It took me a bit of searching, but it's possible to get the offset:

Just add this value to the position of your html-node and you will get the absolute position of the node on the screen.

Do you know a better/different way? Leave a comment.

It seems that under some unknown circumstances you will hose your iLife 8 installation so that Garageband, iPhoto, etc and other applications which depend on iLife like Mail.app, iChat.app, Google Notifier, Pages, etc will not lauch.

Mine probably stopped working after I installed Garageband from my Macbook's bundled software DVD, which I had not initially installed.
UserNotificationCenter.jpg Symptoms: The app will bounce few times in the dock, close and you will get the following crash report (Example Crash Report for iPhoto, it's the same for all other apps):

Process:         iPhoto [413]
Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto
Identifier:      com.apple.iPhoto
Version:         
Build Info:      iPhotoProject-3640000~10
Code Type:       X86 (Native)
Parent Process:  launchd [177]

Date/Time:       2008-05-04 16:14:58.097 +0800
OS Version:      Mac OS X 10.5.2 (9C7010)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Dyld Error Message:
  Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/ImageKit
  Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeMediaBrowser
  Reason: image not found

Checkig the directory will possibly confirm, that the A directory in /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frameworks/ImageKit.framework/Versions/ is not there:

$ ls -l /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frameworks/ImageKit.framework/Versions/
total 8
lrwxr-xr-x  1 root  wheel  1 Apr 30 22:11 Current -> A

Howto fix this:

  1. Cry like a baby.
  2. Don't panic!
  3. You need the "A" folder from a different Leopard installation with same level of updates as your machine or the proper ImageKit_tiger.pkg from somewhere. At the time of writing, the required folder has the following md5 on 10.5.2 with all security updates:
$ md5 /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/ImageKit
1786a69b42c828414dbd4b191dce1d47

The version according to Resources/version.plist seems to be 1.0.1 and I have NO idea where to get it from if not from a second machine. The iLife 8.2 update on Apple's website has ImageKit with version 1.0! The 10.5.2 Combo Update does not have the required ImageKit at all. My guess would be that it came recently with one of the Standalone Updates, if you have no access to a second machine, try your luck with one of these. You will need Pacifist for browsing the packages. Should you succeed, please leave a comment here.

In any case, after copying the A folder back to it's place it is advisable to repair disk permissions with Disk Utility.

Possible other ways to fix this:

  • Check your Time Machine backup, if you are doing full backups, it may be there!
  • Reinstall everything and hate Apple forever

I finally found some time to watch the You Suck At Photoshop tutorials, and they are hilarious. (Attention: Photoshop CS3 needed...)

Lock this mac

Lockmymac.jpg There was always one feature from Gnome that i missed in Mac OS X, the ability to quickly lock your Mac with a shortcut and go for lunch. Sure, there's that option to lock your mac every time your screensaver goes on, but the problem with that is that I do not want to enter my password every time. At home for example, there is no need to lock my Macbook. Besides this function has a lot of issues when waking up from sleep; Sometimes I would have to wait for a minute until i get a login box. After a long hunt on macosxhints.com, I found a command to show the fast user switching login box without actually having to enable fast user switching:

/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend

There are several convenient ways to execute it:

  • Create an Automator action which executes a shell script (slow to execute)
  • Create an AppleScript Application and put it in your Dock:
    do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend"
  • Run the shell script/ AppleScript from Quicksilver
  • Run the AppleScript in Launchbar:
    Put the AppleScript (.scpt) from above in ~/Library/Scripts and enable Home Library scripts in the Launchbar Configuration (I found this to be the fastest option)
Finally, if you have no idea what I am talking about, but you need this functionality, check out Lock My Mac.

Enabling IPv6 on your PC is not as difficult as you think. This is a quick Teredo/Miredo Howto for the most popular operating systems allowing you to penetrate most NATs and Firewalls and most likely allowing you to bypass any blocking or censorship happening at your place. As a free bonus, i will will show you where to access tons of Usenet posts, including binaries over ipv6 for free.
Nota bene: Since Teredo also works from China, you can use it together with the *.sixxs.org proxy to read any of your favourite, blocked sites.

I also have a tutorial for IPv6 with tunnelbroker.net from HE for Mac OS X.

Windows XP
WARNING: Whatever you do, make sure you have all the latest security patches for remote exploits and your Windows firewall is up, if you use 3rd party, ensure it supports IPv6. Enabling IPv6 will put you on the net, losing any protection you may have had behind your router's NAT. At the moment there are not many attacks over ipv6, but this may change any time.

Install
Open the Terminal with Start -> Run -> cmd

netsh interface ipv6 install
netsh interface ipv6 set teredo client
Wait for few moments.


Uninstall

netsh interface ipv6 uninstall

Windows Vista
Install
IPV6 and Teredo is enabled per default. You can get into the settings by going into the preferences for an network interface. "Obtain an IPv6 address automatically" should do the trick. However, Teredo will disable itself if you have "edge traversal" or outgoing udp packets blocked in your firewall or if your router is a symmetric-nat router (e.g. Speedtouch 780). In that case you have to use a tunnel broker, see comments below.
If you can go to http://www.ipv6.sixxs.net/, everything works well, if not... well, good luck. I never really got Teredo to work on Vista Business reliably, sometimes it works, most of the time it does not.

Uninstall
Add this registry value ("DWORD") set to 0xFF (long line, double-click, and copy):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents
Or save the two lines in a .reg file and double-click it:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters]
"DisabledComponents"=dword:000000ff
You can also go to the interface properties of an network interface and deselect the IPv6 protocol for that interface. To enable IPv6 again, replace dword:000000ff above with dword:00000000.

Debian, Ubuntu
Install
On Ubuntu IPv6 is enabled per default, but not configured.
sudo apt-get install miredo

Because the default server did not work for me, I had to change it to another one:
sudo vi /etc/miredo.conf
ServerAddress teredo.ipv6.microsoft.com
sudo /etc/init.d/miredo restart

Uninstall
sudo apt-get remove miredo

Fedora, Redhat
Install
About the same as on Ubuntu. On Fedora Core 6 & 7 IPv6 is enabled per default, but not configured. You need to get miredo rpm from the Dries RPM repository.
sudo rpm -Uvh miredo-*.rpm
Uninstall
sudo rpm -e miredo

Mac OS X
Install
Get the Miredo installer from Miredo-Osx, and install it. If you are lucky, that's it. if not, try changing the server, see Debian howto above.


Uninstall
If you want to uninstall, execute the uninstall-miredo.command script, located in the /Applications/Utilities folder.

Checking if everything is working

On the terminal type:

ping6 pugio.net

In browser come back to this page, there should be a pin-up girl in lower right corner telling you that you have IPv6 and give you some more info if you click her... If you can ping6 but can't visit ipv6 websites, check your Firefox network.dns.disableIPv6 setting, did you set it to true previously?


Cool stuff

Having lived for many years in Shanghai and being asked the same questions over and over again, I decided to write a series of articles with tips for living here. As a starter, a list of sites which should answer all your questions and cover most of the things i may write about in my articles later.

Community, Directories

  • shexpat.pngShanghai Expat - Number one expat community in Shanghai, you can get most of your questions answered here and more. Their directory sucks however.
  • Schanghai.com - German expat-community in Shanghai and China
  • SmartShanghai - Great directory of food, pubs, clubs, etc, and a community.
  • City Weekend - Directory of everything, their magazine is available for free in many places.
  • That's Shanghai - Another magazine and directory, I read the mag, but don't use their site.
  • Shanghai Eats - Food directory.
  • Live in Shanghai - Info on many things, i never used that site. Looks informative

Food Delivery
Mmh... Pizza...
  • Pizza Hut Delivery - I suggest you get somebody to sign up for you, since the address entry is not so trivial (bad translations)
  • Papa John's Pizza - Quick delivery, much better than Pizza Hut. You need to find the closest shop here and see if they can take the order in English.
  • Hello Pizza - "Same ingredients as the pizza market leaders!" :-o
Mmh... Sandwiches...
  • Citydeli - Possibly the most expensive Sandwiches in town? :-D
  • NYC Deli - Prices seem ok, but I am too lazy to order over the phone... you guys need online ordering!
  • Icistreet - If you happen to be working or living in XuHui, check out this low-cost sandwich place.
  • iiiit.cn - Horrible flash site, broken online ordering, link goes to their pdf formatted menu
  • Coolzey - Shops along Shanxi Rd.
All in one delivery...
  • Sherpa - Oldest one, and probably the most expensive one too, great food though.
  • Mealbay - Haven't tried them, similar to Sherpa.
  • Dial A Meal - Haven't tried them, similar to Sherpa, don't know any of their restaurants either :-P

Online Shops
  • Books Direct - English language books in China, free delivery.
  • Newegg China - Electronics, Chinese only site
  • Taobao - forget ebay, Chinese only site
  • Amazon.cn - Amazon's attempt to enter the Chinese market, Chinese only site

Language
  • chinese1.pngChinesePod - I quite like these podcasts, not only focusing on learning Chinese but also making you understand the culture
  • Melnyks - Similar to Chinese pod, spoken by a Canadian. (I think that guy has terrible accent, but some people think, he's the best thing since sliced bread.)

News, Blogs
  • Danwei - Media news in china, may be not interesting for some
  • ShanghaiBites Food blog, did not update it for few weeks.
  • Likealocal.cn - Another local food blog. From personal experience I would not recommend trying any food from roadside stalls, but otherwise it should be save :-)
  • Shanghai Daily - English language newspaper in Shanghai. Forget China Daily

Maps, Metro
  • SmartShanghai's Downtown Map and Metro - Interactive maps of shanghai and the metro.
  • Explore Shanghai - Excellent interactive map of Shanghai Metro, drag between stations to get travel time and price, click on a stop for more information. The map of downtown is not bad either, the whole site looks very promising, I hope they won't shut it down any time soon.
  • Google Ditu - Chinese only maps. Not really useful if you can't read and write Chinese characters.

Hotels, Flights, Trains
  • ctrip.pngCTrip - I use this to book china flights and hotels
  • China Train Schedule - Can't vouch for their accuracy, never took train here.
  • Cheap Budget Hotels - List of cheap motel chains in shanghai, I have stayed in many of them. Good choice if you are on budget. (The beds will be most likely (quite) hard, to suit the Chinese taste)

Jobs
zhaopin.png This three links are all you need for your job search. If you are looking for a specific company, you may want to try going to that company's website directly. For internships there are dedicated websites (can't think of any), also your country's chamber of commerce in shanghai may have a list of internships and jobs available.

Visa, Housing
  • emoo.pngEmoo.net - I get my Z-Visas done through them, saves you a lot of time and pain. They also provide other services which I have not tried.
  • SmartShanghai Housing - One of few housing links i will include here. Usually you will get ripped off or end up paying far too much for an apartment in a foreigner ghetto. Find a local to help you out if you don't want to pay more than RMB 6000 or don't feel like getting ripped off.

links for 2007-05-21

links for 2007-05-16

I have been chatting with yimou about manly things and we came to the conclusion that the internet needs more "manly" blog posts. More manly blog posts from us (cough.. cough... crickets).

Skip to: Tutorials, Tools

Photo by Edwinek from FlickrSo what do real men do every day besides farting, drinking beers and creating great things out of trash? That's right, shaving!

It's a shame that this daily ritual has been degraded to smearing some bad smelling soylent green colored goo out of a can on ones face and then rape the skin with the latest four (maybe it's five or six blades by now) blade vibrating something from some company I don't want to do advertisement for, but it for sure does not go mach 3. It smells bad, is bad for your skin and leaves you with a lot of ingrown hairs (depending on your skin/beard type). A pack of 8 replacement blades for your unmanly vibrator thingy costs you $23.29 and if I remember correctly they don't last for long. Don't forget the batteries. Contrary, a pack of Wilkinson Sword Classic safety blades costs you $4.99, and there's ten blades inside. If you go for luxury, the Merkur Double Edge Razor Blades, that would be $5.29 - also for ten. And you can get them in bulk pushing the price per blade lower. Do the comparison for yourself.

I have been using this very old fashioned shaving method since February 2007 and I have never been happier with my shave. My face looks clean and i had no ingrown hair anymore, which was a huge problem for me before.

I suggest you go to your local drugstore and grab a single blade razor (if you can still find one between all the "modern" tools, i suggest trying amazon instead), glycerine based shaving cream (they usually come in a tube) and a nice badger hair brush. That's what I think every real man uses, including your cool grandpa.

Tutorials
I won't teach you here how to use your freshly purchased manly goods, because mantic59 did a great job in creating a series of video tutorials and posting them on youtube.

For the beginning, you should check the following videos out:

The Tools
Also, i know it's very difficult for a beginner to pick the right tools, so I will highlight here some of the things I have been using and comment on them:

That's it. For reference, a blade lasts on me for a week or two, but sometimes i would skip a day, so your mileage may vary. The soaps and creams also last for many shaves unlike the canned shit. If you have anything to add or share, like your favorite razor or soap, leave a comment! Thanks.

This server is running Fedora Core 6, since I like to play with fresh packages - Debian was always years behind and i did not want to depend on backports.org forever. So anyway, Fedora has always some basic things which just don't want to work out of the box. bind-chroot being one, and proper local mail delivery with procmail being another. Should you ever get something like:

Mar 28 08:00:39 h70524 postfix/local[4916]: 4D2A440C646: to=<root@pugio.net>, orig_to=<root>, relay=local, delay=3.9, delays=3.6/0.17/0/0.1, dsn=5.2.0, status=bounced (can't create user output file. Command output: procmail: Couldn't create "/var/mail/nobody" )

just do a "chmod 4755 /usr/bin/procmail" and all your problems will be solved.