Archive for the ‘Apple & Mac’ Category

How-To Redirect PATHINFO (Almost Pretty) Permalinks To Pretty Permalinks

Wednesday, March 21st, 2012

This post is about supporting your former PATHINFO Permalinks structure (a.k.a. Almost-Pretty-Permalinks), on your new web-site using Pretty-Permalinks.

 Redirect 301 /index.php/ http://www.yoursite.com/
 RewriteRule . /index.php [L]

These are the lines of Apache’s configuration that must be present in the website’s main .htaccess file:

 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 Redirect 301 /index.php/ http://www.yoursite.com/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>

This case applies to those websites formerly configured to use PATHINFO Permalinks and for which all the old posts and pages have been indexed by the Web Search Engines (Google, Yahoo, Bing, etc) using the former structure that included the HORRIBLE! “/index.php” string in their URIs, i.e.:

https://www.marcomc.com/index.php/tech/

When these sites finally migrate to the Pretty-Permaling structure, the one that does NOT include the  horrifying “/index.php” piece, i.e.:

https://www.marcomc.com/tech/

it happens that all the search engines’ indexes will result suddently outdated, and that will penalise the sites at least in two ways:

  1. It will cause a loss of accesses because the back-links to the sites that are present on other blogs or in people’s favourites and bookmarks, or in the search engines’ indexes will be ‘broken’ (old) and the people will be unable to access the pages or posts unless browsing from the homepage.
  2. It will cause a loss of ranking in the search engines’ databases (S.E.O. perspective) because the sites will result ‘broken (unaccessible) and in some cases may even result like sites with duplicated content because the search engines’ spiders will index the pages as NEW pages (due to their new URIs) and the content will match the caches indexed with the old URIs (at least until the caches expire).

To prevent such mayhem you need to put in place a 301 (permanent) redirection that will tell the search engines that all the requests to URIs containing the ‘/index.php’ bit have to redirected to similar URIs not containing it, i.e.:

Redirect 301 /index.php/ https://www.marcomc.com/

This string gives instructions to the web server about what to communicate to the Search Engines when a PATHINFO request is received.

Most importantly the 301 redirection will instruct the search engines that the URIs containing “/index.php” have to be considered deprecated and that from now on, the site will not use it anymore. This is fundamental to avoid the search engines to consider the content of the site as a duplicated content.

Secondly you will need to put in place also a generic rewrite instruction that will tell the local web server (Apache) to accept all the incoming requests to URIs with a PATHINFO format and return the content of the new and purged URIs:

RewriteRule . /index.php [L]

This string gives instructions to the web server on what it must to do when a PATHINFO request is received.

I did use these redirection settings for my WordPress blog when I did migrate to a full L.A.M.P. server (GNU/Linux, Apache, MySQL, PHP) from the former Windows Server hosting service running Microsoft IIS and that did not support ‘.htaccess’ files but exclusively PATHINFO directives and for which I did not have access to the server’s core configurations, therefore I was forced to use “/index.php” in my permalinks.

If you did like this post leave a comment in sign of appreciation, ad if you are Facebook please consider to ‘Like’ MarcoMC.com page. Check the FB banner on the right widgets column of this page …     ========================================>>

I did take inspiration for this post at following this thread:

http://www.wptavern.com/forum/troubleshooting/489-mod_rewrite-make-pretty-permalinks-prettier.html

How-To Send A Command In Background And Keep It Running using ‘nohup’

Tuesday, March 20th, 2012

The shell command ‘nohup‘ in combination with ‘&‘ will allow to send the a command-line instruction in background enabling the process to keep running after the user who issues the command has logged out.

A common use of ‘nohup’ is when you need to issue a remote command via ssh connection and then you need to close the connection but be sure that the issued command will keep running in background, i.e.:

~$ sudo nohup shutdown -r -h 1203192100

I use this ‘trick’ when I want to restart my Mac and GNU/Linux Servers during evening/night hours but I want to submit the command during my office time.
In such way I save myself the time to remotely connect from home.

The ‘nohup’ command is even used to run processes in background as daemons.

nohup is a POSIX command to ignore the HUP (hangup) signal
(cit. from Wikipedia)


HOW-TO Disable the Character Accent Menu and Enable Key Repeat in Mac OS X Lion

Friday, March 2nd, 2012

Disable Character Accent Menu
To disable the press and hold accented character picker you need to digit the following commad in a Terminal window:

$ defaults write -g ApplePressAndHoldEnabled -bool false

After that you will have to Log Out and then Log In again. Or just restart the Mac.

If you want to re-enable the functionality, you need to digit

$ defaults write -g ApplePressAndHoldEnabled -bool true

the Log Out and Log In again.

How-To Fix “Some of your photos were not copied to the iPad, iPhone, iPod because they cannot be displayed on your iPad, iPhone, iPod”

Thursday, November 24th, 2011

It happens, fortunately not so frequently, that during the Photo synchronisation of my iDevices via iTunes I get an error about the copy of my pictures to my iPad or iPhone:

"Some of your photos, including the photo "IMX_xxxx",
were not copied to the ixxx because they cannot be displayed on your ixxx."

I notice that this problem comes out usually after an update or upgrade of Aperture, and having a look around the web it is not a problem isolated to Aperture but it also shows up when you use iPhoto and in rare cases also when you sync your pictures directly from the Pictures folder of your account.

The only solution that worked for me in the time and in different Macs has been to force a complete regeneration of the iPod Photo Cache (se References at the bottom).
According to what software, if any, you use to manage your pictures, you will need to remove the following folders:

  • If you synchronise from the Pictures folder:
    /Users/<username>/Pictures/iPod Photo Cache
  • If you synchronise from the Aperture Library:
    • From the Finder navigate to the Picture folder.
    • Select the Aperture Library archive.
    • Right Click on it and choose Show Package Contents.
    • delete the iPod Photo Cache folder
  • If you synchronise from the iPhoto Library:
    • From the Finder navigate to the Picture folder.
    • Select the iPhoto Library archive.
    • Right Click on it and choose Show Package Contents.
    • delete the iPod Photo Cache folder

This operation will force iTunes to analyse the entire pictures archive and to generate all new copies of the pictures suitable for your iDevice.

In a few occasions I also found useful to proceed the  Rebuild Aperture Database procedure that will force Aperture to reanalyse all the masters of you photo library and regenerate all the preview and thumbnails.

To rebuild the aperture database you need to start Aperture holding the key combination of “Alt+Command” and then confirm the operation, that could take a very long time depending on the dimension of your pictures library.

Hope that this will help you.

 

References:

iTunes: Understanding the iPod Photo Cache folder

MacRumors 

 

 

The Crazy Ones read by Steve Jobs

Tuesday, October 25th, 2011
Listen to me!
Audio MP3

download mp3
Here’s to the crazy ones.

The misfits. The rebels.The troublemakers. The round pegs in the square holes.
The ones who see things differently.
They’re not fond of rules. And they have no respect for the status quo.
You can quote them, disagree with them, glorify or vilify them.
About the only thing you can’t do is ignore them.
Because they change things.
They push the human race forward.
While some may see them as the crazy ones, we see genius.
Because the people who are crazy enough to think they can change the world, are the ones who do.

Apple Inc. (Steve Jobs)

Think Different

Think Different

Steve Jobs dies on 5th October 2011

Thursday, October 6th, 2011

“The world has lost an amazing human being”
Steve Jobs A Visionary Man

Steve Jobs has died on 5th October 2011

From Apple’s official website

Apple has lost a visionary and creative genius, and the world has lost an amazing human being. Those of us who have been fortunate enough to know and work with Steve have lost a dear friend and an inspiring mentor. Steve leaves behind a company that only he could have built, and his spirit will forever be the foundation of Apple.

If you would like to share you thoughts, memories, and condolences, please email [email protected].

http://www.apple.com/

Steve Jobs A Visionary Man

Steve Jobs has died on 5th October 2011

How the UNIX system Load Avarage is calculated on Mac OS X and Linux

Wednesday, August 24th, 2011

The Load Avarage values that are shown using the ‘top’ commad or the ‘uptime’ command represent the number of blocking processes in the run queue averaged over a certain time period.

An example fo HIGH Load Avarage:

 load average: 12.54, 12.71, 12.19

these values represent CPU, Disk I/O and Network I/O.

if you run the ‘top’ utility you can seek for the CPU usage and for the CPU I/O waiting time that are represented by the ‘us‘ and ‘wa‘ abbriaviations.

If these uage is permanently around 100% then chances are the problem is related to your CPU.

If the I/O waiting time is mostly above the 80% it means that there could be some problem with the I/O devices suche network cards or failing hard drives.

In my spefic case I notices that in ReadyNAS with 6 disks in RAIDX-2 the load avarage is constatly over 10.00,10.00,10.00. I believe this is normal considering that the ‘md’ process has to keep the RAID chain continuosly checksummed and alligned.

This information has been sources from Andy Millar’s really nice blog I have found digging around: http://www.andymillar.co.uk/blog/2006/12/24/linux-load-average-explained/

 

How-To legally unlock the iPhone 4 permanently

Wednesday, July 20th, 2011
Listen to me!
Audio MP3

download mp3
I recently found a company called FoneFunShop that unlock many models of mobile phones and 3G dongles. Among these it also unlocks iPhone 4 from all the countries for £50.00 and iPhone4S for £130.00.

This is the link to their unlock page: www.fonefunshop.co.uk/unlock/

My iPhone 4 was operator locked with Vodafone UK, and that was representing a problem as I am planning to go for a month travel to Australia this coming winter and I want to travel minimal without taking with me many stuff and I want to enjoy the use of a smartphone during the travel without the need to buy a new one or without having to pay Vodafone’s  excessive roaming costs.

I started looking for a way to unlock my iPhone 4 that would not be software related because the modem baseband of my iPhone 4 is 02.10.04 and the iPhone Dev-Team (or any other iPhone hacker) has not yet released an unlock for such version.

I searched for chips to pose behind the SIM card to trick the phone’s firmware but I already had experience with some of them and they are not very reliable.

I had a look at a couple of websites claiming to be able to permanently unlock any iPhone including the iPhone 4 (for a quite high amount of money).
I was  worried about those sites being scam or not.
At the end I took my chances with FoneFunShop.com and I paid £50.00.

For 7 days I’ve been worrying that money were gone ‘trash’; finally today I received the notification of the successful unlock: I can confirm that the instruction they give for the unlock are simple and accurate and that in exactly 7 days they are able to add the IMEI of your phone and the ‘white list’ of unlocked phones so that Apple will recognize it via iTunes.

They actually talk about an unlock code, but for the iPhone there will not be a code, it simply will be recognized by iTunes as unlocked just after you receive the unlock confirmation message from the sales department of FonFunShop.

Here is the message that I received, I followed the few instruction and the trick was done. I’ve been immediately able use my O2 micro-Sim  on my Vodafone’s iPhone 4.

Hi Marco ,

Your unlocking request has now been completed and the unlocking code(s) can be found below:
Make:
Apple
Model:
IPhone 4 16gb
Country:
United Kingdom
Network:
Vodafone
IMEI:
012419*********
Code(s):
Unlocked
IMPORTANT:
Please read ALL of the instructions below as there maybe some important information relating to your phone or scenario. 

PLEASE NOTE:
When entering a code, please take your time.
If you enter a code and you receive an error message, DO NOT try again, please contact us via the links below?
But please check first to make sure the phone isn't actually unlocked.
Some models of phone will have a limit on the number of times you can enter a code. After this we may not be able to help you.

Instructions:

How to Complete the unlocking process for Apple iPhone Models
Generic Apple iPhone Method
When ready, you will be notified by email that the process has completed. When you receive this email, to complete the unlock please do the following: 

1. Install the latest version of iTunes
2. Make sure iPhone is using the latest version, updated by the official itunes software
3. Insert a non accepted SIM card and Connect the iPhone to iTunes (IE not from the original network provider)
4. Wait until itunes detects the phone
5. After about 10-20 seconds, disconnect phone and reconnect.
6. Finally itunes will show the message 'Congratulations Your iPhone is Unlocked'

PLEASE NOTE: This is the only permanent unlocking solution for Apple iPhone. Your iPhone will always be unlocked even after updating your iPhone firmware.

This doesn’t want to be an advertisement but a sincere advice to everybody that is desperate to have an iPhone 4 unlocked and cannot obtain it from their operator because the terms of their contract are not yet expired.

If I had found this information months ago I would have saved same money with a cheaper operator than Vodafone (but this is another story…).

By The Way, please mind that I will not be responsible of any incident that those guy may cause to your phone or to your money if you try to unlock your phone with them.

I can just say that for me it worked like a charm, exactly as described on the their website.

Any feedback will be appreciated! Happy Unlock!

 

 

 

 

How-To Install or Update Mac OS X Snow Leopard 10.6.7 on the Asus Eee PC 1005HA Netbook

Wednesday, March 23rd, 2011

Few days ago Apple released the latest update for Mac OS X Snow Leopard 10.6.7 .
Here is the tutorial on how to install or update Mac OS X Snow Leopard 10.6.7 on the Asus Eee PC 1005HA Netbook.

Prerequisites

Yes, you have no alluciantions: the legacy kernel we gonna use is the same prepared for Mac OS X 10.6.6, I tried and it works fine with 10.6.7 on the Asus EeePC 1005HA. I don’t know if it works on other hackintosh systems and netbooks. Please comment about your experience.

Step 1

Follow the instruction of my previous post:

How-To install Mac OS X Snow Leopard 10.6.6 on the Asus Eee PC 1005HA Netbook

following that how-to you can skip the part that let you update from Mac OS X 10.6.0 to Mac OS X 10.6.6 an substituite it with the following content of Step 2.

Step 2 (Upgrade to Mac OS X Snow Leopard 10.6.7)

  1. Copy MacOSXUpdCombo10.6.7.dmg in the USB stick.
  2. Uncompress legacy_kernel-Mac_OS_X_10.6.6.tgz and to legacy_kernel-Mac_OS_X_10.6.6.pkg and copy it on the USB stick.
  3. Insert the USB Stick on the Netbook then mount and run the MacOSXUpdCombo10.6.6.dmg.
  4. When the installation is finished it will ask to restart:
    DO NOT RESTART THE SYSTEM YET!!
  5. Install ‘legacy_kernel-Mac_OS_X_10.6.6.pkg’.
    This install an older version of the kernel that is still compatible with the unficcial extensions we previously installed before the upgrade.
  6. Again, substitute the Extensions for the misbehaving devices:
    1. Copy ‘SleepEnabler.kext’ to ‘/Extra/Extensions/’.
      This fix the hibernation/sleep feature.
    2. Copy again ‘~/Desktop/SnowLeopardAsus/Extra/IO80211Family.kext’ to ‘/Extra/Extensions/’ folder.
      This makes the system to recognize and install the Wi-Fi card.
    3. Copy again ‘~/Desktop/SnowLeopardAsus/Kext/AppleIntelGMA950.kext’ to ‘/System/Library/Extensions/’.
    1. Copy again ‘~/Desktop/SnowLeopardAsus/Kext/AppleIntelIntegratedFramebuffer.kext’ to ‘/System/Library/Extensions/’.
      This fixes the video card and add the option to choose 1024×600 resolution.
  7. Now, most important, fire the command ‘fixkext’ with root privileges or using sudo:
    $ sudo fixkext
  8. VERY IMPORTANT: Run Disk Utility and Repair Disk Permisions
    Without this operation your system will reveal really unstable!!!
  9. Now you can reboot the system

Now go back to:

How-To install Mac OS X Snow Leopard 10.6.6 on the Asus Eee PC 1005HA Netbook

and read the last two sections: What still doesn’t work and Last Adjustments

Mac OS X Server 10.6 Open Directory Replica: “Kerberos is: Stopped”

Friday, March 18th, 2011

It is common that the configuration process of a Mac OS X Snow Leopard Server 10.6 as an Open Directory Replica for your Open Directory Master comes with some problematic issues: it’s very common that the Kerberos service is not initialized properly and will appear in the ‘Server Admin’ Open Directory’s Overview panel as ‘Kerberos is: Stopped‘.

Googoling about this problem I found that is a fault in the DNS name resolution the most common reason that breaks the configuration of the kerberos service preventing the Open Directory Replica server to be recognized and associated with the proper FQDN (Fully Qualified Domain Name).

The fix to this problem is not complicated but will force us to carefully perform these operations:

  1. First things first, although this is a recommended option for local domain naming, make sure that your domain name  is NOT ending in ‘.local.
    In Mac OS X by default the ‘.local’ domains are resolved by the Bonjour service, with priority over the DNS service.
    I recommend to choose a non public domain name like ‘.private’, ‘.lcl’, ‘.my’, ‘.office’…. and so on.
  2. After that, make sure your DNS is PERFECTLY configured to serve FQDN names (i.e. replica.mynetwork.private.) and that one of this name is fully matching to the replica’s hostname(with the exception of the tail ‘.’ ).
  3. Also check the DHCP service, if activated, to be delivering the correct search domain and the IP address of the DNS server able to resolve the name of your Open Directory Master and Replica servers.
  4. Adjust the Replica server’s hostname accordingly to the DNS settings.You can modify the hostname of your replica server with the ‘scutil’ command:
    # scutil --set HostName replica.mynetwork.private
  5. Now decommission the replica server to a standalone directory using the Open Directory Assistant to change the server’s role.

Now the most important operations are done.
Now I recommend a reboot of the system and a double-check of the DNS and hostname configuration using the following commands:

# hostname

The ‘hostname’ command will show the hostname that should appear like the FQDN configured in the DNS service.

# changeip --checkhostname

The ‘changeip’ command will perform a more accurate check on the hostname, using the system calls used by the other system processes and application.

# nslookup replica.mynetwork.private

The ‘nslookup’ command will check that the DNS server is returning the appropriate IP for the requested domain name.

Now it’s time to re-configure the server as a Open Directory Replica, you can use again the Open Directory Assistant. Provide the requested information and when the process is terminated, if you’re lucky enough, the problem will be fixed and the ‘Server Admin’ will show ‘Kerberos is: running.

Unfortunately I’ve not been so lucky when I encountered this problem my first time: for my replica server the Kerberos service was still in ‘Stopped’ status.

After a couple of headaches and a lot of wasted time I figured out that one of the main Kerberos’ configuration files ‘/Library/Preferences/edu.mit.Kerberos’ was missing. This was proof that for some reason the ‘kdcsetup’ process hasn’t been executed.

To fix this issue it is necessary to perform the manual procedure to configure and initialize the kerberos process that actually is the last portion of the manual procedure to join a Replica to an existing Open Directory domain, consisting of:

# /usr/sbin/kdcsetup -c /LDAPv3/127.0.0.1 -a diradmin -p -v 1

This command will create the file /Library/Preferences/edu.mit.Kerberos.

# /usr/sbin/kdb5_util -r

The ‘kdb5_util’ will load information from the initial.dump file from the previous step into the REALM.

# kdcsetup -e

The ‘kdcsetup’ command will enable kdcmond and kadmind in the configuration for launchd.

Now the Kerberos services should have been started on the replica server.

Reboot the system to make sure it’s started automatically at the system initialization.