Skip to content

Instantly share code, notes, and snippets.

View kjelly's full-sized avatar

Kuo-tung Kao kjelly

View GitHub Profile
@kjelly
kjelly / restart-container.yaml
Created July 24, 2020 07:54
restart docker container by ansible
- name: restart {{ service }}
hosts:
- "all"
gather_facts: no
tasks:
- name: Collect only facts returned by facter
setup:
filter: "ansible_date_time*"
gather_subset:
- '!all'
@kjelly
kjelly / config.toml
Created June 5, 2020 06:11
configure for procs
[[columns]]
kind = "Pid"
style = "BrightYellow"
numeric_search = true
nonnumeric_search = false
align = "Left"
[[columns]]
kind = "User"
style = "BrightGreen"
[
{kernel, [
{inet_dist_use_interface, {% raw %}{{% endraw %}{{ api_interface_address | regex_replace('\.', ',') }}}},
{net_ticktime, 15},
{inet_dist_listen_min, {{ role_rabbitmq_cluster_port }}},
{inet_dist_listen_max, {{ role_rabbitmq_cluster_port }}}
]},
{rabbit, [
{% if rabbitmq_hipe_compile|bool %}
{hipe_compile, true},
@kjelly
kjelly / a.dart
Created April 21, 2020 14:51
very simple dart
void main1() {
int i = 0;
for (int i = 0; i < 5; i++) {
print(i);
}
print(i);
}
void main2() {
for (int i = 0; i < 5; i++) {
@kjelly
kjelly / Dockerfile
Created March 3, 2020 09:15
Update heat engine microversion
FROM 172.18.1.2:4000/kolla/centos-source-heat-engine:rocky
ADD nova.py /var/lib/kolla/venv/lib/python2.7/site-packages/heat/engine/clients/os/nova.py
@kjelly
kjelly / Dockerfile
Created February 26, 2020 09:30
My dart development env
FROM google/dart
RUN apt-get update && \
apt-get install -y --force-yes git fish vim silversearcher-ag zsh wget tmux && \
apt-get install -y --force-yes libssl-dev libffi-dev curl python2.7-dev sudo man-db build-essential python3-dev&& \
apt-get install -y --force-yes mariadb-client influxdb-client iputils-ping net-tools iproute2 ldap-utils fish git
RUN cp /usr/bin/python3 /usr/bin/python && \
curl https://bootstrap.pypa.io/get-pip.py | python2.7 - && \
curl https://bootstrap.pypa.io/get-pip.py | python3 - && \
Vagrant.configure("2") do |config|
config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key", "~/.ssh/id_rsa"]
config.ssh.insert_key = false
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/me.pub"
config.vm.provision "shell", inline: "cat ~vagrant/.ssh/me.pub >> ~vagrant/.ssh/authorized_keys"
config.vm.provision "shell", path: "bootstrap.sh"
config.disksize.size = '60GB'
config.vm.provider :libvirt do |domain|
domain.nested = true
@kjelly
kjelly / web-server.dart
Created December 30, 2019 13:54
Simple Web Server Sample Code
import 'dart:io';
import 'dart:convert';
import 'package:http_server/http_server.dart';
class Router {
void Function(HttpRequest, List<String>, HttpResponse) noRoute;
Router({this.noRoute = null}) {}
Map<String, void Function(HttpRequest, List<String>, HttpResponse)> handles =
@kjelly
kjelly / gist:c4826f5ceeb60013e4ab68103bb628cc
Last active November 20, 2019 03:19
neutron-meter-agent for kolla-ansible rocky
From a5badc89f2dc1c4b711554a7960c28c1f34dc1b2 Mon Sep 17 00:00:00 2001
From: caoyuan <[email protected]>
Date: Sat, 15 Apr 2017 19:51:16 +0800
Subject: [PATCH] Add neutron metering role into kolla-ansible
Refer to neutron docs [1][2]
[1]: https://docs.openstack.org/neutron/pike/admin/archives/adv-config.html#l3-metering-service-driver
[2]: https://wiki.openstack.org/wiki/Neutron/Metering/Bandwidth
Co-Authored-By: ZhijunWei <[email protected]>
- name: prepare kolla
hosts: "all"
tasks:
- name: copy docker