Skip to content

Instantly share code, notes, and snippets.

View zz's full-sized avatar
💭
I may be slow to respond.

ZZ zz

💭
I may be slow to respond.
  • Japan
View GitHub Profile
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# (C)2010 Owen Carter @ Mirabeau BV
# This script is provided as-is; no liability can be accepted for use.
# You are free to modify and reproduce so long as this attribution is preserved.
#
# (C)2013 Benoît LELEVÉ @ Exsellium (www.exsellium.com)
# Adding parameters in order to execute the script in a multiple MySQL instances environment
@zz
zz / gist:ef3002776d1f8075eab0
Created February 18, 2016 16:33
fish config
#.config/fish/functions/ssh.fish
function __handler_ssh_exit --on-process %self
tabcolor
end
function ssh
tabcolor 0 255 0
command ssh $argv
__handler_ssh_exit
end
@zz
zz / steps.txt
Created February 18, 2016 13:56 — forked from bjeavons/steps.txt
steps for changing term background color on any SSH
/*
* How to change background iTerm color on SSH when using fish shell
*/
// Put this in a file, replace RGB color with your current bgcolor. ex: original-bgcolor
tell application "iTerm"
tell the current terminal
tell the current session
set background color to {0,0,0}
end tell
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&amp;staging
@zz
zz / gist:9b4f1258cf08c7839739
Created September 23, 2015 15:24 — forked from kylefinley/gist:1025736
AppEngine ndb Threaded Messaging.
import cgi
from google.appengine.api import mail
from google.appengine.ext import deferred
from ndb import model
from tipfy.routing import url_for
from tipfyext.ndb.mixins import DateMixin
@zz
zz / get_max_version.sql
Last active September 22, 2015 05:57
how to get max version in SQL
/**
MariaDB [temp]> select * from file;
+------+---------+
| id | version |
+------+---------+
| 1 | 10 |
| 1 | 11 |
| 1 | 12 |
| 2 | 10 |
| 2 | 11 |
@zz
zz / app.py
Last active September 19, 2015 15:05 — forked from maccman/app.py
Stripe Flask Example
import os
from flask import Flask, render_template, request
import stripe
stripe_keys = {
'secret_key': os.environ['SECRET_KEY'],
'publishable_key': os.environ['PUBLISHABLE_KEY']
}
stripe.api_key = stripe_keys['secret_key']
@zz
zz / my_configs.vim
Created September 13, 2015 04:30
vim custom settings
"" settings
let g:airline_powerline_fonts = 1
if has("gui_running")
let s:uname = system("uname")
if s:uname == "Darwin\n"
set guifont=Monaco\ for\ Powerline:h12
endif
endif
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES