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
ME=$(basename $0)
function ask {
read -p "Are you sure? [Y/n]" -n 1 -r
if [[ -z $REPLY ]] || [[ $REPLY =~ ^[Yy]$ ]]; then
echo "You sure."
else
exit 2
class OverrideConfigParser(configparser.RawConfigParser):
def _read(self, fp, fpname):
"""Parse a sectioned setup file.
The sections in setup file contains a title line at the top,
indicated by a name in square brackets (`[]'), plus key/value
options lines, indicated by `name: value' format lines.
Continuations are represented by an embedded newline then
leading whitespace. Blank lines, lines beginning with a '#',
@jeffrey4l
jeffrey4l / globals.yml
Created February 23, 2017 05:54
kolla+ceph+keystone+ceph_rgw
---
# You can use this file to override _any_ variable throughout Kolla.
# Additional options can be found in the 'kolla/ansible/group_vars/all.yml' file.
# Default value of all the commented parameters are shown here, To override
# the default value uncomment the parameter and change its value.
###################
# Kolla options
###################
# Valid options are [ COPY_ONCE, COPY_ALWAYS ]

ksm memcache pool have some issue when enabled memcache_use_advanced_pool

[keystone_authtoken]
memcache_use_advanced_pool = true

This patch is used for OpenStack Ocata branches

How to use:

docker ps -q | xargs -i ./aplly_patch.sh {} keystonemiddleware.patch

@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.
@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
#!/usr/bin/env python
import shade
import collections
import prettytable
cloud = shade.openstack_cloud()
projects = cloud.list_projects()
project_mapping = {}
@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.

// ==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 / grafana-improve.user.js
Last active November 26, 2025 23:48
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