Skip to content

Instantly share code, notes, and snippets.

@cyfdecyf
cyfdecyf / tlrecode.sh
Created December 31, 2016 12:42 — forked from NikitaKarnauhov/tlrecode.sh
Shell script to decode and encode TP-LINK router config files
#!/usr/bin/env bash
# tlrecode.sh
# Decode and encode TP-LINK router config files.
#
# Creative Commons CC0 License:
# http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0 with this
# work has waived all copyright and related or neighboring rights to this work.
@cyfdecyf
cyfdecyf / variant.cc
Created November 2, 2016 09:55 — forked from tibordp/variant.cc
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`
@cyfdecyf
cyfdecyf / bdcurl.sh
Created November 9, 2015 17:09 — forked from meoow/bdcurl.sh
百度云命令行(bash)上传下载脚本
#!/bin/bash
# Baidu Yun Command Line Interface
# Depends: bash, curl, grep, awk, sed, od
# (They are basicly builtin tools of any *nix system.)
# Additionally, fastupload depends: head, wc, md5sum or md5, cksum
# (Which are also builtin tools)
#### Variables ####
# If you're looking into the C10M problem (10 million concurrent connections)
# you might want to play with DPDK (Originally proprietry Intel, now open source)
#
# C10M: http://c10m.robertgraham.com/
# DPDK: http://dpdk.org/
#
# This is a quick summary how to install dpdk on ubuntu
# running inside virtualbox on a mac
# On my Mac:
@cyfdecyf
cyfdecyf / gist:2005310
Created March 9, 2012 06:16 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/2005310)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@cyfdecyf
cyfdecyf / migrate.rb
Created December 12, 2011 14:32 — forked from zellux/migrate.rb
Migrate from wordpress to octopress
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'time'
require 'ya2yaml'
require 'nokogiri'
require 'cgi'