Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

icyleaf icyleaf

🎯
Focusing
View GitHub Profile
View project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
000A6E5618E024720032B816 /* discount_time.png in Resources */ = {isa = PBXBuildFile; fileRef = 000A6E5218E024720032B816 /* discount_time.png */; };
View ibrute.rb
#!/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 = {
View optimize-nat-for-ps4.md

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 / remote.php
Created Mar 31, 2010
HTTP Request/Response Library
View remote.php
<?php
/**
* Provides remote server communications options using [curl][ref-curl].
*
* [ref-curl]: http://php.net/curl
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @link http://icyleaf.com
* @version 0.3.1
* @license http://www.opensource.org/licenses/bsd-license.php
@icyleaf
icyleaf / kohana-3-rest-server-sample.php
Created Apr 23, 2010
RESTful by Kohana v3.0.x + Sprig
View kohana-3-rest-server-sample.php
<?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
img.ly api package for kohana v3
View imgly.php
<?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 Jun 10, 2010
Validate a Chinese ID
View Validate.php
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)
View consumer_key.php
<?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 Jul 5, 2010
Parse HTML entries for allowed tags
View text.php
<?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 Jan 9, 2011
This script is a helper that it will help you download Alpaca and initial structure to current path.
View download_alpaca.sh
#!/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"