Skip to content

Instantly share code, notes, and snippets.

View iguoli's full-sized avatar
🤣
laugh cry

Guo Li iguoli

🤣
laugh cry
View GitHub Profile
@iguoli
iguoli / karabiner_switch_input_source.json
Created November 12, 2019 15:57 — forked from gxfxyz/karabiner_switch_input_source.json
Karabiner-Elements config: switch input source | 输入法切换
{
"title": "Switch input source | 输入法切换",
"rules": [
{
"description": "Tap Command_L (⌘) → Switch input source to English | 短按左 Command (⌘) → 切换到英文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
@iguoli
iguoli / vagrant.md
Created April 9, 2019 02:45
删除vagrant proxy plugin在vm中的所有设置
  1. /etc/environment

  2. /etc/profile.d/proxy.sh

@iguoli
iguoli / list_open_ports.md
Last active January 5, 2019 06:23
查看系统中监听端口列表

MacOS

lsof -Pn -i4 | grep LISTEN

其中,-P表示显示IP而不是hostname, -n表示显示端口号而不是端口对应的程序名。-i用于匹配对应选项的网络地址,-i4表示匹配IPV4相关网络地址。

Linux

@iguoli
iguoli / pipeline_example.md
Created September 17, 2018 02:09
Pipeline Example

Jenkins Pipeline 简介

Jenkins Pipeline (or simply "Pipeline") provides an extensible set of tools for modeling simple-to-complex delivery pipelines "as code". The definition of a Jenkins Pipeline is typically written into a text file (called a Jenkinsfile) which in turn is checked into a project’s source control repository.

Pipeline 定义

  • Declarative Pipeline
  • Scripted Pipeline (a limited form of Groovy)

Both are DSLs to describe portions of your software delivery pipeline.

@iguoli
iguoli / config
Created September 13, 2018 15:19
ssh config file
Host ubuntu
Hostname localhost
Port 2222
User vagrant
IdentityFile ~/vagrant/ubuntu1604/.vagrant/machines/default/virtualbox/private_key
RemoteForward 1080 localhost:1080
@iguoli
iguoli / Jenkinsfile
Created September 13, 2018 11:37 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@iguoli
iguoli / jenkins-pipeline-declarative.groovy
Last active August 26, 2021 23:46
Jenkins pipeline declarative snippets
// vi: ft=groovy
pipeline {
agent any
environment {
manager = 'Jack'
}
stages {
@iguoli
iguoli / pipeline-script.groovy
Last active September 12, 2018 15:55
Pipeline script code snippets
// 使用环境变量及自定义变量
node {
stage('test') {
withEnv(['book=abc, number=123']) {
sh 'env'
book_number = sh(returnStdout: true, script: '''echo ${book}-${number}''')
echo "book number is ${book_number}"
println "book number string length is ${book_number.length()}"
book_number = book_number.trim()
println "book number string length after trim is ${book_number.length()}"
@iguoli
iguoli / vscode-keybindings.json
Last active March 5, 2020 15:01
VSCode user settings
[
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
@iguoli
iguoli / update_gfwlist.sh
Last active August 6, 2018 03:44 — forked from VincentSit/update_gfwlist.sh
Automatically update the PAC for ShadowsocksX. Only tested on OS X. (Deprecated)
#!/bin/bash
# update_gfwlist.sh
# Author : VincentSit
# Copyright (c) http://xuexuefeng.com
#
# Example usage
#
# ./whatever-you-name-this.sh
#
# Task Scheduling (Optional)