Archive for 2010

Improve iPhone 3g performance by Enabling Swapping (updated)

No Comments »

update: After 24hours, I’m pretty sure it helped quite a bit. My phone did not slow down to a crawl today nor did iOS start killing my fast app switching backgrounded apps. Will it last? Will it blend? Of course not, it’s VIRTUAL memory!

With the latest iOS 4 supporting multitasking or with any other version of iOS that has been set free from its jail, I’ve noticed that my old, slow iPhone 3g has been having memory issues.

With iOS 3 and multitasking applications such as backgrounder, I could at least manage what app I wanted to leave open in the background. Sure, it took more CPU but at least I could manage it.

With iOS 4 (multitasking enabled using the latest pwnagetools) – many apps will keep using RAM in the background if they support Fast App Switching. As more and more apps get recompiled with iOS 4 and fast app switching enabled, I noticed I needed to reboot my iPhone from time to time or manually close these apps. And as we know, task managers, blowing it, etc…

Here is how I enabled swapping on my iPhone – sorry for not quoting any definite source, the knowledge I found was spread out through many forums and no clear source could be found. In any case, I’m certainly not the one who thought about this.

iOS is a stripped down version of OS X, which supports swapping, obviously. However, the flash in your iPhone is not made to handle thousands of writes and this is why Apple doesn’t do swapping on it. Be warned, this will probably end up killing it. How fast? Hard to say. Considering my 3g is 2 years old and I’m eligible for an upgrade soon, I just don’t really care. Please inspect the file before you upload it and understand what it means – I’m not responsible for you nuking your phone. Back it up in iTunes first, too, just in case you have to restore using DFU Mode.

  1. Jailbreak your iPhone ( I recommend pwnagetools )
  2. Install OpenSSH From cydia
  3. Connect to your iPhone using an SCP client (Cyberduck, WinSCP, Filezilla..)
  4. Download this file and rename it from .txt to .plist com.apple.dynamic_pager
  5. Upload this file to /System/Library/LaunchDaemons
  6. Reboot

You will now notice that even after opening a few apps, available memory reported by SBSettings will remain close to 30-35Mb.

On top of that, if you browse to /var/vm , you will see that it created a swap file.


Predictions for iPhone OS 4

1 Comment »

Before the news strike tomorrow..

Here’s an iPhone 4.0 wish list. In bold are the items I think we may see tomorrow..

Multitasking

Multi-user (or at least a guest mode) for at least the iPad

A filesystem to store files and share them between apps, at least for the iPad

Better push notifications

Ability to set a schedule for ringtones (don’t ring at 3am for Viagra spam please)

File synching for iPhone


How to package Firefox extensions for Global installs

No Comments »
Firefox extensions are distributed in XPI packages (pronounced zippy).
XPI packages are in reality just a ZIP file with a standard file and folder structure in it.
Two types of add-on installations can be performed : Per-user, and per-workstation (Global). Typically, extensions are installed per-user, especially if the user is not a local administrator on his workstation.
However, there may be cases where a global installation is preferred: a standard extension would need to be installed multiple times for every user of a shared workstation. It would also be harder to push extensions out to users instead of machines.
Here is how to create install a firefox extension globally in a way that can easily be packaged  with anything that allows running batch files. The same information can easily be used to create clean MSI packages as well, using WiX or anything else, just put the files in the right location and set the proper registry keys. It would probably be more reliable to do it with an MSI than batch files.
1) Obtain the XPI package

2) Unzip the XPI package

3) Open the install.rdf file in the package.

We need to identify the “ID” of the package. Look for something similar to this:
<em:id>Blah blah</em:id>
The ID contained in the EM:ID anchors may be a name or a GUID. Note it down.
4) Create a registry import file
Create a .reg file.
This will be used to tell Firefox where to look for the new globally installed extension. This can be anywhere you want as long as the user that will open firefox has read access to it.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\Extensions]
“em-id-of-extension”=”C:\\Program Files\\Mozilla Firefox\\PathToExtension”
5) Create a registry import file for uninstallation
This file needs to be identicaly to the above, but with a minus instead of the path to the extension. This simply deletes the string we created before.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\Extensions]
“em-id-of-extension”=-
6) Create a batch file for installation

This batch file simply needs to copy the files to the location you specified in your .reg file, and then run regedit /s regfile.reg to import the registry changes.
7) Create a batch file for uninstallation
This batch file simply deletes the directory containing your extension and runs regedit /s on the uninstallation regfile.

iPhone OS 4 ? Multi user for iPad please!

2 Comments »

I don’t expect families to get 3-4 iPads.. so why not make the thing multi-user ?

Applications would have their separate data, and a simple user switching locking screen would do the job..

Then again, Apple probably prefers not to do that as it would be “complex”. And people will buy multiple iPads.

End of useless post


How to apply a temporary GPO to a machine being imaged

No Comments »

Depending on how you use Active Directory in your organization, you may be setting a lot of security policies on workstations, and some of these settings can be problematic during the automated build of computers.

A few workarounds exist to avoid applying those to the workstations being imaged:

* Create a temporary OU for the computer account, and move it to the proper location once the build is done
* Change the order of the steps in your build to avoid issues caused by security settings
* Configure a GPO to override the settings that need to be set only during deployment, and filter that only to machines being used.

For multiple different reasons, I had to use the last option. It is a rather clean option, as it doesn’t involve moving computer accounts after the build or any chances on the domain during the imaging process, other than joining the machine, which is great.

One word of notice: Make sure whatever you are overriding is not a must for security and is simply an “annoyance”, because eventually (within a few minutes probably), a user WILL figure out how you’re doing the filtering and WILL apply it to his own machine, in order to bypass some security settings.

Only a few steps are involved :

1) Create a GPO that will set the values to what they need to be during the build (don’t link it yet)

2) Create a WMI filter called “BoxBeingBuilt” or something similar. Have it do a query on something you know is true only during imaging. If you can’t find anything reliable, do something like this:

Select * from Win32_Environment Where Name = “BuildinDaBox”

3) Ensure your built process sets a system variable with that name at the beginning, and removes it at the end.

Tada!