Skip to content

Instantly share code, notes, and snippets.

@emctoo
emctoo / freebsd.timezone.md
Last active January 7, 2016 08:23
freebsd timezone
@emctoo
emctoo / load.freebsd.zsh
Created January 6, 2016 16:00
load freebsd vm
#!/usr/bin/env zsh
#
vm_name="FreeBSD"
# 默认的helper是/usr/lib/qemu/qemu-bridge-helper
default_helper="/usr/lib/qemu/qemu-bridge-helper"
exec qemu-system-x86_64 -name "$vm_name" \
-enable-kvm -cpu host -m 4G -monitor stdio \
@emctoo
emctoo / wndr3700v4.md
Last active December 30, 2015 11:49
wndr3700v4.bridgedap

wndr3700v4 openwrt 资料

openwrt 官方文档

openwrt bridged ap

linux 刷机

atftp --option "mode octet" --verbose -p -l factory.img 192.168.1.1 链接

wndr370v4 配置

@emctoo
emctoo / kernel.zsh
Created December 25, 2015 07:19
kernel准备脚本
# 使用abs下载内核源码,检查这个版本和当前正在运行的是同一个版本
echo "下载kernel源码 ..."
srcdir=`pwd`
mkdir -p $srcdir/abs
cd $srcdir/abs
ABSROOT=. abs core/linux
@emctoo
emctoo / python.string.md
Created December 21, 2015 03:31
Python 字符串

Python 2/3 字符串

  • Py3 字符串都是unicode
  • 新类型: bytes, bytearray
    • bytes 类似原来的 str, 原来的 str 是 string of character, bytes 是 string of integer between 0 and 255
    • bytearray: mutable, 在需要对bytes进行操作时使用 (python 2.6 就有了)
  • byte literal
@emctoo
emctoo / arch.react.native.android.env.md
Last active December 11, 2015 17:32
archlinux react native android

archlinux 配置 react native for android 环境

  • Android国内源, 东软不错
  • 配置npm源,全局安装位置, $PATH(淘宝源, .npmrc, ~/node_modules)
  • npm install -G react-native-cli
  • react-native init --verbose demo, 家--verbose,不然以为死掉了
  • 运行,参考
  • react-native run-android 会install,但是运行错误
  • 配置ip:port, port=8081
@emctoo
emctoo / arch.react.native.android.env.md
Created December 11, 2015 17:23
Archlinux创建React Native For Android的例子

问题总结

  • react-native init --verbose demo, 家--verbose,不然以为死掉了
  • react-native run-android 会install,但是运行错误
    • 配置ip:port, port=8081
  • react-native start, 启动服务器
@emctoo
emctoo / arch.react.native.android.env.md
Created December 11, 2015 17:20
Archlinux 安装 React Native for Android 环境

问题总结

  • react-native init --verbose demo, 家--verbose,不然以为死掉了
  • react-native run-android 会install,但是运行错误
    • 配置ip:port, port=8081
  • react-native start, 启动服务器
@emctoo
emctoo / synergy.conf
Created April 29, 2015 09:07
synergy.conf
section: screens
elephant:
halfDuplexCapsLock = false
halfDuplexNumLock = false
halfDuplexScrollLock = false
xtestIsXineramaUnaware = false
switchCorners = none +top-left +top-right +bottom-left +bottom-right
switchCornerSize = 0
panda:
halfDuplexCapsLock = false
@emctoo
emctoo / jit.c
Created August 31, 2014 05:17
jit trick in c
// from http://dginasa.blogspot.com/2012/05/jit-compilation-without-much-assembler.html
// gcc -std=gnu99 jit.c -o jit
// still some warnings, need refinement, and put into some bigger works.
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
#define COPY_SECTION(sec_s, sec_e, dest) ({ \