Saturday, July 23, 2011

OSX strace dtrace

http://humberto.digi.com.br/blog/2008/02/25/strace-on-mac-os-x-leopard/ 

strace on Mac OS X Leopard

One of the most important tools for sysadmins and programmers working in the Linux/BSD environment is called strace. As it took me some time to find out where is “strace for Mac”, I thought it would be worth documenting here…
Making a long story short: in Tiger it was called ktrace, in Leopard it’s called dtrace, but it’s simpler if you just call dtruss.
Here are some examples directly from the dtruss man page:
dtruss df -h     # run and examine the "df -h" command

dtruss -p 1871   # examine PID 1871

dtruss -n tar    # examine all processes called "tar"
For a more “real-life” example, please see this article: Why DTrace Makes Leopard a Must-Have Upgrade — you’ll even learn how to prevent Time Machine from consuming all your CPU.
UPDATE: Just after posting this I discovered that:
1. There’s a really cool GUI for DTrace called Instruments. After playing with it for just a few minutes I was able to detect that it waspsyco that was causing Python 2.4 to segfault when running web2ldap. Now back to a little more tinkering to discover why
2. Leopard/DTrace provides one command that I always wanted: iotop, to show which processes are responsible for the disk I/O (more dtrace commands here). Now to the question: is there a Linux version? The answer is: yes, and it’s written in Python (and requires a kernel >= 2.6.20).

Friday, July 22, 2011

corp images

https://ssl.gstatic.com/corpsso/images/3235300735_db3bdde565.jpg

https://ssl.gstatic.com/corpsso/images/beach_jump_Saunton_Sands_kim.jpg

https://ssl.gstatic.com/corpsso/images/IMG_0874.jpg

https://ssl.gstatic.com/corpsso/images/Half_Dome.jpg

https://ssl.gstatic.com/corpsso/images/DSC03448.jpg

https://ssl.gstatic.com/corpsso/images/baja_sunset2.png

https://ssl.gstatic.com/corpsso/images/Bandelier_20dwellings.jpg

https://ssl.gstatic.com/corpsso/images/Chandrataal.jpg

https://ssl.gstatic.com/corpsso/images/Route_66.jpg

https://ssl.gstatic.com/corpsso/images/52796885_80b2aa3517_o.jpg

https://ssl.gstatic.com/corpsso/images/new.jpg

https://ssl.gstatic.com/corpsso/images/hermit-crab.jpg

https://ssl.gstatic.com/corpsso/images/Chitzen_Itza_7.jpg

https://ssl.gstatic.com/corpsso/images/Underwater_Turtle_2.jpg

https://ssl.gstatic.com/corpsso/images/manhattan_beach_plumeria.jpg

https://ssl.gstatic.com/corpsso/images/2054919569_558b427352.jpg

https://ssl.gstatic.com/corpsso/images/Bali_-_Rice_Terrace__cp_.jpg

https://ssl.gstatic.com/corpsso/images/canyon.jpg

https://ssl.gstatic.com/corpsso/images/sasso.jpg

https://ssl.gstatic.com/corpsso/images/aquarium1.jpg

https://ssl.gstatic.com/corpsso/images/ashton2.jpg

https://ssl.gstatic.com/corpsso/images/seronera_river.jpg

https://ssl.gstatic.com/corpsso/images/Charminar.jpg

https://ssl.gstatic.com/corpsso/images/Feet.jpg

https://ssl.gstatic.com/corpsso/images/tokyo_cherry_blossoms_light.jpg


https://ssl.gstatic.com/corpsso/images/Route_66.jpg

https://ssl.gstatic.com/corpsso/images/CIMG2441_001.jpg

https://ssl.gstatic.com/corpsso/images/eyechart-larger.jpg

https://ssl.gstatic.com/corpsso/images/564050313_SZCFJ-L.jpg

https://ssl.gstatic.com/corpsso/images/IMG_0436.jpg

https://ssl.gstatic.com/corpsso/images/Australia-26.jpg

https://ssl.gstatic.com/corpsso/images/Tree_Rock__Bolivia.jpg

https://ssl.gstatic.com/corpsso/images/DSC03520.jpg

https://ssl.gstatic.com/corpsso/images/temple.jpg

https://ssl.gstatic.com/corpsso/images/CIMG1081.jpg

https://ssl.gstatic.com/corpsso/images/07-29-2006-01-015.jpg

https://ssl.gstatic.com/corpsso/images/SF_GGBridge_cp.jpg

https://ssl.gstatic.com/corpsso/images/DSCN2364_001.jpg

https://ssl.gstatic.com/corpsso/images/half-moon-bay-bridge-right.jpg

https://ssl.gstatic.com/corpsso/images/2651197556_b4353be44a.jpg

https://ssl.gstatic.com/corpsso/images/Avalanche_barriers_-_Hoher_Kasten.jpg

https://ssl.gstatic.com/corpsso/images/baja_sunset2.png

https://ssl.gstatic.com/corpsso/images/orange_butterfly_on_pink_flowers.jpg

https://ssl.gstatic.com/corpsso/images/IMG_6264c.jpg

https://ssl.gstatic.com/corpsso/images/kevinskitchen.jpg

https://ssl.gstatic.com/corpsso/images/Mono_20Lake.jpg

https://ssl.gstatic.com/corpsso/images/memory.jpg

https://ssl.gstatic.com/corpsso/images/CIMG2299.jpg

https://ssl.gstatic.com/corpsso/images/IMG_1642.jpg

https://ssl.gstatic.com/corpsso/images/velib.jpg

https://ssl.gstatic.com/corpsso/images/Africa_Leopard.jpg

https://ssl.gstatic.com/corpsso/images/116_1690.jpg

https://ssl.gstatic.com/corpsso/images/IMG_0072.jpg

https://ssl.gstatic.com/corpsso/images/jlinet2.jpg

https://ssl.gstatic.com/corpsso/images/IMG_2664hdr2.jpg

https://ssl.gstatic.com/corpsso/images/trogdor_bearded_dragon.jpg

https://ssl.gstatic.com/corpsso/images/20070911063428_picture_20012.jpg

https://ssl.gstatic.com/corpsso/images/mood07f.jpg

https://ssl.gstatic.com/corpsso/images/2167372413_82383e869b.jpg

https://ssl.gstatic.com/corpsso/images/DSCN2364_001.jpg

Thursday, July 21, 2011

todays android links

Or, "How to build the Calendar.apk from source - and install it in an emulator and have it do something useful"

Calendar source:  http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=summary


http://source.android.com/source/building.html



http://forum.xda-developers.com/showthread.php?t=899674

http://andromnia.sourceforge.net/wiki/docs/howto_build_android_from_source

https://groups.google.com/forum/#!topic/android-building/qzJDZ5PkLsI - Android Building FAQ

http://elinux.org/Android_Build_System


key step:


$ lunch sdk-eng  # or sdk-userdebug
$ make sdk

got to the part where I installed Calendar.apk, but there was no google accounts on the avm emulator -- so it wanted me to setup an ms exchange account....

how do I get live data onto it to play with?


http://www.google.com/support/mobile/bin/answer.py?answer=138740&topic=14252

Setup MS Exchange Sync with my google account, of course!

Monday, July 11, 2011

How to integrate PHPUnit and the newer Selenium webdriver

Turns out this is a cutting edge development area:

https://github.com/chibimagic/WebDriver-PHP is currently getting commits.
http://code.google.com/p/php-webdriver-bindings/ is also.

This is separate from the other configuration nightmare that I was facing -- how to test in Selenium using chrome:

http://code.google.com/p/selenium/wiki/ChromeDriver

So, for now, I can either go with the older Selenium 1.0 framework (Selenium RC) -- and the current bindings in PHPUnit -- or use bleeding edge bindings.

Ugh.

Spinwait.

Thursday, July 7, 2011

PHP5 on OSX 10.6

Beginning steps:

copy /etc/php.ini.default to /etc/php.ini

edit/set the time zone in the php.ini file.

enable OSX web sharing (turns on apache2)

follow the yii guide installation instructions (pdf in the -docs package)

install yiiframework somewhere in ~/Sites

instructions to compile a compatible libmcrypt into the stock apache2:
http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10-6-1/

visit
  http://127.0.0.1/~username/yii/requirements/index.php
profit!


update: we might just want to recompile:

http://www.malisphoto.com/tips/php-on-os-x.html ::
These installation instructions will compile PHP with a configuration that closely matches the PHP configuration shipped with OS X, but with the addition of enabling GD, PDO and MCRYPT support.
but we wound up not using these explicit instructions, and macports just worked.

apple's php534 was configured with:

'/var/tmp/apache_mod_php/apache_mod_php-53.4~2/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-53.4~2/Root/usr/local' '--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-53.4~2/Root/usr/local' '--enable-gd-native-ttf' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/mysql/mysql.sock' '--with-iodbc=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr' '--enable-zend-multibyte' '--enable-zip' '--with-pcre-regex=/usr'


except -- at this point -- it would seem silly to try and recompile an "apple-like" php5


why not just use macports:


http://stackoverflow.com/questions/3484306/setting-up-postgresql-to-work-with-my-local-dev
and
http://laurii.info/2010/08/macports-berkley-db-4-problem-and-work-around/


which had the command:

sudo port install apache2 postgresql83 php+postgresql83+mysql5+pear+apache2
but didn't work exactly -- we found out later.

and with only a tiny bit of cruft (need to add local machine name to /etc/hosts as a loopback ip)
http://old.nabble.com/Localhost-down-%7C-MacPorts-LAMP-td27733679.html

using instructions at http://www.mkbernier.com/2010/09/28/installing-macports-php-mysql-pear-and-phpunit-on-mac-osx-snow-leopard/

we recompiled php5 with additional flags, and followed their config changes.

sudo port install php5 +apache2


sudo port install php5-sqlite php5-gd php5-mcrypt


fairly good looking success now:

Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/1.0.0d DAV/2 PHP/5.3.6 Yii Framework/1.1.8 2011-07-07 05:46

#RSFtalks with Edward Snowden

What an intelligent, thoughtful individual. I find it difficult to forgive 44 for failing to pardon this patriot and instead pursuing him ...

Other Popular Posts: