Skip to content

Instantly share code, notes, and snippets.

View pydevops's full-sized avatar
🏠
Working from home

Victor Yang pydevops

🏠
Working from home
View GitHub Profile
@pydevops
pydevops / yum.md
Last active February 28, 2020 18:04
yum rpm
@pydevops
pydevops / memcached.md
Last active June 12, 2017 17:35
memcached
  • apt-get install libmemcached-tools
  • memcstat --servers=203.0.113.12 11211 | grep get_hits

get version

memcstat --servers=10.2.0.4 | grep version

dump keys

memcdump --servers=localhost

dump value given a key

@pydevops
pydevops / gcp_ca_cert.md
Last active July 14, 2023 14:12
google cloud architect cert prepare
@pydevops
pydevops / makeself-exec.sh
Last active September 6, 2018 16:35 — forked from shturm/makeself-exec.sh
Execute makeself script from anywhere (https://github.com/megastep/makeself)
MAKESELFPATH=/opt/makeself
PAYLOADFOLDER=$(readlink -e $1)
OUTPUTFILENAME=$(pwd)/$2
LABEL=$3
INSTALLER=$(readlink -e $4)
cd $MAKESELFPATH
echo "Executing: sh makeself.sh $PAYLOADFOLDER $OUTPUTFILENAME $LABEL $INSTALLER"
sh makeself.sh $PAYLOADFOLDER $OUTPUTFILENAME $LABEL $INSTALLER
@pydevops
pydevops / lock-funcs.txt
Last active September 8, 2018 17:18
GCS based locking function
#! /usr/bin/env bash
set -u
# constants
PROJECT=$(gcloud info --format='value(config.project)')
LOCKS_BUCKET=$PROJECT-db2-locks
# how long do we wait for lock or condition
SLEEP=5
# Check if a lock file exists
@pydevops
pydevops / ppj.go
Last active December 13, 2022 18:37
pretty print json yaml
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
flatten "github.com/jeremywohl/flatten"