Category Archives: 普通 General


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.

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好。







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.

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.




剩女 家暴 婚姻法保护男性

这篇文章是常居中国的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.”

Nobody writes a blog any more.

Now that media, mainstream or independent, move to blogging; and individuals move to sharing on Facebook and Twitter and Weibo: Nobody writes blog any more!

I always wanted to post more to this blog, but in the end I didn’t. For these reasons:

– less audience; still have to link to Facebook to share.
– less convenient. Despite WordPress being open, the usability is not on par with other products.
– the gallery option is not powerful enough: Gallery3 integration, or NextGEN gallery are usable but not great.

So I am not sure the fate of this blog. I will try to post more…

Adjusting GD setting in Gallery3 to reduce noise and sharpness

I am going back to Gallery3 to host my own picture gallery online. Now with Facebook integration, I think it is the way to go again. And I have better control over the picture size etc.

But after installing and adjusting the settings, I notice the pictures turned out to be quite noisy on Gallery3. So I dig around and found a way to fix it by adjusting GD.php to reduce the amount of sharpen GD does to the resized images. Now the pictures look similar to Flickr.

Main part is to change this file:

// Amount should be in the range of 26-10
$amount = round(abs(-26 + ($amount * 0.16)), 2);

attached a screenshot of the original article.

Fix Twitter Updates Your Facebook Status

I am quoting Fran Lupo from Facebook who found a way to fix twitter-facebook connection. If your twitter is no longer updating your Facebook status, this is a way to fix it. It worked for me.

Fran Lupo
Here is the fix – this is exactly what fixed mine….

The easiest way to fix this is by disconnecting and reconnecting the Facebook application to your Twitter account.

To do this:
1.From the Settings Menu on Twitter, visit the Connections tab.
2.Find the Facebook application and click the Revoke Access link below its name and sign out of Twitter.
3.Log into Facebook and visit your Privacy Settings from the Account drop down menu on the top right
4.At the bottom, click Edit your settings and then Edit settings
5.Find Twitter and click it…then Edit Settings then click Remove app
6.Sign out of Facebook and close all browsers.
7.Delete your history, cookies & temporary internet files. Do NOT perserve favories websites data.
8.Sign back into facebook.
9.Navigate to to install the app anew.
10.After you have done the above steps, make sure theupdate facebook box us NOT checked on the Twitter app page
11.then send a tweet from your twitter page (which won’t appear on FB)
12.then re-check the box on your facebook twitter app page and tweet again from your twitter account…

That should do it!

This is probably the best Time Machine migration How-to guide

I found this guide and I am doing it right now to move my Time Machine backup to Wireless again.

It is actually very straight forward and doesn’t need any third party software. I will report if I have success. This guide is only for Mac OS X 10.6 Snow Leopard though, since it is actually using Finder to copy all the Time Machine backup files, I guess it requires the Cocoa Finder in 10.6, and the 10.5 Carbon Finder just can’t do it.

I am doing this because my USB drive is very noisy. And with the latest Airport Extreme firmware update, it seems now it can do over 5MB/s copying, compared to 3-4MB/s before. I think it is worth a try. But a 500GB USB external hard drive probably is still too small for me. I am thinking of adding incremental back up also for important folders without Time Machine onto the 2TB hard drive I recently got. Macally Firewire 800 External Harddrive enclosure seems pretty solid, except that it has only one Firewire 800 port. Luckily my OWC one has two and they can be connected. The Seagate 2TB drive is a bit noisy when it started spinning, scary.

How to Boot Macbook5,2 into 64-bit kernel in Snow Leopard

1. Download this boot.efi file. This file has been patched to allow basically all capable-but-restricted-by-Apple Macbooks to boot into 64-bit kernel in Snow Leopard. In my case, this enables my Macbook5,2 to do so.

2. From where you saved this file, in terminal, do this:
sudo cp /System/Library/CoreServices/boot.efi ~/Desktop
(this step saves a copy of your original boot.efi to your desktop; unfortunately I lost mine!)

sudo rm /System/Library/CoreServices/boot.efi
NOTE! I did not test this and this is irreversible. Please make sure you made a copy of this file. If you cannot delete it this way, do it in Finder.

sudo cp boot.efi /System/Library/CoreServices/
Copy the patched file to where it should be.

3. cd /System/Library/CoreServices/

4. sudo chown root:wheel boot.efi
This changes the ownership of this file.

5. sudo chflags uchg boot.efi
This locks the file.

6. sudo bless –folder /System/Library/CoreServices/ –file /System/Library/CoreServices/boot.efi

7. One last thing is to add arch=x86_64 to file /Library/Preferences/SystemConfiguration/ to Kernels Flags section
For example:
Kernel Flags

You should be done by now. You may still need to hold “6” and “4” keys when booting. But it should work.

How to hack the boot.efi file comes from here. Basically Apple restricted all non-pro machines from doing so with this file. So that’s why we need to change it. What changed was:

38 47 01 00 00 00 00 00 00 00 00 00 00 00 00 00

38 47 01 00 00 00 00 00 04 00 00 00 00 00 00 00

Additional resources from here.


成都一名市民曾多次提醒司机公交车已冒烟 2009年06月06日02:08 红网-潇湘晨报


  本报记者曾鸣 长沙报道