相信很多人和我一样,拿到小米路由玩了几天,感觉官方的步伐不够快不够激进。既然如此,何不自己动手丰衣足食呢?
首先你得知道Linux的一些基本理论,比如什么是bash
啊,cd
、ls
这些命令怎么用等等。
其次你还得知道一些编程相关的东西,因为文章专注于Node.js的编译,所以Node.js和C++的一些基本知识是要有的。
function sort(a, b) { | |
for (var i = 0; i < a.length; i++) { | |
if (a[i] === b[i]) { | |
continue; | |
} | |
return isABeforeB(a[i], b[i]) ? 1 : -1; | |
} | |
} |
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"path/filepath" | |
) | |
func main () { |
# 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 |
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 |
#!/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 |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#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) |
#include <QCoreApplication> | |
#include <QFile> | |
#include <QFileInfo> | |
#include <QTextStream> | |
#include <QStringList> | |
#include <QDebug> | |
int main(int argc, char *argv[]) | |
{ | |
QCoreApplication a(argc, argv); |
QT += core gui concurrent | |
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | |
TARGET = PainterTest | |
TEMPLATE = app | |
CONFIG += c++11 | |
SOURCES += main.cpp\ |