Skip to content

Instantly share code, notes, and snippets.

View phoenixg's full-sized avatar
😘
Fall in love

Phx phoenixg

😘
Fall in love
  • Shanghai, China
View GitHub Profile
@phoenixg
phoenixg / raspi.20131202-20131203
Last active December 30, 2015 03:29
树莓派定时拍摄一天的固定场景
raspistill -o photo%04d.jpg -w 800 -h 600 -q 10 -t 99999999 -tl 600000 &
raspistill -o photo%04d.jpg -q 100 -t 99999999 -tl 600000 &
# 照片见微云
total 6.7M
drwxr-xr-x 2 pi pi 4.0K Dec 3 19:50 .
drwxr-xr-x 7 pi pi 4.0K Dec 3 19:56 ..
-rw-r--r-- 1 pi pi 44K Dec 2 21:39 photo0001.jpg
-rw-r--r-- 1 pi pi 44K Dec 2 21:49 photo0002.jpg
@phoenixg
phoenixg / rss.generate.php
Created December 6, 2013 10:17
generate-xml-rss-feed-with-php
<?php
// http://www.9lessons.info/2009/03/generate-xml-rss-feed-with-php.html
$items = array(
array('title' => 'aaa', 'link' => 'www.google.com', 'description' => 'aaaaaaaaaaa'),
array('title' => 'bbb', 'link' => 'www.yahoo.com', 'description' => 'bbbbbbbbbbb'),
);
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>
// 最新HOSTS法去除优酷、爱奇艺等视频网站广告 http://www.oschina.net/code/snippet_1262919_27114
#优酷
127.0.0.1 atm.youku.com
127.0.0.1 Fvid.atm.youku.com
127.0.0.1 html.atm.youku.com
127.0.0.1 valb.atm.youku.com
127.0.0.1 valf.atm.youku.com
127.0.0.1 valo.atm.youku.com
@phoenixg
phoenixg / asplashscreen.sh
Created December 19, 2013 14:52
raspberry pi splash booting video shell script: https://dl.dropboxusercontent.com/u/106074492/asplashscreen
#! /bin/sh
### BEGIN INIT INFO
# Provides: asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description: Show custom splashscreen
#!/usr/bin/python
#-----------------------------------
# Send SMS Text Message
#
# Author : Matt Hawkins
# Site : http://www.raspberrypi-spy.co.uk/
# Date : 30/08/2012
#
# Requires account with TxtLocal
# http://www.txtlocal.co.uk/?tlrx=114032
@phoenixg
phoenixg / youku.address.sniffer.php
Created January 29, 2014 05:05
优酷视频地址嗅探脚本
<?php
// 引用自:http://www.oschina.net/code/snippet_616067_22723?p=2#comments
// 调用方法http://../flv.php?url=http://v.youku.com/v_show/id_XMzg2OTQ3MjQw.html
// 似乎只支持低清晰度的视频地址
echo fetch_youku_flv($_GET['url']);
function fetch_youku_flv($url){
preg_match("#id_(.*?)\.html#",$url,$out);
$id=$out[1];
$content=get_curl_contents('http://v.youku.com/player/getPlayList/VideoIDS/'.$id);
$data=json_decode($content);
@phoenixg
phoenixg / noip.sh
Created February 3, 2014 16:03
树莓派设置动态DNS(使用noip服务)Raspberry Pi Beginner : Dynamic DNS
#! /bin/sh
# /etc/init.d/noip
### BEGIN INIT INFO
# Provides: noip
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
FROM ubuntu
RUN sudo echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN sudo apt-get update
RUN sudo apt-get install -y Dialog
RUN sudo apt-get install -y wget
RUN sudo apt-get install -y vim
RUN sudo apt-get install -y git
RUN sudo apt-get install -y gcc
RUN sudo apt-get install -y make
#!/bin/bash
# tested successfully on digitalocean Ubuntu 12.40 with docker version
# after run this script, then wget youtube-dl.support1080p.sh gist, then 1080p download is working
sudo apt-get -y install vim
sudo apt-get -y install git
sudo apt-get -y install gcc
sudo apt-get -y install make
sudo apt-get -y install yasm
wget http://kakola.googlecode.com/files/lame-3.98.4.tar.gz
tar zvxf lame-3.98.4.tar.gz