Skip to content

Instantly share code, notes, and snippets.

View icyleaf's full-sized avatar
🍺
Diving into beer

icyleaf icyleaf

🍺
Diving into beer
View GitHub Profile
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
000A6E5618E024720032B816 /* discount_time.png in Resources */ = {isa = PBXBuildFile; fileRef = 000A6E5218E024720032B816 /* discount_time.png */; };
#!/usr/bin/env ruby
require 'plist'
require 'rest_client'
def try_pass(apple_id, password)
url = "https://fmipmobile.icloud.com/fmipservice/device/#{apple_id}/initClient"
basicOauth = Base64.encode64("#{apple_id}:#{password}")
headers = {

PS4 网络环境优化

0 案例环境

  • 中国电信 100M 宽带接入,局域网段 192.168.1/24,光猫拥有管理员权限(后继需要);
  • NetGear WNDR3700v2 跑 OpenWRT 作为家庭主路由器, WAN IP 192.168.1.234,局域网段 10.10.10/24
  • PS4 无线连家庭网络(主),IP 10.10.10.3;有线连光猫(备),IP 192.168.1.3
@icyleaf
icyleaf / kohana-3-rest-server-sample.php
Created April 23, 2010 07:40
RESTful by Kohana v3.0.x + Sprig
<?php defined('SYSPATH') or die('No direct script access.');
/**
* People API - Example Code
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @link http://icyleaf.com
* @version 0.1
*/
class Controller_API_People extends Controller_REST {
@icyleaf
icyleaf / imgly.php
Created May 6, 2010 03:44
img.ly api package for kohana v3
<?php
/**
* img.ly class for Kohana v3.0.x
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @link http://icyleaf.com
* @version 0.1
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class imgly {
@icyleaf
icyleaf / Validate.php
Created June 10, 2010 08:26
Validate a Chinese ID
class Validate {
/**
* Validate a Chinese ID (18 digit ONLY).
* @param int ID
* @return boolean
*/
public static function chinese_id($id)
{
$id_length = strlen($id);
if ($id_length == 18)
@icyleaf
icyleaf / consumer_key.php
Created June 18, 2010 07:26
consumer_key
<?php
function new_consumer_key()
{
// in case /dev/urandom is reusing entropy from its pool, let's add a bit more entropy
$entropy = uniqid(mt_rand(), true);
$hash = sha1($entropy); // sha1 gives us a 40-byte hash
// The first 30 bytes should be plenty for the consumer_key
// We use the last 10 for the shared secret
return array(
@icyleaf
icyleaf / text.php
Created July 5, 2010 10:41
Parse HTML entries for allowed tags
<?php
/**
* Parse HTML entries for allowed tags
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @version 0.1
*/
class Text extends Kohana_Text{
//don't parse anything in these tags
public static $literals = array('code', 'pre');
@icyleaf
icyleaf / download_alpaca.sh
Created January 9, 2011 03:24
This script is a helper that it will help you download Alpaca and initial structure to current path.
#!/bin/bash
#
# This script is a helper that it will help you download Alpaca and initial structure to current path.
# To install elsewhere you can just clone https://github.com/icyleaf/alpaca anywhere you like.
#
# AUTHOR icyleaf <icyleaf.cn@gmail.com>
# VERSION 0.1
#
echo "Clone the alpaca project from Github"
@icyleaf
icyleaf / icyleaf.zsh-theme
Last active September 26, 2015 01:18
icyleaf.zsh-theme
PROMPT=$'$(virtualenv_prompt_info)%{$fg_bold[green]%}%n@%m %{$fg[blue]%}[%~]%{$reset_color%} $(git_prompt_info)\
%{$fg[blue]%}%B$%b%{$fg_bold[white]%}%{$fg[white]%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""