Skip to content

Instantly share code, notes, and snippets.

View jeffrey4l's full-sized avatar
🎯
Focusing

Jeffrey Zhang jeffrey4l

🎯
Focusing
View GitHub Profile
#!/bin/bash
set -x
export ACK_ATTACH_START_TIME=$(date +%s)
export ACK_ATTACH_START_MONOTONIC_TIME=$(cat /proc/uptime|awk '{print $1}')
# 和灵骏约定俗成好的文件
# aone:https://aone.alibaba-inc.com/v2/project/1174072/req#viewIdentifier=d7f112f9d023e2108fa1b0d8&openWorkitemIdentifier=51816276
export LINGJUN_CONFIG="/etc/eflo_config/lingjun_config"
#!/bin/bash
#==============请修改flavor image_id net_id availab_zone vm_name为环境对应参数===============================
flavor_id=2u2g
image_id=bdf6c505-f208-43cc-b85f-e19bbca05b1a
net_id=9978dfe6-9e7f-4746-83d7-242de771f4e3
availab_zone=az1.dc1
vm_name=test_poc_150vm
#================以下不可更改====================================================================
@jeffrey4l
jeffrey4l / ssh-remove
Created March 8, 2023 01:49
remove ssh keys from ssh-agent
#!/bin/bash
paste -d, <(ssh-add -L) <(ssh-add -l) | \
fzf --cycle --preview 'echo {} | cut -d, -f1' \
--preview-window down:wrap --delimiter , \
--with-nth 2 --header='[ssh-agent:remove]' | \
cut -d, -f1 | ssh-add -d -
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Authors: Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Mark Evans, <evansmp@uhura.aston.ac.uk>
@jeffrey4l
jeffrey4l / grafana-improve.user.js
Last active September 1, 2021 01:32
grafana-improve.user.js
// ==UserScript==
// @name Grafana Improve
// @namespace https://xcodest.me/
// @version 0.4.3
// @description Better grafana view
// @author Jeffrey4l
// @match *://localhost:3000/*
// @icon https://grafana.com/static/assets/img/fav32.png
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// ==UserScript==
// @name Jeffrey4l Enhance
// @namespace https://gist.github.com/jeffrey4l/aa9cdae0453cdfd0891c06e6f0303c40/raw/Jeffrey4l-enhance.user.js
// @version 0.5.3
// @description try to take over the world!
// @author Jeffrey4l
// @homepage https://gist.github.com/jeffrey4l/aa9cdae0453cdfd0891c06e6f0303c40/
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
@jeffrey4l
jeffrey4l / README-python-service-on-systemd-activated-socket.md
Created December 18, 2019 07:54 — forked from kylemanna/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.

#!/usr/bin/env python
import shade
import collections
import prettytable
cloud = shade.openstack_cloud()
projects = cloud.list_projects()
project_mapping = {}
@jeffrey4l
jeffrey4l / vimrc
Last active January 30, 2019 02:34
Basic vim configuration
" Usage
" curl -L https://gist.github.com/jeffrey4l/e072731d8c42ade7b0e362dd7cf35ba3/raw/ -o ~/.vimrc
" Basic
set nocompatible
" Indentation & Tabs
set autoindent
set cindent
set smartindent
@jeffrey4l
jeffrey4l / grub.cfg
Created May 31, 2018 16:41 — forked from Pysis868/grub.cfg
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub/grub.cfg
# or
# /boot/grub2/grub.cfg
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
# Suggested Entries and the suggestor, if available, will also be noted.
# and then improved by Pysis.