|
At the crossroad of New media, Engineering, Research and Development
|
|
Archive for ‘Apple’ Category
Nov
02
2011
Using iCloud to sync files just like dropboxIf you didn’t know, iCloud has a really neat feature that allows it to act just like dropbox. If you activate the “Document & Data” synching option in the iCloud pref panel, it allows you to sync any file using iCloud. This is contrary to what Apple is selling the service as being just for “Custom” Apps that have the iCloud feature (i.e.: keynote, numbers, etc.).
Aug
04
2011
Lion Tip: Adding your digital signature to PDF files….If you ever are in need of signing a PDF file, you don’t need to print/sign/scan it anymore, Lion’s new preview app lets you insert/sign those pdf docs in a flash. Here is how you get your signature “scanned”.
I had to do this twice, but it’s very easy and quick to do. You can even have multiple pics taken of your signatures (or other peoples sig in your household). Now that I’m getting settled in the latest OSX, I thought I share with you a couple of finder gems that might not be obvious right from the get go: 1) You now have the ability to select multiple files in a folder and right click on them to choose “New Folder with X Selections”. This will create a new folder and move the selected files into that folder. Kinda neat and makes the process of moving large number of files a bit simpler. 2) You can now “move” files and folders from one place to another. First “copy” the file/folder in question by selecting it and using the command-c shortcut. Then find the place you want to move them to and instead of using the usual command-v (which copies the files/folders) use command-option-v instead. Yeaaaaa, we can finally be just like our windows cousins 3) To remove something from the finder sidebar, hold the command key as you drag it out. 4) In the Finder’s “Go” menu hold the option key to reveal a “Go to Library” menu item. Although not strictly a new finder gem, Window resizing now supports standard modifier keys, so holding Shift while resizing a window constrains it to its existing aspect ratio, while holding Option resizes the window from its center point. Mar
19
2011
Tethering iphone 3GS and ipad 1G using bluetooth…Yep, it works. I was kinda disappointed when firmware 4.3 was introduced and the 3GS owners were left in the cold as far as wifi hotspot sharing. Apple only activated that function on the iphone 4. Anyhow, after messing around with the menus a bit tonite, I figured out how to do something similar to wifi tethering (hotspot) of ipad to the iphone 3GS using bluetooth. Here is how you do it:
To stop turn Personal Hotspot off on the iphone. If you need to connect again, turn Personal Hotspot on (assuming BT is on already) and click on the iPhone entry in the Bluetooth menu on your ipad. N.B. The iphone can also “share” it’s wifi connection with the ipad using bluetooth. Neato UPDATE: After a bit of testing here are some numbers. These were done around midnight on Rogers/Fido Network through bluetooth (iphone 3GS on 3G):
Not bad for bluetooth I guess. Feb
04
2011
Adding mcrypt support to builtin php5 on OSX Leopard….I got a request to add mcrypt support to our Leopard server today and here is a brief step-by-step installation instruction. This works well under the current 10.5.8 server installation. It should also work for 10.6 (snow leopard), but I have not tried it. Before you start here are the requirements:
Please note that this will add mcrypt support to php. This is NOT the same as compiling mcrypt. Okay, so now that we have all the requirements, you need to get a command line window opened and get a root shell (sudo -i). The rest of this document assumes you’re typing the commands in a root shell. There is one dependency that we need to clear before we actually get down and dirty and that is libmcrypt. Follow the instructions below to get this installed:
This is the latest version as of this writing (Feb.04.2011). NOTE: If you’re compiling on a G5 machine you’ll need to tell the compiler that you want to build/configure for a ppc64 target so instead of the below configure command you need to use this:
The last command will simulate the installation process. Make sure the stuff is getting installed in /usr/local/lib
At this point you should have a working installation of libmcrypt. This next command prints out the current version of your php engine. In my case under 10.5.8 it’s php 5.2.14.
Grab the appropriate php-5.2.XX.tar.bz2 file from php.net. I just grabbed the stock PHP 5.2.14, since I wanted a perfect match between my php engine and the extension. I transferred the file using sftp to the /SourceCache folder on the server. NOTE: If you’re compiling on a G5 machine you’ll need to tell the compiler that you want to build/configure for a ppc64 target so instead of the below configure command you need to use this:
The last command will simulate the installation process. Make sure the stuff is getting installed in /usr/lib/php/extensions/no-debug-non-zts-20060613
Now we need to modify our php.ini file and tell the php5 engine of the availability of this new module. To do this you need to copy php.ini.default to php.ini (in /etc directory). For details of why have a look at this article.
Edit the newly created/copied php.ini using your favourite editor. Add the following line to the appropriate location (read the comments in the file to find the location):
Still in the same file find the variable “extension_dir” and change it’s value to “/usr/lib/php/extensions/no-debug-non-zts-20060613″ path instead of “./”. Save the php.ini and use the following command to see if mcrypt extensions are available:
Done. Restart Apache service from the server manager (just for the sake of completeness). Feb
04
2011
Adding GD support to builtin php5 on OSX Leopard….I got a request to add GD support to our Leopard server today and here is a brief step-by-step installation instruction. This works well under the current 10.5.8 server installation. It should also work for 10.6 (snow leopard), but I have not tried it. Before you start here are the requirements:
Please note that this will add GD support to php. This is NOT the same as compiling the GD graphics library (libgd). Okay, so now that we have all the requirements, you need to get a command line window opened and get a root shell (sudo -i). The rest of this document assumes you’re typing the commands in a root shell. There is one dependency that we need to clear before we actually get down and dirty and that is libjpeg (known as jpegsrc). Follow the instructions below to get this installed:
This is the latest version as of this writing (Feb.04.2011). NOTE: If you’re compiling on a G5 machine you’ll need to tell the compiler that you want to build/configure for a ppc64 target so instead of the below configure command you need to use this:
The last command will simulate the installation process. Make sure the stuff is getting installed in /usr/local/lib
At this point you should have a working installation of libjpeg. Now we double check our php version.
Notice in the output that I have php 5.2.14 installed on the machine (again the latest update as of Feb.04.2011). Apple does not provide source code for this exact version of PHP. On top of that The numbering scheme that they use is weird. On my machine it is “apache_mod_php-44.6″, you can find yours using the following:
The thing you’re looking for (“apache_mod_php-44.6″) is under Configure Command. If you go to the following URL (http://www.opensource.apple.com/source/apache_mod_php/) in your browser (safari, firefox) you’ll soon discover these weird directory names with numbers that don’t match the php versions. Again, as of this writing (Feb.04.2011), I can’t find apache_mod_php-44.6 folder in the listing so I grabbed the nearest numbers apache_mod_php-44.2 which is php 5.2.8…….close enough. It seems to work. Follow the steps below to get the file and compile the GD portion of it. Remember we’re not recompiling the entire php, just the GD plugin portion. UPDATE: You CAN install the exact version of your PHP’s GD extension. Instead of grabbing the file from Apple, figure out the version of your PHP using “php -v” and grab the appropriate file from php.net instead. I just recompiled the GD portion of PHP 5.2.14, since I wanted a perfect match between my php engine and the extension. The instructions below (except curl which needs to be modified) work. NOTE: If you’re compiling on a G5 machine you’ll need to tell the compiler that you want to build/configure for a ppc64 target so instead of the below configure command you need to use this:
The last command will simulate the installation process. Make sure the stuff is getting installed in /usr/lib/php/extensions/no-debug-non-zts-20060613
Now we need to modify our php.ini file and tell the php5 engine of the availability of this new module. To do this you need to copy php.ini.default to php.ini (in /etc directory). For details of why have a look at this article.
Edit the newly created/copied php.ini using your favourite editor. Add the following line to the appropriate location (read the comments in the file to find the location):
Still in the same file find the variable “extension_dir” and change it’s value to “/usr/lib/php/extensions/no-debug-non-zts-20060613″ path instead of “./”. Save the php.ini and use the following command to see if GD extensions are available:
Done. Restart Apache service from the server manager (just for the sake of completeness). Jan
16
2011
Hauppauge Broadway: OTA ATSC streaming for iOS devices….
Jan
16
2011
Optimizing Snow Leopard for SSD drives….I just installed a new 128GB SSD drive in my older C2D 17″ macbook Pro and let me tell you….WOW….This thing is on fire. The system is extremely responsive and apps literally jump onto the screen. The machine now boots up to full desktop in roughly 17 seconds. Now that’s nice. I did do a bunch of changes to the way Snow Leopard is setup to optimize a couple of things that are normally tuned for HDD’s.
This should do it. Have fun with your new SSD drive. Jan
16
2011
Five minute Augmented Reality via Quartz Composer….Great little video on how to setup AR marker recognition under QC. Even has a nice mellow background music
Oct
19
2010
I wonder what it will look like in 2020….Oct
19
2010
Terminal Tip: Finding information about a mp3 audio file…Here is a quick tip for you OSX command line fans. If you want to find metadata information about a mp3 file use the “afinfo” command. Very quick and scripting friendly. Here is a example:
Sep
20
2010
say -v "Bad News" fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fuk fukSep
20
2010
Map any network drive to Mac OS X that auto mounts after system rebootHere is a quick recipe for making a network drive auto mount on your OSX machine. This works with pretty much any protocol supported by Finders “Connect to Server” option. Here is how you do it:
That’s it…..Enjoy Sep
02
2010
Reset iTunes 10 window control buttonsNot sure what’s happening lately in the Apple UI design department. Someone over there decided to reposition the window control buttons (you know x,-,+ aka. close,minimize,maximize) vertically in the latest itunes10 (see pics below). If you prefer the old (proper) way of having them ordered horizontally (see picture above), you can use the commands below:
If you need to reset it back, you can use the commands below:
Aug
26
2010
OSX Server: Could not setup Mach task special port 9
If you’re seeing this warning/error in your OSX Server log files, it is more than likely caused by cron running jobs for mailman subsystem. Even if the Mail process is disabled in Server Admin, OSX will try to run these cron jobs. The way around this (only do this if you’re NOT running mail server or mailman mailing list manager on your box) is to comment out all lines in /usr/lib/cron/tabs/_mailman file (insert a # character at the beginning of each line that doesn’t have it). This fixed the problem for me…..hopefully it will also work for you Aug
25
2010
Duplicating service settings under OSX Server…This mainly applies to how you deal with a backup DHCP server and it’s configuration, but might also be useful for backing up other service settings. One of the things that kinda bugs me about how some services are configured in OSX Server is the fact that the configurations are stored in the directory. For example, if you have a DHCP server servicing a subnet with a ton of reservations hardcoded in it, there is no way of editing and/or moving the information from the command line (ie: there is no single config file that contains the current configuration) to another server. That’s where the “serveradmin” commandline program comes to rescue. If you have two identical servers (ie: both running the same OSX server version), you can use serveradmin to export the settings from a specific service and then move the file to the new server and import it there. All using the CLI.
Aug
23
2010
MySQL Replication howto for Snow Leopard…We recently upgraded our servers from old XServe G5′s running Tiger to the latest greatest running Snow Leopard. In this small howto I will deal with the procedure I followed to setup mysql master-slave replication between two new servers. I start out with two (master, slave) empty DB’s, setup the replication and then import my data from a third server (my old G5 X-Serve). Of course like anything else I will try to show you how to get out of — what I like to call — Steve Jobs Hell Holes - First things first….the magic command that stops mysql server from command line, just in case you screw something up and need to restart (This should be used on your master and slave servers prior to them going live…..DO NOT USE THIS ON A LIVE SERVER):
This will stop the launch Daemon from continously launching mysql when trouble is brewing. This usually happens when you screw something up badly and the symptom is that the Server Manager Status for MySQL will say “Starting up“, but never changes to “Running“. - Next I want to blow away my DB files on the master and slave (remember these are NOT production servers yet…..I’m still rebuilding them. You DO NOT want to remove the DB’s on your production servers). You’ll need to find the path in the “Settings” tab of the server manager, under “Database Location“. I removed everything in that directory (rm -rf *) from the command line. AGAIN, I CAN NOT STRESS THIS ENOUGH, BE CAREFUL WHERE YOU ISSUE THESE COMMANDS. - I did this on both the master and the slave. - Now on the Master change the following in /etc/my.cnf (You should have this file, if you’ve got a my.cnf.default, copy it my.cnf).
- On the Master still, check the “Allow Network Connections” check box in Server Manager and set the root password (for mysql) by pressing the “Set MySQL Root Password…” button. Then press “Save” followed by “Start MySQL“. This will initialize mysql with the default tables and setup the root password. - Now on the Slave change the following in /etc/my.cnf (You should have this file, if you’ve got a my.cnf.default, copy it my.cnf).
- Back on the Master, you need to create a user (I call it repl) that has REPLICATION SLAVE privilege. Use the following two commands (make sure you replace mydomain.com and slavepass….LEAVE repl as the userid:
- Next we need to flush the tables and issue a read lock (yes, just because we can):
- Still on the master we find out the current binary log file name and position:
Note down the filename and the Position number. We will need them later. - Back on the Slave, go to Server Manager and set the root password (for mysql) by pressing the “Set MySQL Root Password…” button. Then press “Save” followed by “Start MySQL“. Connect to the DB as root and issue the following command:
This will setup the slave to talk to the Master and do it’s thing. While we are here, we might as well verify that the repl user can log into the master from the slave:
should prompt you for password and if you type in the ‘slavepass’ you assigned above, you should be able to get in. - Back on the master unlock the tables:
- Last but not least on the slave, turn on the slave mode:
Done…..Now you can go to your production server and suck it’s brains (ahemm…..DB’s) out and import it into your master. Your slave should follow and replicate whatever you import into the master Server. I used the following command (you mileage might/will vary):
Transfer “goodies.sql” text file from your production server to the master server (ssh/scp/ftp….whatever).
Aug
05
2010
Restarting into Mac OS X using the command line, when running Windows…Okay so this only works in Boot Camp 3.0+ which comes with Snow Leopard (10.6). If you ever find yourself in Windows and need to quickly — using command line — change your boot option to reboot into OSX (process known under OSX as blessing) you can use the following command: Aug
05
2010
Forcing 64-bit mode when booting OSX 10.6 (Snow Leopard)…You all probably know about the trick with holding down 6 and 4 keys on your keyboard to force OSX 10.6 to boot using the 64-bit kernel. What you might not know is that it’s temporary and the next time you reboot, you’re back to using the 32 bit kernel. Now I can’t guarantee that your machine will not catch fire and blow up (just kidding)…..but if you know what you’re doing and want to have 64-bit kernel goodness all the time you can do the following: This is a neat new feature in safari 5. If you close one of your tabs by mistake you can “undo” it by pressing Cmd+z (in OSX) or Ctrl-z (in Windows). Neato |