Enabling SSH on ASUS RT-N56U Router

Categories: Development NotesLinux; Tagged with: ; @ May 15th, 2016 15:36

the default firmware doesn’t provide the SSH feature, however, with the help of padavan‘s rt-n56u project, you may enable it:

This project aims to improve the rt-n56u and other supported devices on the software part, allowing power user to take full control over their hardware. This project was created in hope to be useful, but comes without warranty or support. Installing it will probably void your warranty. Contributors of this project are not responsible for what happens next.

How do I get set up?

What I did:

  1. download RT-N56U_3.4.3.9-099_base.trx
  2. login to the router setting dashboard, and upgrade the firmware by selecting the downloaded file.
  3. after couple minutes,  my router reset, I connect to the router via cable, and setup wifi. (you may try ‘1234567890’ to connect to your wifi network if you cannot connect to it directly)
  4. login to the router setting dashboard, you’ll find a new UI! navigate to: Advanced Settings > Administration > Services to setup your ssh server.  more details: https://bitbucket.org/padavan/rt-n56u/wiki/EN/CommonTips

程序员的数学 读书笔记

Categories: Development Notes; Tagged with: ; @ May 1st, 2016 17:57

我相信多数人看到这本书之后可能都会轻轻一笑,这太简单了。可对我来说,大多数概念都已经变的很陌生, 粗略读了一遍,顺便复习曾经熟悉的那些数学基础。

零,二进制,十进制,指数

  • 十进制/二进制转换
  • 十进制/罗马数字转换
  • 指数: N^a X N^b = N ^(a+b)
  • 给定一个十进制数字,如何检查该数字是不是2的平方?O(log n) ? O(1)?
  • Counting Bits

余数, 周期性, 分组

排列组合

三种药品,A, B, C 共取100粒,每种至少一粒,不考虑顺序,共有多少种组合方式?

递归

指数

  • 一张厚度为1 mm纸只需要对折39次就可以达到39万公里 -地球与月球之间的距离
  • Binary search algorithm

 

 

How to reset MySQL root password

Categories: Database; Tagged with: ; @ May 1st, 2016 15:27

I lost root’s password, again.

stop MySQL

we need to stop mysql and start it in safe mode.  I tried many ways to kill mysql, but only this works for my Ubuntu 14.04:

root@myhost:/usr/bin# initctl --system stop mysql

start MySQL in safe mode, set new password for root

sudo mysqld_safe --skip-grant-tables &
mysql -uroot
use mysql;
update user set password=PASSWORD("new_password") where User='root';
flush privileges;
quit
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

you may try to login using the new password now:

mysql -u root -p

store/update MySQL password in ~/.my.cnf

if you’re using a password file, remember to update it.

[client]
user=root 
password=new_password

useful links
http://stackoverflow.com/questions/18733944/ubuntu-cant-stop-mysqld
https://www.digitalocean.com/community/questions/setup-mysql-on-ubuntu-droplet-getting-error-error-1045-28000-access-denied-for-user-root-localhost-using-password-yes

Python: multiprocessing forking.py assertionError

Categories: Development NotesPython; Tagged with: ; @ March 22nd, 2016 23:32

Issue:  There’s an AssertionError when I try to test  mutliprocessing features using lettuce 0.2.22 / nosetests and python 2.7.10 error details:

multiprocessing\forking.py AssertionError: main
File "", line 1, in 
File "C:\Python27\Lib\multiprocessing\forking.py", line 380, in main
  prepare(preparation_data)
  File "C:\Python27\Lib\multiprocessing\forking.py", line 488, in prepare
    assert main_name not in sys.modules, main_name
AssertionError: __main__

upgrade to python 2.7.11 becuase this is a fixed bug: https://bugs.python.org/issue10128; or
use a wrapper (.py file name should be not in sys.modules, main_name):

# run_at.py:
__requires__ = 'lettuce==0.2.20'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('lettuce==0.2.20', 'console_scripts', 'lettuce')()
    )

它会长成一棵树

Categories: 垃圾山 February 27th, 2016 16:42

家里的那条老狗没能熬过这个冬天,在腊月里走了。
连个名字都没有,在一个西北风刮的正紧的冬天,它结束了接近十年的生命。 父亲说他把狗埋在了河边,明年再去栽一棵树。
我希望它熬过这个冬,在开春时变成一棵树,独自长大,坚强的站在地上,村里的人,河里的鱼,都跟它没有关系,它只管站在那里,不管是凌厉的西北风还是湿软的东南风,它只管站在那里,别的球事,它一盖不管。

它是一条纯真的中华田园犬,母的,终生大部分时间都在院子里,它跟城里的宠物狗一样,是重要的家庭成员。不过它不需要陪主人娱乐,它只负责在遇到陌生人的时候旺旺几声, 终其一生。

它是在我读大学的时候来到家里的,那时候我几乎跟它一样不懂事。它开始慢慢的长大,它开始习惯项链,习惯有限的活动范围,我跟它不一样,我努力的挣脱自己假想的枷锁,后来我走的越来越远,回家越来越少。可是它并没有忘记我,即使我一年最多回家两次。它一生中接纳的人很少,即使是常来家里的的叔叔大爷,它也不会把他们归类到家人里。 它会象征性的叫几声,好让家人知道有人来了。 如果是碰到陌生人,它会叫的更加响亮而急促,如果是墙头上跳下来的猫,它大概只会叫唤一两声,它是一条尽职尽责的狗。

它活着的时候,我曾不止一次的当着它面说它很笨。 因为我扔给它食物的时候,它每次都接不到,有时候还得找半天, 这让我不禁想起来‘另一条狗’。 后来我想,这大概是我的责任,而不是狗的。 在它小时候,我没陪它玩,没有带着它跑来跳去,它小时候,我在很远的地方,不知道忙些什么。当着它面说它笨,它一定很心酸吧。 而且那时候它已经是个大姑娘了。 记得有段时间门外总有呜呜叫的公狗,饥渴的在外面上窜下跳,不知道它会不会心花怒放?想到这里我觉得狗跟人也并没有很大差别。

过年的时候我跟父母说,再养一条狗吧,在农村,狗比监控好使。前几天母亲发给我一张小狗的照片,我想它应该是我家的新成员, 一条憨态可掬的正宗土狗。在未来的十年里,它将肩负起消灭剩饭,看家护院的职责,任重而道远。 再过十年,我的父母就要七十多岁了,一想到这里,我的心里就刮起了北风,冷飕飕的。我希望春天快点到来,春暖花开,鸡飞狗跳。

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.