Skip to content

Instantly share code, notes, and snippets.

Chuck YU chuckyukai

Block or report user

Report or block chuckyukai

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
@chuckyukai
chuckyukai / gist:8d17675e1b15e0cee3c4947b47561f14
Created Oct 16, 2018 — forked from RiANOl/gist:1077760
AES128 / AES256 CBC with PKCS7Padding in Ruby
View gist:8d17675e1b15e0cee3c4947b47561f14
require "openssl"
require "digest"
def aes128_cbc_encrypt(key, data, iv)
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize)
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize)
aes = OpenSSL::Cipher.new('AES-128-CBC')
aes.encrypt
aes.key = key
aes.iv = iv
View l2tp.sh
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=======================================================================#
# System Supported: CentOS 6+ / Debian 7+ / Ubuntu 12+ #
# Description: L2TP VPN Auto Installer #
# Author: Teddysun <i@teddysun.com> #
# Intro: https://teddysun.com/448.html #
#=======================================================================#
cur_dir=`pwd`
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
You can’t perform that action at this time.