Brendan’s blog » The USE Method: Mac OS X Performance Checklist

“Mac OS X Performance Checklist” is one of the best blog posts I have read in a long time.

The posts describes how find bottlenecks if something is not working as it should be. Awesome read!

via Brendan’s blog » The USE Method: Mac OS X Performance Checklist.

Posted in computer | Tagged , , , , , | Leave a comment

Fixing TruePreview for Apple Mail 6.6

If you started mail before these two commands make sure to copy the plugin from the Bundle (Disbaled) folder back to the Bundle folder.

defaults write ~/Library/Mail/Bundles/TruePreview.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add DAFFB2B4-77BC-4C25-8CE1-2405E652D54B
defaults write ~/Library/Mail/Bundles/TruePreview.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add 2B98D2DD-000B-4521-83EB-7BFCB9B161C8
Posted in computer | Tagged , , , | 7 Comments

Send broadcast messages to android

Faking a received SMS:

adb shell am broadcast -a android.provider.Telephony.SMS_RECEIVED
Posted in computer | Tagged , , , | Leave a comment

common.h

So I got sick with NSLog and wrote myself a simple wrapper which you can find here.

The Syntax is the same but the printout is why nicer to read, it looks like this:

2013-09-02 17:00:49.543 AppName[4841:a0b] (FilterAppDelegate.m:15 -[FilterAppDelegate application:didFinishLaunchingWithOptions:]) TEST LOG

So you can see the filename, line number, function and everything else important directly.

Posted in computer | Tagged , , | Leave a comment

Automatically increment build number (CFBundleVersion)

David wrote this nice little helper that automatically increments the build version every time.

#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(echo $buildNumber | sed 's/0*//')
buildNumber=$(($buildNumber + 1))
buildNumber=$(printf "%04d" $buildNumber)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"

In Xcode just head over to “Build Phases” of your target and “Editor” -> “Add Build Phase” -> “Add Run Script Build Phase” there you can just simply use this little script and every time you build your app the build version gets incremented. So at least I can see how many times I build a certain project.

Posted in computer | Tagged , , , , , , , | Leave a comment

Android

I just had enough, I need a valve to get it out so here it comes:

Android 4.3 during setup:

"To improve [..] scan for nearby Wi-Fi networks, even when Wi-Fi is off"

The documentation to “dab log cat” is just wrong, it says:

Loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default.

That’s definitely wrong, I diffed a $ adb logcat and a $ adb logcat -b main and they are different. Further only main, system, radio are mentioned, but there are -b system and -b sf available as well.

Android 4.3 was installed at 5:22pm and the first crash was at 5:46pm (less than half an hour).

adb logcat -f <file>

Is not working, it just throws an error… further is doesn’t even set an exit code.

Just the bugs I found today. And since we are talking about today’s bugs there is one in eclipse is well. If you import a project and select “add project to working sets” guess what… it doesn’t work. It just adds it to “Other Projects”. *sigh*

Posted in computer | Tagged , , , , , , | Leave a comment

cURL and error codes

So brew threw this to me this morning:

curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 54

This error code clearly states

#define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54

Which is actually not interesting but error code #50 is though:

/* The application is not happy */
#define X509_V_ERR_APPLICATION_VERIFICATION 50

Source

Posted in computer | Tagged , , , , , , , , | Leave a comment

ActivityManager | isUserAMonkey()

public static boolean isUserAMonkey
Added in API level 8

Returns "true" if the user interface is currently being messed with by a monkey.

Update: There are more:

public void fyiWillBeAdvancedByHostKThx ()
Added in API level 11
Called by an AppWidgetHost to indicate that it will be automatically advancing the views of this AdapterViewFlipper by calling advance() at some point in the future. This allows AdapterViewFlipper to prepare by no longer Advancing its children.
public boolean isUserAGoat ()
Added in API level 17

Used to determine whether the user making this call is subject to teleportations.

Returns whether the user making this call is a goat

via ActivityManager | Android Developers and and

Posted in computer | Tagged , , , | Leave a comment

Improving the security of your SSH private key files — Martin Kleppmann’s blog

Read this great article:

Improving the security of your SSH private key files — Martin Kleppmann’s blog.

For my own convenience I just put all the important commands together but won’t explain anything. Again: Go and read the article.

Reading “normal” ASN.1 key (RSA and DSA without passphrase):


$ openssl asn1parse -in test_rsa_key

Reading passphrase protected rsa key:


$ openssl rsa -text -in test_rsa_key

Update key from MD5 hasing to PKCS:


$ mv key key.old
$ openssl pkcs8 -topk8 -v2 des3 -in key.old -out key
$ chmod 600 key # IMPORTANT !

The key is now back to ASN.1 structure so you can read it with:


$ openssl asn1parse -in test_rsa_key

Test the new key. If it works just remove the old one. If it doesn’t you still have you old key.

Done.

 

Posted in computer | Tagged , , , , | Leave a comment

Fixing TruePreview for Apple Mail 6.5

If you started Mail and it tells you that your plugin got disabled you have to move the plugin first from the disblaed folder back to the “normal” folder:

mv ~/Library/Mail/Bundles\ \(Disabled\)/TruePreview.mailbundle ~/Library/Mail/Bundles/

after this you need to figure out the new UUIDs with these two commands:

defaults read /Applications/Mail.app/Contents/Info.plist PluginCompatibilityUUID
defaults read /System/Library/Frameworks/Message.framework/Resources/Info.plist PluginCompatibilityUUID

These two UUIDs need to go into this file:

~/Library/Mail/Bundles/TruePreview.mailbundle/Contents/Info.plist

You can either do it with

defaults write ~/Library/Mail/Bundles/TruePreview.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add $UUID

or any other text editor.

If the bundle is installed systemwide of course you have to look into /Library instead of ~/Library.

Source:
Fixing GrowlMail for Mail 4.2 | langui.sh.

Posted in computer | Tagged , , , , | Leave a comment