作者:Wuxi (欢迎来我的博客: http://iCoder.me/)
============

本教程介绍在Mac系统下如何越狱和解锁iOS 4,适用于iPhone 3G/3GS和iPod touch 2G(我仅在我的iPhone 3G上试过)。如果你是Win系统请找别的教程。
特别感谢iPhone Dev-Team的Hacker们为自由事业作出的贡献!
同时感谢RedmondPie网站[1]提供了非常详细的教程,喜欢看E文的同学可以直接去这个网站。
Continue reading “iOS 4越狱+解锁教程 (Mac)”
Tags: Hack, iPhone, Mac
1. Download and install gettext: http://www.gnu.org/software/gettext/
2. Install i386-elf-gcc from MacPorts:
sudo port install i386-elf-gcc
sudo port -f activate i386-elf-gcc
You may need to create some symbolic links:
cd /opt/local/bin
sudo ln -s i386-elf-gcc-4.3.2 i386-elf-gcc
sudo ln -s i386-elf-g++-4.3.2 i386-elf-g++
3. Download GDB: http://www.gnu.org/software/gdb/download/
4. Configure and install GDB for i386-ELF:
./configure --prefix=/opt/local \
--program-prefix=i386-elf- \
--target=i386-elf \
--with-gmp=/opt/local \
--with-libelf=/opt/local \
--with-build-libsubdir=/opt/local
make
sudo make install
Then the i386-ELF GDB will be installed in /opt/local with program name i386-elf-gdb.
Note: option ‘–target=i386-elf’ specifies guest(target) type ‘i386 ELF’.
Tags: Debug, ELF, GDB, i386, Mac, OSDev
使用SSH隧道翻墙你必须有一个国外可以通过SSH登录的空间。
做法很简单(感谢Sprayfly):
1. 将下面内容存成文件tunnel.sh:
#!/bin/bash
# --------------------------------------
#
# Title: SSH HTTP Proxy Script
# Author: Jonathan Lumb
# Email: jonolumb (at) gmail (dot) com
# Homepage: http://sprayfly.com
# File: tunnel.sh
# Created: July 05, 2009
#
# Purpose: Establishes/closes a secure HTTP proxy
#
# --------------------------------------
########### Setup SSH Proxy #############
# You will need to have your server setup to run with public and private keys
export SSH_HOST=username@host
############ End of Setup #############
if [ ! -f /tmp/.tunnel ]
then
echo "创建 SSH 隧道"
ssh -f -D 9999 $SSH_HOST "if [ -f ~/.tunnel ]; then rm ~/.tunnel; fi; while [ ! -f ~/.tunnel ]; do echo > /dev/null; done" &
touch /tmp/.tunnel
else
echo "关闭 SSH 隧道"
ssh $SSH_HOST "touch ~/.tunnel"
rm /tmp/.tunnel
fi
exit
然后给这个文件增加执行权限:chmod +x tunnel.sh
2. 建立SSH的RSA授权文件:ssh-keygen -t rsa,注意:密码留空。
这样在本地的 ~/.ssh/ 下就会产生两个文件 id_rsa 和 id_rsa.pub,将这两个文件的访问权限设置为0700:chmod 0700 id_rsa id_rsa.pub,
然后将密钥授权文件id_rsa.pub文件传到远程的~/.ssh/ 下,命名为:authorized_keys,操作:
scp id_rsa.pub username@host.com:~/.ssh/authorized_keys
3. 做完上面两步后就可以开启你的SSH tunnel了:
开启/关闭SSH隧道:./tunnel.sh
然后在浏览器中设置socks代理(http代理必须留空):127.0.0.1端口:9999
补充说明一点:要关闭ssh隧道还可以在远程的 $HOME 目录下建立一个 .tunnel 文件,这样本地ssh隧道就会自动关闭了,建立方法:touch .tunnel
Tags: Linux, Mac, Proxy, SSH
1: defaults write com.apple.dashboard devmode YES
This allows you to drag widgets out of Dashboard onto the desktop. Requires the dock to be relaunched to take effect, so type “killall Dock” and press enter. Now, if you click and hold onto a widget in the dashboard and press F12 to return to the desktop, the widget won’t disappear with the rest. Put NO at the end to reverse.
2: defaults write com.apple.frameworks.diskimages skip-verify TRUE
Skip disk image verification. Potentially risky, use with disk images from trusted sources. Replace TRUE with FALSE to reverse.
3: defaults write com.apple.CrashReporter DialogType none
Disables the unexpectedly quit dialog that normally appears when an application crashes. Replace “none” with “prompt” to enable again.
4: defaults write com.apple.finder AppleShowAllFiles TRUE
Shows hidden files in the finder. Replace TRUE with FALSE to hide hidden files again.
5: defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Changes the title of a window to its full path. Repeat with NO to reverse.
to find out more, see: http://www.macosxtips.co.uk/
Tags: Mac
Path: /usr/include/sys/syscall.h
#define SYS_syscall 0
#define SYS_exit 1
#define SYS_fork 2
#define SYS_read 3
#define SYS_write 4
#define SYS_open 5
#define SYS_close 6
#define SYS_wait4 7
Continue reading “Syscall numbers on Mac (BSD)”
Tags: BSD, C, Mac, Programming
在ubuntu下用惯了apt-get,安装软件很方便,今天在mac下也看到一个类似的软件,叫MacPorts。
MacPorts的官方网站:http://www.macports.org/
在里面下载.dmg安装以后就可以在终端里类似apt-get那样安装软件了(包括GNU软件、开源软件等),如:
sudo port install wget
其他操作还有:
port selfupdate – 顾名思义。
port sync – 同apt-get的update。
port list – 列出所有软件
port search XXX – 查找XXX软件
port deps XXX – 查看XXX软件的依赖
sudo port install XXX – 安装XXX软件
sudo port uninstall XXX – 卸载。
等。
更多的操作和操作细节可以在MacPorts官网获得。
注意:MacPorts里的软件是自动下载、编译和安装的,所以你的先确保你的Mac安装了Xcode,能够对软件进行编译,这样才能使用MacPorts。
Tags: Mac
这两天刚开始用Mac,感觉Mac OS X确实很不错,支持多点触摸的Trackpad用起来比鼠标方便,还有很多其他特性,总体感觉比Win 7强一些。这些废话不多说了,回归中心──在Mac OS X (10.6 Snow Leopard)下安装Emacs 23.1.
我是通过源码编译安装的,在Mac OS X下有一些预编译好的Emacs的程序可以直接用,如果感兴趣可以在这里下载:http://emacsformacosx.com/
好,现在介绍在Mac OS X下源码安装Emacs 23的方法:
0. 准备工作──安装Xcode
首先,Mac OS X必须安装编译环境,即Xcode,可以在Apple的官网注册一个开发者帐号然后下载或者直接从Mac OS X的安装光盘中找到Xcode进行安装。
Xcode中不光包括编译器(gcc),还有Apple的IDE以及Mac和iPhone的SDK等,不过安装Emacs 23只用到其中的gcc。
1. 下载Emacs 23
Continue reading “在Mac OS X下安装Emacs 23″
Tags: Emacs, Mac