Skip to content

Instantly share code, notes, and snippets.

View ferstar's full-sized avatar
🎯
Focusing

J. F. Zhang ferstar

🎯
Focusing
View GitHub Profile
@ferstar
ferstar / opkg list-installed
Created November 6, 2013 14:00
installed packages
base-files - 43.32-r667
block-mount - 0.1.0-2.1
busybox - 1.15.3-3.1
crda - 1.1.1-1
dnsmasq - 2.55-6.1
dropbear - 0.53.1-5
firewall - 2-34.8
hotplug2 - 1.0-beta-3
iptables - 1.4.6-3.1
iptables-mod-conntrack - 1.4.6-3.1
@ferstar
ferstar / client.py
Created May 14, 2015 08:46
simple JSON TCP server and client
#!/usr/bin/env python3
import socket
import json
HOST, PORT = "localhost", 9527
data = {
"name": "hello, I am Tom.",
"age": 10,
"info": "sample is simple."
}
@ferstar
ferstar / Atom_settings.md
Last active August 29, 2015 14:21
Atom编辑器设置

中文显示问题

在atom编辑器的设置--> font family选项中加入文泉驿的字体,比如文泉驿微米黑,然后将你喜欢的字体写在前面,就像这样:

DejaVu Sans Mono, WenQuanYi Micro Hei Mono

这条指令可以查看当前系统下的中文字体: fc-list :lang=zh 输出类似这样

@ferstar
ferstar / ffmpeg.md
Last active August 29, 2015 14:21 — forked from v5tech/ffmpeg.md

视频切片* hls *

ffmpeg -i rtsp://192.168.1.234:8554/hi -f segment -segment_time 10 -segment_format mpegts -segment_list list_file.m3u8 -c copy -bsf:v h264_mp4toannexb -map 0 output_file-%d.ts

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
@ferstar
ferstar / pull_all.sh
Created June 3, 2015 07:45
Clone all remote branches with Git
#!/bin/bash
# from http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git
# usage: sh -x pull_all.sh
# 在你的git目录下执行此脚本即可
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
@ferstar
ferstar / client.py
Created June 3, 2015 10:58
socket chat server & client
# Tcp Chat server
import socket, select
#Function to broadcast chat messages to all connected clients
def broadcast_data (sock, message):
#Do not send the message to master socket and the client who has send us the message
for socket in CONNECTION_LIST:
if socket != server_socket and socket != sock :
try :
@ferstar
ferstar / gist:624777a6222be4776052
Created June 4, 2015 02:11
Something about ROS on Raspberry Pi2.

国外友人做的树莓派ROS镜像:

镜像

linux下随意伸缩img镜像大小的教程:

教程

@ferstar
ferstar / count_times.py
Last active August 29, 2015 14:26
统计差异时间出现次数
#!/usr/bin/env python3
import os
log_path = "/tmp/log"
# 读取log内容
with open(log_path, 'r') as f:
read_data = f.read()
@ferstar
ferstar / flash.sh
Last active September 20, 2015 08:09 — forked from fcicq/flash.sh
u-boot flash for 128k uboot with MAC/WPS info in 0x1fc00/0x1fe00
#!/bin/sh
#high chance need have a change ...
if [ ! $# -eq 2 ]; then
echo "usage: $0 UBOOTFILE MD5"
exit
fi
UBOOT_NAME=$1
MD5SUM_SHOULD_BE=$2
@ferstar
ferstar / bakmysql.sh
Last active January 13, 2016 13:22
scripts about mysql
#!/bin/sh
# Name:bakmysql.sh
# This is a ShellScript For Auto DB Backup and Delete old Backup
#
backupdir=/home/sqlbak
mysql_bin_dir=/usr/bin
time=`date +%Y%m%d`
dbname1=
dbname2=
username=