相信很多人和我一样,拿到小米路由玩了几天,感觉官方的步伐不够快不够激进。既然如此,何不自己动手丰衣足食呢?
首先你得知道Linux的一些基本理论,比如什么是bash啊,cd、ls这些命令怎么用等等。
其次你还得知道一些编程相关的东西,因为文章专注于Node.js的编译,所以Node.js和C++的一些基本知识是要有的。
| #!/bin/bash | |
| # chkconfig: - 80 12 | |
| # description: Controller for redis-server | |
| # processname: redis | |
| # useage: redis {start|stop|restart} | |
| # notice, you need to edit these 4 variables bellow to suit your condition | |
| BIN="/usr/local/redis/bin/redis-server" |
| QT += core gui concurrent | |
| greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | |
| TARGET = PainterTest | |
| TEMPLATE = app | |
| CONFIG += c++11 | |
| SOURCES += main.cpp\ |
| #include <QCoreApplication> | |
| #include <QFile> | |
| #include <QFileInfo> | |
| #include <QTextStream> | |
| #include <QStringList> | |
| #include <QDebug> | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); |
| #include <iostream> | |
| #include <string> | |
| #include <unordered_map> // need c++11 or c++0x | |
| using namespace std; | |
| unordered_map<string, bool> dict; | |
| unordered_map<string, bool> memo; | |
| inline bool is_in_dict_pri(const string& word) |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| #!/bin/sh | |
| rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
| curl -L https://get.rvm.io | bash -s stable | |
| rvm install 2.0.0 | |
| rvm use 2.0.0@global --default | |
| # for chinese user, if you have a wonderful speed ignore this part | |
| # to have a faster download speed | |
| # switch gem source to ruby.taobao.org |
| wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm | |
| rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt | |
| rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm | |
| rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm | |
| yum --disablerepo=base,updates --enablerepo=rpmforge-extras update git |
| # http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos | |
| cd /etc/yum.repos.d | |
| wget http://people.centos.org/tru/devtools-2/devtools-2.repo | |
| yum --enablerepo=testing-devtools-2-centos-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ | |
| scl enable devtoolset-2 bash |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| ) | |
| func main () { |