Skip to content

Instantly share code, notes, and snippets.

Avatar
🤣
laugh cry

Guo Li iguoli

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

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

@iguoli
iguoli / list_open_ports.md
Last active Jan 5, 2019
查看系统中监听端口列表
View list_open_ports.md

MacOS

lsof -Pn -i4 | grep LISTEN

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

Linux

View pipeline_example.md

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 Sep 13, 2018
ssh config file
View config
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 Sep 13, 2018 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
View Jenkinsfile
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 Aug 26, 2021
Jenkins pipeline declarative snippets
View jenkins-pipeline-declarative.groovy
// vi: ft=groovy
pipeline {
agent any
environment {
manager = 'Jack'
}
stages {
@iguoli
iguoli / pipeline-script.groovy
Last active Sep 12, 2018
Pipeline script code snippets
View pipeline-script.groovy
// 使用环境变量及自定义变量
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 Mar 5, 2020
VSCode user settings
View vscode-keybindings.json
[
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
@iguoli
iguoli / update_gfwlist.sh
Last active Aug 6, 2018 — forked from VincentSit/update_gfwlist.sh
Automatically update the PAC for ShadowsocksX. Only tested on OS X. (Deprecated)
View update_gfwlist.sh
#!/bin/bash
# update_gfwlist.sh
# Author : VincentSit
# Copyright (c) http://xuexuefeng.com
#
# Example usage
#
# ./whatever-you-name-this.sh
#
# Task Scheduling (Optional)