Terminal Tip: Finding information about a mp3 audio file…

datePosted on 13:24, October 19th, 2010 by Many Ayromlou

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:

$ afinfo 08_\ Lily\ Allen\ -\ Fk\ You.mp3 
File:           08_ Lily Allen - Fk You.mp3
File type ID:   MPG3
Data format:     2 ch,  44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame
                no channel layout.
estimated duration: 215.249 sec
audio bytes: 5167920
audio packets: 8240
audio 9490176 valid frames + 576 priming + 1728 remainder = 9492480
bit rate: 192000 bits per second
packet size upper bound: 1052
maximum packet size: 731
audio data file offset: 32353
optimized
----
Share

How to install Office 2010 on Windows XP x64-bit edition

datePosted on 15:17, September 23rd, 2010 by Many Ayromlou

Let me guess…..you tried it and it failed. Well, there is a way (probably not sanctioned by MS) to get this done. I’ve installed it on two separate machines and verified that it works. First you need to download MSXML 6 from Microsofts website. Just go to microsoft.com and search for MSXML. There should be a link to MSXML6.0 download. Download the 64-bit version of the software and install it. Then force a windows update by choosing windows update from the start menu. You will notice a bunch of updates for MSXML. Let it update the files and reboot after that’s done.

Now you need to get the x86 version of office 2010 off the cd and copy it onto your computer somewhere (I just dragged the folder onto my desktop). We need to modify something and you can’t do that on the CD/DVD. Once the copy is done, find setup.exe right click on it and choose properties. Under the Compatibility tab choose “Run this program in compatibility mode for:” and choose Windows XP from the pull down.

Click Apply/Okay and double click setup to run it. That’s it. It works…..Happy days are here again :-).

Share

Quotes and such in WordPress…..

datePosted on 15:30, September 20th, 2010 by Many Ayromlou

As nice as wordpress is, it can sometimes turn your life into a bit of a nightmare. Case in point the title in my previous post. I was trying to tell WP that I want straight double quotes (ie: “) and it kept insisting on beautifying it and turning it into curly double quotes. These curly quotes have a different meaning in Unix, so if you’re using a “cut-and-paste” unix command in your post title you’re kinda out of luck. There is a process called wptexturize that turns simple everyday quotes/doublequotes into what they call smart quotes. Anyways, to work around this you can use the following tables HTML names instead of the actual character when you’re writing your post:

Symbol HTML Name HTML Number Description
" " Double Quote
' Single Quote
‘ ‘ Left Single Quote
’ ’ Right Single Quote
“ “ Left Double Quote
” ” Right Double Quote
Share

Map any network drive to Mac OS X that auto mounts after system reboot

datePosted on 13:34, September 20th, 2010 by Many Ayromlou

Here 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:

  1. From the Finder, hit Command+K or select Connect to Server from the Go menu.
  2. You’ll see the following window, enter the relevant information (ie: the network drive location, be it afp:// or smb:// or http://) and hit Connect button.
  3. Enter your login/password and click “OK
  4. Make sure your Finder Preferences are set so Network Drives are visible on your desktop:
  5. At this point you should have a icon like on your desktop
  6. Now go to System Preferences under the Apple menu
  7. Click on the Accounts icon under System and select Login Items tab (you might have to unlock this panel by clicking the small lock icon on the bottom left of that screen):
  8. Click the “+” sign to add a Login Item to the list and in the following screen go to your Computer icon (on the left under Devices) and select the mounted volume icon from the list on the right and click Add:
  9. You’ll end up with a screen similar to the one below. Click on Show All and exit Preferences. Reboot and make sure it all works.

That’s it…..Enjoy :-)

Share

iPhone Hipstamatic/Lo-Mob samples…..

datePosted on 17:26, September 12th, 2010 by Many Ayromlou


IMG_0363 These were taken a while back, before I moved to the new house. I thought it might be a good visual review of the Hipstamatic and Lo-Mob Apps for the iPhone. Ofcourse there are literally a bazillion combinations of effects between these two apps. The complete set  is on flickr.

IMG_0383 IMG_0444IMG_0364 IMG_0402

Share

Toronto International Air Show 2010

datePosted on 16:52, September 12th, 2010 by Many Ayromlou

_MG_1584 I finally got a chance to go through 3000 frames of TIA2010 this weekend. Here is a sampling of what was buzzing/roaring around Toronto…..The full set is on flickr as usual.

_MG_1411 _MG_9515 _MG_9725 _MG_9665 _MG_9104 _MG_0526 _MG_0354 _MG_9165

Share

Reset iTunes 10 window control buttons

datePosted on 15:57, September 2nd, 2010 by Many Ayromlou

Not 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:

defaults write com.apple.iTunes full-window -1

If you need to reset it back, you can use the commands below:

defaults write com.apple.iTunes full-window -0

Share

Panasonic’s New AG-AF100….DCinema game changer?…maybe.

datePosted on 16:52, August 27th, 2010 by Many Ayromlou

You kinda knew this was going to happen sooner or later. Canon 5D MKII came out a couple of years ago, set the budget DCinema market on it’s head and caught the traditional ENG/Video guys (Sony/Panasonic) totally off-guard. Well I think Panasonic — for now, until Sony comes out with their NEX-VG10 Camera — is sending a couple of grenades into Canon’s camp with the “final” release of their AG-AF100 Memory Card Camera Recorder (MCCR? WTF?). Anyways, this little beastie is neat and can be had for a mere $6000. Not bad for a Pro level camera that can do everything from ENG style shooting to Mid-range DCinema shoots to MFTV movies/series. I think Panasonic might have another hit — like HVX200 — on their hands. Just the sheer fact that using readily available micro 4/3 to m42 mount adapters would give a young cinematographer access to kick-ass glass for cheap (search ebay for m42 lenses and you’ll see) or the fact that they too could start using the newisch Voigtländer 25mm f/0.95 for MicroFourThirds and create their own Barry Lyndon type effects/shots is fantastic news.

Although it all seems rosy for now, there is always the Sony factor as well. They’ve got the bigger, 35mm crop sensor, in their NEX-VG10 (28x22mm for sony vs. 17.1x13mm for pani) which translates into more DOF, smoother bokeh and such….but then again I’d be a happy camper with a f0.95 lens too :-). The AF100 incorporates a 4/3-inch, 16:9 MOS imager. The camcorder records 1080/60i, 50i, 30p, 25p and 24p (native) and 720/60p, 50p, 30p, 25p and 24p (native) in AVCHD’s highest-quality PH mode (maximum 24Mbps). The AF100 maximizes the potential of its high-resolution imager with built-in ND filtering and dramatically reduced video aliasing. Standard professional interfaces include HD-SDI out, HDMI, time code recording, built-in stereo microphone and USB 2.0. The AF100 features two XLR inputs with +48V Phantom Power capability, 48-kHz/16-bit two-channel digital audio recording and supports LPCM/Dolby-AC3. With two SDXC slots, the AF100 can record up to 12 hours on two 64GB SDXC cards in PH mode. Interesting times ahead…..

Share

Evom…Video encoding/transcoding doesn’t get any simpler…

datePosted on 14:48, August 27th, 2010 by Many Ayromlou

If you’re a mac user you’re gonna love this little gem. Grab a copy of Evom and prepare to be amazed at how simple video encoding can become. This little app from the “Little App Factory” is literally the definition of a OSX app….simple and powerful. Just drag a video over the drop zone, choose your output and you’re off to the races. It also has advanced features such as controlling the number of threads (so you don’t melt your spanking new 12 core Mac PRO :-) ). Other notable features are the ability to download your favourite internet videos with just a click and being one the only “simple” apps I’ve see that allows you to extract audio from a video file and save it as a separate mp3 file. All in all a really nice little tool to add to your arsenal. The App is free (and in Beta) right now and hopefully it will stay that way (free) :-).

Share

The Ultimate File Transfer Utility for Windows

datePosted on 12:18, August 27th, 2010 by Many Ayromlou

I’ve been posting mainly about OSX for the last little while, but no worries, I haven’t given up on Windows…yet :-). Someone today was asking about a good WebDAV client and after searching around for a bit, it seems like there is really only a couple out there. But really none of them can beat BitKinex client in terms of features and “price”. Here is a short list of features (oh…and the price thing….it’s free:-) ):

  • Site Navigation Without Freezing Windows
    Unique technology of advanced directory caching and multi connection/threaded directory scanning makes the non-blocking browse windows possible.
  • Robust User Request Handling
    Resume and control in detail not only file transfers but all user requests – including file removals, moves, directory creations, remote edits, prints, etc.
  • Indirect Transfers
    Allows users to transfer files from one server to another regardless of which protocol they are running (FTP->SFTP, WebDAV->FTPS, HTTP->FTP, etc.)
  • Smart Messenger-like User Interface
    Does not occupy much space on your desktop.
  • Properties Inheritance
    For easy and flexible configuration.
  • Large Number of Supported Protocols
    Including FTP, FXP, FTPS, SFTP, HTTP, HTPS and WebDAV

I don’t know how they do it, but I would just grab a copy, if I were you :-).

Share

OSX Server: Could not setup Mach task special port 9

datePosted on 12:57, August 26th, 2010 by Many Ayromlou

com.apple.launchd[1] (0x10f860.cron[43786]): Could not setup Mach task special port 9: (os/kern) no access

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 :-).

Share

Duplicating service settings under OSX Server…

datePosted on 14:17, August 25th, 2010 by Many Ayromlou

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.

  • To Export the settings (in this case the DHCP service):
  • sudo serveradmin settings dhcp > dhcp-config.txt
  • To Import the settings on the other server:
  • sudo serveradmin settings < dhcp-config.txt
Share

MySQL Replication howto for Snow Leopard…

datePosted on 16:58, August 23rd, 2010 by Many Ayromlou

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 :-). There are other ways of doing this procedure, for more info check out this page.

- 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):

sudo launchctl unload /System/Library/LaunchDaemons/org.mysql.mysqld.plist

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).

[mysqld]
log-bin=mysql-bin
server-id=1
innodb_flush_log_at_trx_commit=1
sync_binlog=1

- 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).

[mysqld]
log-bin=mysql-bin
server-id=2

- 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:

mysql> CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%.mydomain.com';

- Next we need to flush the tables and issue a read lock (yes, just because we can):

mysql> FLUSH TABLES WITH READ LOCK;

- Still on the master we find out the current binary log file name and position:

mysql> show master status;
 +------------------+----------+--------------+------------------+
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
 +------------------+----------+--------------+------------------+
 | mysql-bin.000004 |      340 |              |                  |
 +------------------+----------+--------------+------------------+
 1 row in set (0.00 sec)

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:

CHANGE MASTER TO MASTER_HOST='master.mydomain.com', MASTER_USER='repl', MASTER_PASSWORD='slavepass', MASTER_LOG_FILE='mysql-bin.000004', MASTER_LOG_POS=340;

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:

mysql -h maste.mydomain.com -u repl -p

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:

mysql> UNLOCK TABLES;

- Last but not least on the slave, turn on the slave mode:

mysql> START SLAVE;

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):

mysqldump -x -c --add-drop-table --add-drop-database -u root -p --databases dbname1 dbname2 dbname3 >goodies.sql

Transfer “goodies.sql” text file from your production server to the master server (ssh/scp/ftp….whatever).

mysql -u root -p < goodies.sql

Share

MySQL: Transfering users and priviledges to a new server….

datePosted on 15:32, August 19th, 2010 by Many Ayromlou

So this was a great big mystery this morning. How the heck do you transfer the users and their privileges out of a old mysql server and “import” them into a new server. We recently upgraded from OSX 10.4.11 to a couple of spanking new Snow Leopard servers and during the mysql export/import cycle this issue came up. Well the simple answer is…..DON’T USE mysqldump on your mysql DB (you know the default DB that stores all your users and privileges. It’s a bad idea and will probably do more harm than good. Instead use the following procedure:

1) On your old server (the one that has your data/users/tables on it) issue the following command (replace YOUR dbadmin/root username and  password in the 2 appropriate places:

mysql -B -N --user=admin --password=yourpassword -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''', user, '''@''', host, ''';') AS query FROM mysql.user" |mysql --user=admin --password=yourpassword | sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'

The output of this command is something like this:

## Grants for admin@127.0.0.1 ##
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' WITH GRANT OPTION;
## Grants for fabrik@localhost ##
GRANT USAGE ON *.* TO 'fabrik'@'localhost' IDENTIFIED BY PASSWORD 'HASHEDPASSWORD';
GRANT ALL PRIVILEGES ON `fabrikdb`.* TO 'fabrik'@'localhost' WITH GRANT OPTION;
## Grants for nerdlogger@localhost ##
GRANT USAGE ON *.* TO 'nerdlogger'@'localhost' IDENTIFIED BY PASSWORD 'HASHEDPASSWORD';
GRANT ALL PRIVILEGES ON `nerdlogger`.* TO 'nerdlogger'@'localhost' WITH GRANT OPTION;
## Grants for research@localhost ##
GRANT USAGE ON *.* TO 'research'@'localhost' IDENTIFIED BY PASSWORD 'HASHEDPASSWORD';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `research`.* TO 'research'@'localhost';
## Grants for admin@localhost ##
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY PASSWORD 'HASHEDPASSWORD' WITH GRANT OPTION;
## Grants for root@server.domain ##
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'server.domain' WITH GRANT OPTION;

2) Now you’re ready to selectively cut and paste the appropriate users and associated grant into a new mysql session (which you have to open) on the new server.

Goodluck….

Share

Nerdlogger has moved….

datePosted on 10:42, August 18th, 2010 by Many Ayromlou

Not that you should really care too much about this, but I’ve moved nerdlogger.com to wordpress platform (from blogger). This will hopefully give me more flexibility in order to provide more services.

Share

WordPress import plugin for blogger fix….

datePosted on 10:21, August 16th, 2010 by Many Ayromlou

Version 0.2 of the blogger plugin for wordpress 3.x has a small little bug in it that produces the following error:

Something went wrong. If the problem persists, send this info to support:

HTTP/1.0 403 Invalid AuthSub token.
Content-Type: text/html; charset=UTF-8
Content-Length: 167
Date: Fri, 06 Aug 2010 20:16:35 GMT
Expires: Fri, 06 Aug 2010 20:16:35 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block

Server: GSE

<HTML>
<HEAD>
<TITLE>Invalid AuthSub token.</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” TEXT=”#000000″>
<H1>Invalid AuthSub token.</H1>

<H2>Error 403</H2>
</BODY>
</HTML>

I’ve been banging my head against the wall trying to figure out what’s wrong with their code and I think I’ve found a fix (atleast until version 0.3 of the plugin comes out at which time this fix will not apply anymore…..hopefully).

The problem is with the regex code in the auth() function of the blogger-importer.php plugin. So edit this file and make the following changes:

1) Line 99:OLD: $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] );
NEW: $token = preg_replace( '/[^%-_0-9a-zA-Z]/', '', $_GET['token'] );
Note: % sign added in the regex portion.

2) Line 108:OLD: preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches );
NEW: preg_match( '/token=([%-_0-9a-z]+)/i', $response, $matches );
Note: % sign added in the regex portion.

Hopefully this will help you get going…..

Share

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:
c:\progra~1\Bootca~1\bootcamp.exe -StartupDisk "Mac OS" Shutdown /r /t 0
This will reboot your windows session and boot the machine back using the Volume named “Mac OS”. If you omitt -StartupDisk option, then the system will boot into the first Mac OS X volume located by BootCamp.exe. Done :-)

Share

Forcing 64-bit mode when booting OSX 10.6 (Snow Leopard)…

datePosted on 11:36, August 5th, 2010 by Many Ayromlou

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:
sudo vi /Library/Preferences/SystemConfiguration/com.apple.Boot.plistModify the file to make it look like this:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel</key>
<string>mach_kernel</string>
<key>Kernel Flags</key>
<string>arch=x86_64</string>
</dict>
</plist>
basically add “arch=x86_64″ (without the quotes) to the line that reads<string></string>
That’s it….reboot and enjoy Full 64-bitness….to undo this (if something breaks), edit the file and make it look like this:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel</key>
<string>mach_kernel</string>
<key>Kernel Flags</key>
<string></string>
</dict>
</plist>
Save and reboot and you’re back to stock Snow Leopard. The way you check for this — running 32 or 64-bit kernel and extensions — is to run System Profiler (Apple Menu/About This Mac/More Info…) and check the software tab. If you’re in 64-bit mode you’ll find “yes” as the value of “64-bit Kernel and Extensions” entry.

Share

Where is php.ini under OSX 10.5 (Leopard)…

datePosted on 11:24, August 5th, 2010 by Many Ayromlou

I came across a issue and the solution required a bit of tweaking in php.ini. After looking around my Leopard Server I finally found php.ini.default under /etc directory. After making the changes and restarting apache, I got nothing, zip, zilch. Well after digging around the output of phpinfo
<?php
phpinfo ();
?>

I found that /etc is the expected location of php.ini. So after copying php.ini.default to php.ini and restarting apache everything started working nicely. Lesson learned….By default the php module uses baked-in values, if you need to change something (eg: maximum upload file size) you need to copy php.ini.default to php.ini (in /etc directory). Make the changes to php.ini and restart apache.

Share
12345... 303132PreviousNext