Skip to content

Instantly share code, notes, and snippets.

View peterwillcn's full-sized avatar
📡
011010001000100010101010101

open source peterwillcn

📡
011010001000100010101010101
View GitHub Profile
@peterwillcn
peterwillcn / ipv6startupfix
Created May 4, 2016 14:32 — forked from CHEF-KOCH/ipv6startupfix
AFWall+ (and any other iptables firewall IPv6v6 fix at startup)
# This is an startup script example, how IPv6 should
# looks like, if not you will get some seriously
# problems.
# Some options may not work on your OS.
# ICMPv6 Stastics (optional)
# icmpv6_stats
# Optional may not work on all systems
ipset flush dns6
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'
@peterwillcn
peterwillcn / gist:6e1c375ff93ca3f77619
Created March 22, 2016 15:12 — forked from bentonporter/gist:2891463
Ruby - HMAC-SHA256 example
require 'openssl'
require 'Base64'
key = "secret-key"
data = "some data to be signed"
Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), key, data)).strip()
@peterwillcn
peterwillcn / self_signed_cert.rb
Created January 5, 2016 08:37 — forked from nickyp/self_signed_cert.rb
create a self-signed certificate using ruby-openssl
We couldn’t find that file to show.
sudo qemu-kvm -net tap,script=/bin/true -net nic,model=virtio -drive if=virtio,file=openwrt-x86-kvm_guest-combined-ext4.img -sdl

OpenWrt BarrierBreaker 14.07-rc3 手记

1 外置存储 - ExtRoot

1.1 USB HDD 分区

安装依赖和工具包:
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "[email protected]"
@from = "[email protected]"
@subject = "test from the Rails Console"
@body = "This is a test email"
end
end

Implement Routing for Subdomains

Rails 3.0 introduced support for routing constrained by subdomains.

A subdomain can be specified explicitly, like this:

match '/' => 'home#index', :constraints => { :subdomain => 'www' } 

RPI 3.6.11 kernel for home router

Networking support --->
  Networking options --->
    [*] Network packet filtering framework (Netfilter) --->
      Core Netfilter Configuration --->
        <*> Netfilter connection tracking support
        <*>   FTP protocal support