Skip to content

Instantly share code, notes, and snippets.

🍻
Focusing

icyleaf icyleaf

🍻
Focusing
Block or report user

Report or block icyleaf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@icyleaf
icyleaf / img2vbox.sh
Last active Nov 29, 2019
Convert img file to vbox format
View img2vbox.sh
#!/usr/bin/env bash
#
# icyleaf
# Sep 26, 2019
#
# Tutorial: https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm
#
# Usage:
# ./img2vbox.sh openwrt /path/to/your/openwrt.img
@icyleaf
icyleaf / ar_migrate.rb
Last active Nov 28, 2019
ActiveRecord type of integer (tinyint, smallint, mediumint, int, bigint)
View ar_migrate.rb
# activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb
# Maps logical Rails types to MySQL-specific data types.
def type_to_sql(type, limit = nil, precision = nil, scale = nil)
return super unless type.to_s == 'integer'
case limit
when 1; 'tinyint'
when 2; 'smallint'
when 3; 'mediumint'
when nil, 4, 11; 'int(11)' # compatibility with MySQL default
@icyleaf
icyleaf / cloudSettings
Last active Nov 20, 2019
Visual Studio Code Sync Settings Gist
View cloudSettings
{"lastUpload":"2019-11-20T03:06:14.498Z","extensionVersion":"v3.4.3"}
@icyleaf
icyleaf / README.md
Last active Sep 28, 2019
Cloudflare DDNS 更新脚本 for Openwrt/Lede
View README.md

Cloudflare DDNS 更新脚本 for Openwrt/Lede

依赖

  • ddns-script
  • curl

教程

如果你安装 ddns-script 在添加到供应商看到了 cloudflare 那就不需要本脚本了,如果没有看到那么接着往下看。

@icyleaf
icyleaf / README.md
Last active Aug 27, 2019
群晖服务端口号不完全收集
View README.md

群晖服务端口号

服务 端口号 备注
Web 服务(HTTP) 80 默认值可修改
Web 服务(HTTPS) 5001 默认值可修改
SSH 服务 22 默认值可修改,默认服务关闭
Files 80 随着群晖 Web 服务变动
Video 80 随着群晖 Web 服务变动
Moments 80 随着群晖 Web 服务变动
@icyleaf
icyleaf / list_certificate.sh
Last active Jun 18, 2019
获取 apk 文件证书签名的三种方式
View list_certificate.sh
# 获取 apk 的证书
keytool -list -printcert -jarfile app.apk
# 获取 apk 解包后 CERT.{RSA|DSA} 的证书
keytool -printcert -file app/META-INF/CERT.{RSA|DSA}
# 获取 keystore 的证书
keytool -list -keystore app.keystore -storepass {password}
@icyleaf
icyleaf / post-receive.sh
Created Sep 6, 2010
git autodeploy script when it matches the string "[deploy]"
View post-receive.sh
#!/bin/sh
#
# git autodeploy script when it matches the string "[deploy]"
#
# @author icyleaf <icyleaf.cn@gmail.com>
# @link http://icyleaf.com
# @version 0.1
#
# Usage:
# 1. put this into the post-receive hook file itself below
View Wanyoo-yKeyboard-78-key.kbd.json
[
{
"backcolor": "#222222",
"name": "Wanyoo yKeyboard 78 key",
"author": "icyleaf",
"pcb": false
},
[
{
"c": "#282828",
View ios_dns_lookup.m
#include <netdb.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
+ (NSArray *)loopUpIPAddress:(NSURL *)url {
NSMutableArray *ipAddrs = [[NSMutableArray alloc] init];
char **pptr;
struct hostent *_host = gethostbyname([[url host] UTF8String]);
pptr = _host->h_addr_list;
You can’t perform that action at this time.