Skip to content

Instantly share code, notes, and snippets.

View jhsea3do's full-sized avatar
🤡
I may be slow to respond.

jhsea3do jhsea3do

🤡
I may be slow to respond.
View GitHub Profile
@jhsea3do
jhsea3do / README.md
Created September 29, 2016 17:22
data

README is empty

@jhsea3do
jhsea3do / mysql55_centos6_install.sh
Last active May 24, 2017 03:10
Centos6 MySQL Community 5.5.54
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql -s https://repo.mysql.com/RPM-GPG-KEY-mysql
echo "# Enable to use MySQL 5.5
[mysql56-community]
name=MySQL 5.5 Community Server
baseurl=https://repo.mysql.com/yum/mysql-5.5-community/el/6/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql" > mysql.repo
/**
* docker pipeline sample
*/
def times = 3
def maxSeconds = 3
pipeline {
agent {
def userHome = "/home/jhsea3do";
def volsHome = "${userHome}/clusters/devops/vols";
def projHome = "hello";
def projUser = "1000:1000";
def projLink = "https://github.com/chenfromsz/spring-boot-hello.git"
pipeline {
agent none
/**
* docker pipeline sample
*/
node {
// create volume for root user
sh """
docker volume create ansible-root;
"""
@jhsea3do
jhsea3do / pp
Created August 4, 2018 07:02 — forked from thiagophx/pp
JSON Pretty Print Stream
#!/usr/bin/python -u
import sys, json
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import Terminal256Formatter
while True:
line = sys.stdin.readline()
if line.strip():
@jhsea3do
jhsea3do / docker-helper-18.09.sh
Last active January 11, 2019 12:17
docker binary tar package setup script, support suse, centos
#!/bin/sh
FILE_DIR=${FILE_DIR:-"/tmp/docker"}
LOCL_DIR=${LOCL_DIR:-"/usr/local"}
INST_DIR=${INST_DIR:-"/home/docker"}
INST_GRP=${INST_GRP:-"docker"}
INST_GID=${INST_GID:-"2376"}
INST_VER=${INST_VER:-"18.09.1"}
INST_NET=${INST_NET:-"172.17.0.1/16"}
INST_SILENT=0
function load_cfg {
@jhsea3do
jhsea3do / (bin)init.sh
Created August 6, 2018 00:54
install tencent bkce cluster
#!/bin/sh
# ------------------------------------------------------------------
# [Script] bin/init.sh
# [Author] Hai Ji <shjihai@cn.ibm.com>
# main script
# ------------------------------------------------------------------
PRJ_NAME=bkce
PRJ_PATH=$(realpath "$(dirname $0)/..")
CWD=$(pwd)
# ssh -vvvv $host
# pledge: network
cat /etc/pam.d/postlogin
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
session [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet
session [default=1] pam_lastlog.so nowtmp showfailed
@jhsea3do
jhsea3do / sed-replace-or-append-example
Created August 16, 2018 03:30
sed replace or append example
# https://superuser.com/questions/590630/sed-how-to-replace-line-if-found-or-append-to-end-of-file-if-not-found
sed '/^FOOBAR=/{h;s/=.*/=newvalue/};${x;/^$/{s//FOOBAR=newvalue/;H};x}' infile