Skip to content

Instantly share code, notes, and snippets.

View gaieges's full-sized avatar

Evin Callahan gaieges

View GitHub Profile
@gaieges
gaieges / .bash_profile
Created September 12, 2015 19:14
great PS1 var with return value coloring
PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u@\h:\`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
PS1='\[\033[0;33m\][\!]`if [[ $? = 0 ]]; then echo \[\033[32m\]; else echo \[\033[31m\]; fi`[\u@\h:`if [[ 30 > 18 ]]; then echo \W; else echo \w; fi`]$\[\033[0m\] '
"webinstances": {
"changed": true,
"msg": "All items completed",
"results": [
{
"_ansible_no_log": false,
"changed": true,
"instance_ids": [
"i-039"
],
mydumper -H HOST -u USER -p PASS -B DBNAME -o /tmp/mysqldump  -r 100000000 -c -C -t 4
myloader -o -B db1 -h HOST -u USER -p PASS -C -d /tmp/mysqldump

Usage:
  mydumper [OPTION...] multi-threaded MySQL dumping

Keybase proof

I hereby claim:

  • I am gaieges on github.
  • I am gaieges (https://keybase.io/gaieges) on keybase.
  • I have a public key whose fingerprint is 4192 5398 F6E0 275B F1FE 879F 40DC C1EF D1A5 B6B4

To claim this, I am signing this object:

@gaieges
gaieges / subtree.sh
Created April 5, 2017 21:57
easier way to use subtrees
#!/bin/bash
set -e
REPOS="$(cat $(dirname $0)/.subtree)"
usage() {
echo "usage: $(basename $0) <command>"
echo "commands are: "
echo " init sets up all remotes and subtrees locally"
@gaieges
gaieges / .bash_profile
Created August 1, 2017 15:36
bash-git-prompt
# need brew package 'bash-git-prompt' for this to work
# brew install bash-git-prompt
# this is just my custom colorization, they have themes available too if you look at the git repo:
# https://github.com/magicmonty/bash-git-prompt
GIT_PROMPT_START="\[\033[0;33m\][\D{%m-%d} \t \!] \`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u@\h:\`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\[\033[0m\]"; echo -ne "\033]0;`hostname -s`:`pwd`\007"
GIT_PROMPT_END="\n\$ "
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
@gaieges
gaieges / kubernetes-the-hard-way.md
Last active August 12, 2023 12:58
Kubernetes the hardway, concatenated for reading on offline ipad. Copyright kelseyhightower: https://github.com/kelseyhightower/kubernetes-the-hard-way

Kubernetes the hard way © Kelsey Hightower

Prerequisites

Google Cloud Platform

This tutorial leverages the Google Cloud Platform to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. Sign up for $300 in free credits.

Estimated cost to run this tutorial: $0.22 per hour ($5.39 per day).

@gaieges
gaieges / jenkins-dump.md
Last active February 12, 2018 23:41
Jenkins master hanging - thread dump
 2018-02-12 23:40:19
Full thread dump OpenJDK 64-Bit Server VM (25.151-b12 mixed mode):

"RequestHandlerThread[#78]" #2068 daemon prio=5 os_prio=0 tid=0x000055b6e7f07800 nid=0x2b06 runnable [0x00007fc10cb2b000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000000837ded48> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)
@gaieges
gaieges / jenkins-dump-whoami.md
Created February 12, 2018 22:56
Jenkins whoami thread dump hanging issue
2018-02-12 22:55:56
Full thread dump OpenJDK 64-Bit Server VM (25.151-b12 mixed mode):

"RequestHandlerThread[#54]" #914 daemon prio=5 os_prio=0 tid=0x000055b6e7a49000 nid=0x197a runnable [0x00007fc10e66a000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
$ docker run -i --rm -v $(pwd):/app -w /app stoplight/prism conduct -e host=https://my.host.com -e token=$TOKEN scenario.yml
Prism version is 2.0.5
[Conductor] Stoplight Exporter Host is https://exporter.stoplight.io
[Conductor] Stoplight API Host is https://next-api.stoplight.io
different scenario Scenario (0.005s)
check if vars work in different scenario, (0.005s)
before.script.info ⁃
before.script.info ⁃