Skip to content

Instantly share code, notes, and snippets.

View dcb9's full-sized avatar

Du, Chengbin dcb9

View GitHub Profile
@ashleyghooper
ashleyghooper / Vagrant_setup,md
Last active March 24, 2025 02:18
Vagrant +Windows + WSL2 + Hyper-v
# Vagrant With Windows, WSL2 and Hyper-V
To say getting this configuration working is a pain in the ass is an understatement. However, once it is working correctly you gain access to tools like Ansible and full performance VMs inside Windows. This guide covers the steps I followed to get things working correctly with this configuration. It is possible that something may not work for you however I have been able to reproduce this success on two Windows 11 Pro machines and expect this to work for others.
This guide assumes basic knowledge of Windows and Linux systems and how Vagrant operates. Due to the difficulty of setting this up you may need to do some additional troubleshooting
## Requirements
* Windows Professional - Hyper-V can only be installed on Windows Professional systems or higher
* WSL2 - Due to the massive differences between WSL1 and WSL2 this guide will only cover support for WSL2
* CPU Virtualization - While the vast majority of modern CPUs support virtualization you may need to enable it in
@fnky
fnky / ANSI.md
Last active April 6, 2025 23:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@spoonincode
spoonincode / eosiobench.md
Last active October 17, 2018 15:45
eosio benchmarking notes with txn_test_gen_plugin

This general procedure was used when doing pre-dawn 3.0 performance testing as mentioned in EOSIO/eos#2078.

Network layout: 2 nodes connected to each other on same box, 1 producer, 1 generator
Hardware: AMD Ryzen at 3.9Ghz
Software: Linux 4.15; eosio compiled with Clang6 -O3
Tested on Apr25 2018 on the DAWN-2018-04-23-ALPHA branch

Make an empty directory for our configs & data, mkdir ~/eos.data, and define a logging.json that doesn't print debug information (which occurs for each txn) to the console

cat << EOF > ~/eos.data/logging.json
@nurrony
nurrony / entrypoint.sh
Created December 24, 2017 13:42 — forked from gabber12/entrypoint.sh
Shell init for docker container with signal handling
# Uncomment to print commands being executed
# set -x
pid=0
# SIGTERM-handler
term_handler() {
echo "Handler INT";
if [ $pid -ne 0 ]; then
kill -SIGTERM "$pid"
wait "$pid"
//simple tool can forward a 'listen:port' to 'forward:port' though a 'socks5://server:port'
//usage socks5-forward listen:port forward:port socksurl
package main
import (
"io"
"log"
"net"
"os"
"net/url"
@lmakarov
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD
@davebarnwell
davebarnwell / brew-dnsmasq.md
Last active March 25, 2025 09:50
install dnsmasq with brew

Install dnsmasq and configure for *.dev.local domains

$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf

Reload configuration and clear cache

# Copy the daemon configuration file into place.
$ sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/

$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 7, 2025 01:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@cornernote
cornernote / README.md
Created June 4, 2015 12:38
How to use PsySH with a Yii2 application

Using PsySH (GitHub) as the Yii2 shell

  • Issue the following commands from the command line in your Yii application directory:
    • chmod +x psyii
    • mkdir extensions/yiishell
    • wget -O extensions/yiishell/psysh psysh.org/psysh
    • chmod +x extensions/yiishell/psysh
  • Copy the file init.php below to psysh/init.php and update any paths to work with your application configuration
  • Copy the file config.php below to psysh/config.php. Change or add to the config array with the options you'd like to use (available options)
  • Now you can start PsySH with the command ./psyii psysh/init.php --config psysh/config.php