Bypassing LockDown (iPhone Application)

————

One funny thing about programs like LockDown is that they all use mobilesubstrate to attach. and for programs like LockDown that is adding security for iphone that’s not too good!

as you may know mobilesubstrate attached files and some more services would not work in safe mode! they are all disabled!

so for LockDown password (in my test case it was version 6.2! almost the latest by now) you can just use SBSetting to boot up in safe mode and access everything that has been locked!

if you don’t have SBSetting installed and you have Cydia Locked I guess it is not your own iPhone so I just say there is a command you could use via SSH connection to reset springboard to safe mode. it’s maybe “Touch something” or something else!;) try and learn

Final Solution for Adobe CS4 “license stopped working”

License Stopped Working

Adobe CS4 License Stopped Working Solution

after dealing with this error and lots of googling finally i found a working solution,

I had Adobe CS4 installed on my mac and after a restore with time machine I had this annoying error Adobe CS4 “license stopped working” with error codes 139, 6 and so on…
every how to was referring to adobe support site that as of now it is down, the link is down here:

http://kb2.adobe.com/cps/405/kb405970.html

you can use those Adobe CS4 CS5 clean up tools and stuff but none of them worked for me, what you should do is:

  • Delete “cache.db” in “/Library/Application Support/Adobe/Adobe PCD/cache”
  • Delete “FLEXnet Publisher” folder in “/Library/Preferences”

and you’re done! now open your Adobe CS4 product and maybe you should enter the license key again but everything is working now! a simple solution! ;-)

OpenWrt *.postinst returned 127


OpenWrt

I’ve been working with OpenWRT on linksys NSLU2 lately for some projects that I ran into a strange error while using the package manager OPKG.

as you may know OpenWrt, the latest version of this project is called kamikaze (8.09). the older one was called “White Russian” (as the big lebowsky’s favorite drink). some interesting naming of these distributions is that they are both Alcohol Drink mix’s. and also IPKG is OPKG in here!

Anyways I’ve ran into this problem when trying to install some packages using “opkg install <package> or <file>”.

the output would be something like:

Configuring <Package>

//usr/lib/opkg/info/<Package>.postinst: line 2: update-alternatives: not found

postinst script returned status 127

The reason for this error is that somehow update-alternatives is not availble in OpenWrt or maybe in this version.

So the solution would be to add this file in the Path it should be,

you need to use Vi or ,as my favorite, Nano to do so.

nano /opt/bin/update-alternatives

and paste this into the file:

#!/bin/sh
# update-alternatives
#
# Copyright (C) 2001 Carl D. Worth
#
# This program was inspired by the Debian update-alternatives program
# which is Copyright (C) 1995 Ian Jackson. This version of
# update-alternatives is command-line compatible with Debian's for a
# subset of the options, (only --install, --remove, and --help)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

set -e

# admin dir
ad="$IPKG_OFFLINE_ROOT/usr/lib/ipkg/alternatives"

usage() {
echo "update-alternatives: $*

Usage: update-alternatives --install

update-alternatives --remove
update-alternatives --help

is the link pointing to the provided path (ie. /usr/bin/foo).
is the name in $ad/alternatives (ie. foo)

is the name referred to (ie. /usr/bin/foo-extra-spiffy)

is an integer; options with higher numbers are chosen.
" >&2
exit 2
}

quit() {
echo "update-alternatives: $*" >&2
exit 2
}

register_alt() {
[ $# -lt 2 ] && return 1
local name="$1"
local link="$2"

if [ ! -d $ad ]; then
mkdir -p $ad
fi

if [ -e "$ad/$name" ]; then
local olink=`head -n 1 $ad/$name`
if [ "$link" != "$olink" ]; then
echo "update-alternatives: Error: cannot register alternative $name to $link since it is already registered to $olink" >&2
return 1
fi
else
echo "$link" > "$ad/$name"
fi

return 0
}

protect_slashes() {
sed -e 's/\//\\\//g'
}

remove_alt() {
[ $# -lt 2 ] && return 1
local name="$1"
local path="$2"

[ ! -f $ad/$name ] && return 0

path=`echo $path | protect_slashes`
sed -ne "/^$path\>.*/!p" $ad/$name > $ad/$name.new
mv $ad/$name.new $ad/$name
}

add_alt() {
[ $# -lt 3 ] && return 1
local name="$1"
local path="$2"
local priority="$3"
remove_alt $name $path
echo "$path $priority" >> $ad/$name
}

find_best_alt() {
[ $# -lt 1 ] && return 1
[ ! -f $ad/$name ] && return 0

link=$IPKG_OFFLINE_ROOT/`head -n 1 $ad/$name`

## path=`sed -ne "1!p" $ad/$name | sort -nr -k2 | head -1 | sed 's/ .*//'`
## busybox safe:
path=`sed -ne "1!p" $ad/$name | sed -e "s/\(.*\) \(.*\)/\2 \1/g" | sort -nr | head -n 1 | sed 's/[^ ]* //'`
if [ -z "$path" ]; then
echo "update-alternatives: removing $link as no more alternatives exist for it"
rm $ad/$name
if [ -L $link ]; then
rm $link
fi
return 0
fi

if [ ! -e $link -o -L $link ]; then
local link_dir=`dirname $link`
if [ ! -d $link_dir ]; then
mkdir -p $link_dir
fi
ln -sf $path $link
echo "update-alternatives: Linking $link to $path"
else
echo "update-alternatives: Error: not linking $link to $path since $link exists and is not a link"
return 1
fi

return 0
}

do_install() {
if [ $# -lt 4 ]; then
usage "--install needs

"
fi
local link="$1"
local name="$2"
local path="$3"
local priority="$4"

path=`echo $path | sed 's|/\+|/|g'`

# This is a bad hack, but I haven't thought of a cleaner solution yet...
[ -n "$IPKG_OFFLINE_ROOT" ] && path=`echo $path | sed "s|^$IPKG_OFFLINE_ROOT/*|/|"`

register_alt $name $link
add_alt $name $path $priority
find_best_alt $name
}

do_remove() {
if [ $# -lt 2 ]; then
usage "--remove needs
"
fi
local name="$1"
local path="$2"

path=`echo $path | sed 's|/\+|/|g'`

# This is a bad hack, but I haven't thought of a cleaner solution yet...
[ -n "$IPKG_OFFLINE_ROOT" ] && path=`echo $path | sed "s|^$IPKG_OFFLINE_ROOT/*|/|"`

remove_alt $name $path
find_best_alt $name
}

###
# update-alternatives "main"
###

while [ $# -gt 0 ]; do
arg="$1"
shift

case $arg in
--help)
usage "help:"
exit 0
;;
--install)
do_install $*
exit $?
;;
--remove)
do_remove $*
exit $?
;;
*)
usage "unknown argument \`$arg'"
;;
esac
done

usage "at least one of --install or --remove must appear"

exit 0

then save the file (in nano you should press CTRL + X then Y then Enter)

then give the proper permission to the file

chmod +x /opt/bin/update-alternatives

you're done! no more postinst returned 127 errors.

Offline iPhone Wiki

MJ

If you’re an iPhone user you may have seen this before, I’m just making this post for people who may need some modification on the whole articles.bin or maybe for some other language wiki’s, like I did.

Before you begin you got to know, you need a Jailbroken iPhone to do this.

So… here’s the files you need:

  1. Wikipedia Dumps
  2. Indexer
  3. Wiki2srvd (for iPhone)
  4. Actually some way to copy articles.bin to you’re iphone

1. you can get you own wiki dumps (different language or … ) from here:

http://download.wikimedia.org/

for English Dump you can check: http://download.wikimedia.org/enwiki/

or for you’re own language : http://download.wikimedia.org/XXwiki/ (XX would be you language’s init)

the file name should be something like this: pages-articles.xml.bz2

2,3. the Indexer, the original place to get that is from the site of  T. Haukap but I couldn’t find anything related to Wiki in that site. Other places you can find this is by Wiki2Touch google codes page and also this project is somehow down for now.

anyways, I have attached the files needed including Wikisrvd v 0.65 (latest by now) in this post.

4. You can use SSH for transfering the file but if it’s too big you can use softwares like iFunBox or iPhone PC Suit in Windows, DiskAid or PhoneView in Mac.

——————————————————————-

Now all you have to do is run the indexer on the dump. (this is the view of the indexer and everything is obvious)

Wiki2Touch repackager/indexer

Copyright (c) 2008 T. Haukap

Version 0.65

Usage: indexer [-adIi] <filename>

filename: articles file from wikipedia like ‘enwiki-latest-pages-articles.xml.bz2′

-a : Add all articles (not removing namespaces like ‘Help’, ‘Category’ or so)

-d : Add an index where the diacritics (i.e. é, ä or so) in titles are not taken into account

-I : Not scan for images. ‘images.txt’ is not procduced.

-i : Scan for images only. An ‘articles.bin’ is not produced.

-s : Silent, don’t produce any output on the console window (except the copright message).


It will produce a file in the same directory as you dump named “articles.bin”.

then you need to install wikisrvd on your iPhone. the older version of wikisrvd is availble through Cydia but if you dump is bigger than 4 GBs you will need this version. also the Updated version is also availble in i-Phone.ir Cydia Repository.

now you just need to copy “articles.bin” to your iPhone in this path: “/var/Media/mobile/Wikipedia/en” (if you’re using english dump. en would be your own dump language init)

So now you’re done. go to 127.0.0.1:8080 on your iPhone’s safari and enjoy the Offline Wiki on the iPhone.

iPhone Wiki Files

These files are included in the attached zip file:

Mac -> gen, indexer, pack

Win -> ImageGetter.exe, TransferTool.exe, indexer.exe, gen.exe, pack.exe

iPhone-> wikisrvd-0.1.20091028.deb