All posts by Jeremy

Synology RT2600AC Router Ad-Block Script

Most of the scripts online such as this, this, and this, are written for Synology DSM or their NAS. I have been having some issues using these scripts on my Synology Router. Synology does not publish as many official packages for their router as their NAS anyways. 

I think these scripts do not work well because the shell in their router is busybox ash rather than a more advanced shell. My theory is based on the execution errors I get. It appears some functions and syntax that work for others on NAS does not work on the router. 

However I managed to combine a couple of scripts to make it work decently. 

Just scp and upload the following shell script as update to your Synology Router, to the folder “/var/packages/DNSServer/target/script/”, and execute the shell as root after you SSH in, and it should work. 

# Name:
# Author: Ryan Gibbons <rtgibbons23 @>
# Date: 20160214
# Description: Updated a blacklist data file for Bind that will point a null zone to route each domain to
# Inspiration and Thanks:
# 	*
# 	*
#       *
#       *
#       *
# Modified by Jeremy Yan <jeremy at yansc dot com>
# Credit: Ryan Gibbons, dMajo, and Gerzon

# Process URLs if they offer a zip we'll use it to save them bandwidth. 
# Not using b/c it ~350K objects and causes named to consume over 2GB ram
ZIP_URLS="" #"

# Use a temporary directory to store the downloads and working files
TMPFILE=$(head -c 50 /dev/urandom | tr -dc 'a-zA-Z0-9')


mkdir -p $TMPDIR


for url in $ZIP_URLS; do
	# Silent curl on each URL comparing the last-modified-since before attempting to downlaod
        curl -s -z $TMPDIR/$ -o $TMPDIR/$ $url
        # Unzip to stdout, sed to remove windows newliens and domains ending with period,
        # The $ before the first sed expression is to process the string in bash b/c version of sed with DSM5.2 doesn't recongize \r
        # then for each entry in a host file pointing to or create a BIND formated zone statement
        unzip -c $TMPDIR/$ | sed -e $'s/\r//' -e 's/\.$//' | awk '/^(|{print "zone \""$2"\" { type master; notify no; file \"/etc/zone/master/\"; };"}' >> $TMPDIR/$TMPFILE
        i=$((i + 1))

for url in $PLAIN_URLS; do
        curl -s -z $TMPDIR/$i -o $TMPDIR/$i $url
        cat $TMPDIR/$i | sed -e $'s/\r//' -e 's/\.$//' | awk '/^(|{print "zone \""$2"\" { type master; notify no; file \"/etc/zone/master/\"; };"}' >> $TMPDIR/$TMPFILE
        i=$(( i + 1))

# Strip out localhost, localdomain, broadcasthost, localhost.localdomain entries, and install the blacklist
cat $TMPDIR/$TMPFILE | sed -e '/"\(local\|broadcast\)\(host\)\?\(.localdomain\)\?"/d' | sort -fu > $BLACKLISTFILE


# Include the new zone data
# This section is adopted from dMajo's script
cd ${WorkDir}
	if [ -f blacklist.db ] && [ -f ]; then
		#grep -q 'include "/etc/zone/data/ad-blocker.db";' || echo 'include "/etc/zone/data/ad-blocker.db";' >>
		# Rebuild data
		echo 'zone "" {'					>
		echo '	type master;'							>>
		echo '	file "/etc/zone/master/";'>>
		echo '	allow-transfer {any;};'					>>
		echo '	allow-update {none;};'					>>
		echo '	allow-query {any;};'					>>
		echo '};'										>>
		echo 'include "/etc/zone/data/blacklist.db";'	>>

# reload the zone entries

Note the pre-requisites:

  • You must have DNSServer package installed
  • You should create a master zone called “” in the Zones. See the screenshot below

Then you should be okay.

Mobilebackups.trash somehow make its app folder not immutable, so that sometimes it causes problem when deleting it from Time Machine backups.

I am somehow having problem on El Capitan 10.11 beta that local Time Machine backups are taking all my spaces. So I disabled it but have problem emptying the trash. And it is

This is the command to use:

> chflags noschg # this removes system immutable flag

> chflags nouchg # this removes the user immutable flag

In my case I used chflags -R noschg/nouchg .Mobilebackup.trash

Finally got my SSD space back.

On Marco and Apple Software Quality Decline

I saw the Marco blog post moments after it was published. I also saw it spreading like wildfire today: a lot of press coverage. I knew Marco wouldn’t be pleased with how it turned out. And he indeed wrote up another post to reflect on this. I was going to see what he said on Twitter but didn’t follow through the search. Twitter is too much for me nowadays.

My opinion is this.

Maybe he did use words too harsh, but overall he was correct. He spoke my mind. I immediately shared that post. I have also been complaining about it with friends for at least a year. I talked about this with people around me already a number of times. Not just me, other people chimed in too. Even Macdailynews posted an open letter about this (although it felt like they were riding on Marco’s back but I am sure they also completely agreed). The only problem was, Marco was too famous already. So the “Apple is doomed” sensationalism naturally built on top of it. If he is less famous it would have just stayed within the Apple enthusiastic circle.

But the positive thing is, after all these media attention, even though Marco doesn’t want to be associated with it, I think maybe Apple and Cook will finally pay attention to this big problem.

Asian Enrollment in US Elite Schools Throttled

eliteenrollment-large asians-large


It is no secrete that Asians are having a bamboo ceiling in the US. It starts early and persist into their careers. Elite schools in the US, aside from those in California (due to state law that banned consideration of race for college admission), seem to have artificially limited their Asian enrollment to about 15%. Recently, Harvard and U. North Carolina were sued for discriminating against Asians.

From this chart, it looks like even though Jewish Americans, also considered outperforming, are not really experiencing the same thing as Asians are experiencing. But historically, Jewish American were discriminated against. Asians may need to fight for their rights as Jewish Americans did. Jewish Americans are powerful force in the US academia. Perhaps that’s why nobody dare to say they need to limit them during admission. And most Jewish Americans are considered white. So perhaps it is the non-Jewish white Americans paying a price, or being less excellent. I don’t know what it is.


App developers have no special privileges

Daring Fireball: One Star Reviews Flood ‘Monument Valley’ Following Paid Expansion Release

I don’t understand this mentality. I see this often: app developers complain that people don’t pay up. But what gives them the privilege to complain about this?

There are a lot of people doing great work & have family to support & they don’t get paid enough. There is no such thing as app developer privilege that allows app developers to be exempt from almost everybody’s desire to pay less for things, and not to get their money suckled.

People don’t pay for music. They pirate and stream. They go to YouTube. Musicians and workers in the music industry have families too. They do real work too. We scientists work more than most regular jobs, and we have families and ourselves to feed. Our work is more significant to humanity than these game developers. We don’t bitch nearly enough. Nor do we feel like we have such privilege that people must pay up!



OS X来自NeXTStep,是个UNIX。这个优势给了苹果又是几年领先于微软的资本。但是微软基本上还是赶上来了。

OS X那时候是有很多独一无二的东西的。iLife:这个易用性,这个整合性,无人能比。那个时候,其他平台上根本没有可以媲美的照片管理软件,或简单易用但是还是很强大的业余音乐制作软件,或者能够轻松做出苹果级审美的iWeb网页制作软件,更不要说微软的MovieMaker和iMovie比起来就是小学生的作业。做音乐,玩摄影,做视频、家庭电影,还算是有点小资、文艺范儿的东西,远没有普及,那么你要是想做,想做的好,又不要太难,基本上Mac就是不二的选择了,不差钱的话。iTunes也是最好用的音乐管理软件,长期也是最佳的数码音乐购买平台。Aperture刚出来也是非常厉害的,鞭策了Adobe,不然也没有Lightroom了。.Mac和MobileMe的云同步,虽然不够全面,但是通讯录、书签等的同步,当时也是业界领先的。

现在呢?虽然iOS和OS X本来还算很优秀,但是苹果自带的软件已经越发缺乏光芒。iOS和OS X的最终在今年的整合,算是一步好棋,但是我们却快没有多少可以拿出来说,你要做这个那毫无疑问要选苹果了。唯一也许还能拿出来说的,让人吃惊的是,居然是一些网络服务:比如iMessage,FaceTime, iCloud Photostream (Photo library)。而网络服务除了这些产品的概念和易用性以及隐私保护很好以外,苹果网络服务的质量并不比其他公司好。


iWork就更说明问题了。iWork 09之后,到了13年才真的更新了:却丢掉了很多功能。虽然换来了网页版,OS X版和iOS版的兼容,却丢掉了很多功能满满加回来。有些功能可能永远丢失了吧。今天惊闻最新的iwork不能打开iWork 09版之前的iwork文件了。这是何等的坑爹?要不要对用户负责?我很多年前做的文件难道就要在不久的将来再也打不开了吗?用户还怎么对使用苹果的东西有长期支持的信心?而iwork虽然算是不错的Office软件,但是却没有以前苹果软件的光芒。Keynote以前甩了PowerPoint几条街,现在呢?感觉除了改改界面和风格,基本是原地踏步,苹果的精力都用开兼容自己不同平台,和支持OS和云的新变化去了,连自己的老文件格式都不兼容了,真是笑话。

我最近也遇到很多iCloud和iWork的bug。网络上的情绪也都是感叹苹果软件质量有严重下降,小毛病不断。我最近都用出Windows的感觉了。我还是要赞扬一下Yosemite的,OS X最近表现得比iOS好。







Apple Watch


有些观点和我雷同。比如,显然Apple Watch $349的是Sport。他猜测的普通版(蓝宝石,不锈钢)高达$999。个人认为高了。我觉得应该会是在$499-$699之间。


18k金的Apple Watch,他猜测$4999,乃至$10,000都有可能。我觉得如果真的是实心的18k金外壳的话,那么肯定至少是$2000。如果真的是$5000的话,感觉苹果一年能卖出十万部就很了不起了。这是5亿美元的销售额。如果真的是$5000的话,我之前也想过,也许核心是可以升级的。否则用户怎么justify买一个手臂上的电脑,过两年就彻底失去前沿性?Gruber也猜测,如果不可以升级,那么苹果可能会给trade-in。花了这个价钱,那么用户肯定是期望很高的客服的,所以提供定制计算机部分升级,也不为过。本来也是设计的“computer on a chip”然后封装得很好。但是说实话如果销量跟不上的话,专门做这个定制升级模块,成本也是很高。可能卖$5000,升级内核部件需要$500以上:比买新的sport还贵,但是得提供贵宾式服务。


Gruber认为苹果是否in trouble关键是Apple Watch的功能和软件到底如何。目前我们并不是很清楚它究竟可以干些什么,第三方软件支持到底怎么样,是否是真正的独立计算机,虽然需要iPhone来完成通信等功能。如果功能很局限,那么确实是很难一炮打响。不排除二代突飞猛进,但是如果是这样,买家又如何能够为第一代的18k金的Apple Watch买单呢?

是的,苹果的电脑是最好的个人电脑,苹果的手机是最好的手机,苹果的iPod是最好的MP3。苹果的iPad是最好的平板电脑。但是,苹果的Apple Watch到底会不会是最好的手表呢?如果不是,至少必须是最好的智能手表吧?

Corporate BS

It is no secrets that corporations write BS. Chase has sent me a couple of times notification that they are changing the credit card reward program:

We are making changes to the Ultimate RewardsSM program to meet the evolving needs of our customers.

What they really mean is that they are taking away some benefits of the reward program or make them of less value to their customers. It is the opposite of customer needs. It is 100% of their needs.

Social network

Marco brought this to my attention.

Yes I am fed up with the social networks of our time. Facebook continues to experiment on us, while collecting our behavior data for its own benefit: to maximize the time we spend on their; to show us things that it thinks we want to see; to hide things that it thinks we don’t want to see. Their ultimate goal is to make money. And there is a conflict of interest there. We are Facebook and Google’s product: they sell us to the advertisers. They have no moral baseline. If they are not-for-profit, the current scheme of things may be different. But I am optimistic that new things will arise. is a good idea but I don’t think it is ready yet. I hope in the future this blog and things can be integrated with tent, or something like that. In fact we can each afford to host our own site, and these sites can be connected with each other. We don’t have to sell ourselves to a single or a couple of companies.

WordPress is indeed much better than I first started using it. But my posts have gradually decreased over time. I do post often on Facebook and sometimes Twitter as well. But I never felt that I own my content. Facebook don’t even allow me to search my old posts. This annoys me greatly. Maybe they will bring this feature, but still, they own me on Facebook. I am going to strive to reduce my dependence on Facebook. If I want to talk about something, post something for my friends to see, I will try to post them here, and link on Facebook, until there is a better way for us to ping each other.

This reminds me of talking about how Apple could have changed social network with their iMessage platform. We know each other already, we have each other’s phone number. We can be automatically connected. Things can be shared. There does NOT need to be ads. No one need to collect our behavior in order to show us promotional materials. I would love to have that social network.

rant more! Ice bucket challenge

It is a meme it is a fad it is something celebrities opportunists grab! I am sorry to be negative but we have a lot more issues in this world that is worth this much attention.

Got to give it to the original people who came up with this though. And this is just another viral thing…. more than Harlem Shake….

Good for this rare disease. Good for those who got some attention. At this attention grabbing Internet era. This is inevitable but we have to stay calm and move on.




然而,因为中国缺乏言论自由,媒体更缺乏多样观点和表述机会,因此民族问题也因此受到牵连,缺少了很多沟通化解矛盾的机会。 因为报道不多,所以我只能猜测,大多数情况下,少数民族是不太可能可以有和平的游行、抗议和示威。如果他们有这个意向,那么申请被否决,或被警察驱赶几乎是必然的。媒体也并不能采访和播放一些持有不同观点的少数民族群众。少数民族族裔也少有能上电视台讨论民族问题。问题虽然存在,但是回避、不准讨论,绝对不是决绝问题的方法和态度。

事实是,新疆恐怖主义袭击发生很多次,民族矛盾看似激化,但是我们汉族有多少机会能 够看到真实坦诚的对话?新疆维吾尔族有多少可以自由的谈他们的观点?如果汉族不知道普通维吾尔族怎么想,很多相关讨论和观点就几乎是空谈。我也要承认,这篇博文也缺乏一些民意基础。如果我要写美国种族矛盾,那么我至少有听过很多不同观点,听过很多采访,知道有很多被关押的黑人可以有他们自己的声音,虽然这些声音并不能和主流媒体比嗓门,但是多少是有渠道的,有记者是可以去关注和报道的。而且大学里也有很多学者研究这些问题,观点也更是“百花齐放”。

我们普通汉族群众没有和维吾尔族平等对话交流的机会,这本质上就是一种种族压迫:一来可能维吾尔族不敢说出他们内心的真实想 法;二来种族隔阂是如此之大,汉族和维族几乎很难成为朋友,也没有交流的渠道;三来政府没有做任何类似美国“多样化”的工作,也导致民族之间真实交流很少。所谓交流仅仅停留在央视的民族歌舞和主旋律报道。事实上,如果至少20%的维吾尔族认为他们受到压迫,在没有正当途径表达诉求的环境下,矛盾就会很难化解了。如果有正当渠道,我想中国的民族问题面貌将非常不同。






美国前冬奥会运动员Samantha Retrosi在犹他州长大。11岁的时候被Verizon赞助的无舵雪橇协会选中培训,到意大利图灵奥运会出事。同项目甚至有运动员丧生。


Samantha给The Nation杂志撰文,从她个人经历和对奥运会的观察,表示奥运会和热门小说/电影《饥饿游戏》非常相似。“饥饿游戏”盛大的开幕式,是为了掩饰游戏的惨无人道。而奥运会开幕式也是有类似的作用和目的。奥运会运动员入场,人群欢呼,称赞他们挑战人类的极限。他们挥舞各国国旗,是各国的骄傲,是爱国主义教育的活教材。他们代表的,远超过自己和运动本身。





I was not allowed near any camera without giving a visual and verbal statement of thanks to Verizon for making all of my dreams come true.



Samantha和其他一些客人做客Democracy Now!访谈,也是值得一看

剩女 家暴 婚姻法保护男性

这篇文章是常居中国的Leta Hong Fincher写的。她主要研究妇女问题。





“The institution of marriage basically benefits men, and when women are hurt, this institution doesn’t protect our rights. The most rational choice is to stay single.”