OS X: access IPv6 in THU with ISATAP

Tsinghua University has IPv6 network access if you use cable, sometimes Wi-Fi is also IPv6-ready but it’s never reliable. What’s more, you have to use ISATAP to get an stable IPv6 access in THU, while ISATAP is not officially supported by OS X. So you will find out that IPv6 in THU is sometimes on and down when you are using OS X.

Thank goodness somebody have find out how to fix this without any plugin installing, but some basic command line steps: http://blog.ucare.me/2012/12/15/mac下用isatap上ipv6/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#清除IPV6路由表
sudo route delete -inet6 default
EN0_IP=`/sbin/ifconfig en0 | grep inet | grep -v inet6 | awk ‘{print $2}’`
EN1_IP=`/sbin/ifconfig en1 | grep inet | grep -v inet6 | awk ‘{print $2}’`
if [ -n “$EN0_IP” ]; then
LOCAL_IP=$EN0_IP
else
LOCAL_IP=$EN1_IP
fi
if [ -n “$LOCAL_IP” ]; then
/sbin/ifconfig gif0 tunnel $LOCAL_IP isatap.tsinghua.edu.cn
/sbin/ifconfig gif0 inet6 2402:f000:1:1501:200:5efe:$LOCAL_IP prefixlen 64
/sbin/route add -inet6 default 2402:f000:1:1501::1
fi

I tried it, it works. But it is not known why the IP address shown in System Preferences panel is different from the gif0 interface specified in ifconfig command.

ipv6-spipv6-cli

Here are some more links talking about this issue, but they are either too old an post to giving a working workaround or using a very complex way to fix it.

http://www.yunaitong.cn/blog/2012/09/08/mac-os-xxia-tong-guo-isataplian-jie-qing-hua-de-ipv6de-fang-fa/

http://blog.fangjian.me/posts/2011/03/10/connect-tsinghua-ipv6-via-isatap-on-osx/

Advertisements

OS X: hide/unhide files and folders

Let’s use ~/Desktop/1.txt and ~/Desktop/1/ for example.

Hide files and folders:

chflags hidden ~/Desktop/1.txt

chflags hidden ~/Desktop/1/

Unhide files and folders:

chflags nohidden ~/Desktop/1.txt

chflags nohidden ~/Desktop/1/

If you installed Apple developer command line tool in Xcode, you can also use the following ones.

Hide files and folders:

setfile -a V ~/Desktop/1.txt

setfile -a V~/Desktop/1/

Unhide files and folders:

setfile -a v ~/Desktop/1.txt

setfile -a v ~/Desktop/1/

It is also true that these two command makes the same effects, so you can simply use any combination of them. For example, use chflags to hide one file and use setfile to unhide it.

Source link:

http://osxdaily.com/2009/08/11/hide-any-file-or-folder-by-making-it-invisible-to-the-mac-os-x-finder/

http://osxdaily.com/2012/01/06/hide-folders-mac/