The RoLLing cOde

Rumor, crap and –un–original

Sign IPA with installed Apple developer license

leave a comment »

You should have iOS SDK and your iPhone/iPad developer certification installed on your Mac before trying this script.

#!/bin/sh
SAVEDIR=`pwd`
WORKDIR=/tmp/ipa_$RANDOM$RANDOM
WORKIPA=/tmp/ipa_$RANDOM$RANDOM.ipa

echo unpacking $1
mkdir -p $WORKDIR
unzip "$1" -d $WORKDIR  > /dev/null || exit
cd $WORKDIR
for f in $( ls Payload ); do
	echo Processing $f
	rm -rf Payload/$f/_CodeSignature
	cat >Payload/$f/ResourceRules.plist <<XXX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>rules</key>
	<dict>
		<key>.*</key>
		<true/>
		<key>Info.plist</key>
		<dict>
			<key>omit</key>
			<true/>
			<key>weight</key>
			<real>10</real>
		</dict>
		<key>ResourceRules.plist</key>
		<dict>
			<key>omit</key>
			<true/>
			<key>weight</key>
			<real>100</real>
		</dict>
	</dict>
</dict>
</plist>
XXX
	codesign -f -s "iPhone Developer" -vvv Payload/$f
done
echo repacking
zip -9yr $WORKIPA * > /dev/null
cd $SAVEDIR && mv "$1" "$1.$RANDOM$RANDOM.bak" && mv $WORKIPA "$1" && rm -rf $WORKIPA

Only tested with a few .IPA files myself so far, use it properly at your own risk.

Written by freewizard

2010-07-28 at 23:00

Posted in Crap

Attack of the Clone of Clone

leave a comment »

There were two famous funny abbr about Chinese internet industry:
ICP = Internet Copy Paste.
C2C = Copy to China.

Today, we seems to get a new one: TCP = Tencent Copied Perfectly.

Mu Rongjun, a staff at MeiTuan, complained on his twitter about their website being copied pixel-by-pixel by Tencent.

Murj

Following images shows how identical their pages are in both texts and screen shots.

Help page about “how to avoid false spam alert in GMail” on meituan.com:
meituan

Help page about “how to avoid false spam alert in GMail” on tuan.qq.com:
qq tuan

By take a careful stare to the fonts in the two screen shots, you can see the email address in the second shot, which is from Tencent, is definitely handcrafted by image editing not a real screen shot.

The fun part here is: MeiTuan is one of the earliest clones of groupon in China; Tencent, the 3rd largest internet company in the world(by mkt cap), joins the clone war of groupon recently; so it turns out Tencent has just done a clone of clone.

Since China is a Harmonious Society and MeiTuan is just a small startup, I think this story will just end up nowhere. On the other hand, because most people in this society are all comfortable with downloading and consuming digital content for free, there might not be any powerful moral motivation to accuse others for cloning and pirating.

Written by freewizard

2010-07-11 at 00:53

Posted in Crap

FanRadio + AppleScript

leave a comment »

Check update or Download.

shuffle : shuffle or skip to next song
current track : title of current track → text
current album : title of current album → text
current artist : name of current artist → text

For ppl who ask features like updating Last.fm/MSN/Gtalk/Twitter status, you can now do it yourselves.
Here’s a small piece you can start with, in case you are new to AppleScript.

Want to share the current playing song with your Adium friends? Install Now Playing in Fan Radio.AdiumScripts and type %_fanradio_playing in your status or chat message.

Written by freewizard

2010-07-03 at 12:03

Posted in Crap

FanRadio: Free Music For Mac

with 18 comments

Plays free tracks from Douban Radio

  • Requires Mac OSX Leopard or Snow Leopard
  • Growl integration
  • AppleScript support
  • Global hotkey
  • Use Safari to login Douban, check “remember me”

Screen Shot

Download | 下载

Written by freewizard

2010-06-20 at 21:33

Posted in Crap

Tagged with ,

Safari Extension: Share to Google Reader

with 4 comments

Requires Safari 5.0 or later
Download here

Written by freewizard

2010-06-10 at 03:16

Posted in Crap

Tagged with

WordPress full export script

leave a comment »

Add the script to crontab so that backup scheduled everyday.
Python code follows.

#!/usr/bin/python
import cookielib, urllib2, urllib, sys
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)

def export(url, login, passwd):
	u = "wp-login.php"
	l = {"log":login, "pwd":passwd}
	r = urllib2.Request(url + "wp-login.php", urllib.urlencode(l))
	v = urllib2.urlopen(r).read()
	r = urllib2.Request(url+"wp-admin/export.php?author=all&download=true");
	v = urllib2.urlopen(r).read()
	return v

def main(argv):
	if len(argv)<4:
		sys.stderr.write("Usage: %s http://your.wordpress.com/ user pass\n" % (argv[0]))
	else:
		print export(argv[1], argv[2], argv[3])

if __name__ == "__main__":
    sys.exit(main(sys.argv))

Written by freewizard

2010-04-17 at 17:57

Posted in Crap

AdBlock plugin for OmniWeb

leave a comment »

Current OmniWeb has an ad-block feature, and this plugin makes it possible to automatically update the filter list from EasyList and etc.

Install SIMBL if not yet.

Download, unzip and copy Safari AdBlock.bundle to /Library/Application Support/SIMBL/Plugins/

For OmniWeb 5.x users, run following commands in Terminal to activate Safari AdBlock for OmniWeb:

defaults write -app OmniWeb ABIsEnabled -int 1
defaults write -app OmniWeb ABSubscriptions -array -string en
defaults write -app OmniWeb OWAddressFilteringEnabled -int 1

  • works for Safari & Webkit too
  • no preference UI in OmniWeb, turn on/off by using built-in AdBlock switch of OW
  • built-in ad block of OmniWeb still works, use that as customized block list if you wish
  • only tested on OSX 10.6.3 / OW 5.10.2-r128512, might also be ok for earlier versions though

Source

Written by freewizard

2010-04-05 at 20:49

Posted in Crap

Tagged with

Idle reminder script for The Hit List

leave a comment »

This handy script will remind(disturb?) you every N minutes about what you are doing (if you begin a task in
The Hit List
) or you are idling right now as
Growl
notification.

Paste the following code to Script Editor, Save.

try
	tell application "GrowlHelperApp" to register as application "THL Notifier" all notifications {"Doing", "Idle"} default notifications {"Doing", "Idle"} icon of application "The Hit List"
	tell application "System Events"
		tell process "The Hit List" to set myDoing to get value of text field 1 of window "Timer"
		tell application "GrowlHelperApp" to notify with name "Doing" title (myDoing) description ("now doing...") application name "THL Notifier" priority 0 sticky no icon of application "The Hit List"
	end tell
on error
	tell application "GrowlHelperApp" to notify with name "Idle" title ("Something to do?") description ("idle...") application name "THL Notifier" priority 0 sticky no icon of application "The Hit List"
end try

Open Terminal, type

crontab -e

Add this line and save ( you can change 15 to what ever minutes between each reminder)

*/15  *    *    *    *    osascript /path/to/Whatsup.scpt

Note: due to the limitation of the time tracking window display in THL, this script does not support Spaces very well.

Written by freewizard

2009-06-01 at 09:34

Posted in Crap

Tagged with

Install multiple versions of Flash plugin for Firefox

with one comment

As developing ActionScript projects, one have to frequently switch between different Flash versions and test. Here is a tip for Mac OSX ( also works on Windows I think ) to install multiple versions of Flash Player plugins for Firefox.

When Firefox starts, it scans for plugins in 3 sets of directories:

  1. General plugin directory for current system and user, e.g.
    /Library/Internet Plug-Ins/
  2. Plugin directory for current application executable file, e.g.
    /Applications/Firefox.app/Contents/MacOS/plugins/
  3. Plugin directory for current profile, e.g. 
    ~/Library/Application Support/Firefox/Profiles/fw9q5h64.default/plugins

Then it will
sort by modification time
, dedupe and load all the plugins.

Now you get the trick:

  1. Extract the desired firefox plugin files (
    e.g. Flash Player.plugin
    and
    flashplayer.xpt
    on Mac ) from Flash plugin installer or copy from installed directory ( e.g.
    /Library/Internet Plug-Ins/
    on Mac )
  2. Copy these files to your favorite firefox app or profile directory
  3. use the command


       touch -t 201603150101.01

    Flash Player.plugin

    flashplayer.xpt

    to make the mtime larger than the one in the general directory.

  4. repeat above steps for all flash versions you want.

Update: you should check “Open using Rosetta” when playing Flash 8 or earlier with Firefox on Mac.

Written by freewizard

2009-04-18 at 16:21

Posted in Crap

Tagged with ,

TextMate bundle for the haXe Language

leave a comment »

It’s modified from some post in the
haXe mailing list
.

Check it out from
GitHub
.

Written by freewizard

2009-04-04 at 07:18

Posted in Crap

Tagged with ,