Glide is the easiest way to create useful slide for all of your Gists.
- input key
<-to go backward. - input key
->to go forward.
| package ${packageName}; | |
| import javax.persistence.Column; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.GenerationType; | |
| import javax.persistence.Id; | |
| import javax.persistence.Table; | |
| @Entity |
| #!/bin/sh | |
| set -eu | |
| for i in bin_relay_log commands connections files_tables innodb_bpool innodb_bpool_act innodb_insert_buf innodb_io innodb_io_pend innodb_log innodb_rows innodb_semaphores innodb_tnx myisam_indexes network_traffic qcache qcache_mem replication select_types slow sorts table_locks tmp_tables; do | |
| echo "--- $i ---" | |
| rm -f /etc/munin/plugins/mysql_$i | |
| ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_$i | |
| done |
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Encode; | |
| use Encode::JP::H2Z; | |
| use open ":utf8"; | |
| binmode STDOUT, ":utf8"; | |
| binmode STDIN, ":utf8"; | |
| my $euc = Encode::find_encoding("eucjp"); | |
| sub z2h { my $s = $euc->encode(shift); Encode::JP::H2Z::z2h(\$s); $s = $euc->decode($s); } |
| require 'java' | |
| require 'rubygems' | |
| require 'dbi' | |
| require 'dbd/Jdbc' | |
| require 'jdbc/mysql' | |
| Jdbc::MySQL.load_driver | |
| DBI.connect( | |
| 'DBI:Jdbc:mysql://localhost/test', |
| #!/bin/sh | |
| if [ -d /usr/local/pyenv/bin ]; then | |
| pathmunge /usr/local/pyenv/bin | |
| pathmunge /usr/local/pyenv/shims/ | |
| export PYENV_ROOT=/usr/local/pyenv | |
| fi |
| #!/bin/sh | |
| set -x | |
| export PYENV_ROOT=/usr/local/pyenv | |
| cd /usr/local/ | |
| git clone https://github.com/yyuu/pyenv.git pyenv | |
| cd pyenv/plugins | |
| git clone https://github.com/yyuu/pyenv-virtualenv | |
| _SHELL=$(basename $(echo $SHELL)) |
| import cStringIO | |
| import sys | |
| class IOCapture(object): | |
| def __init__(self, stdout = True, stderr = True): | |
| self.captured_stdout = None | |
| self.captured_stderr = None | |
| if stdout: | |
| self.captured_stdout = cStringIO.StringIO() | |
| if stderr: |
| <servlet> | |
| <servlet-name>jetty</servlet-name> | |
| <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class> | |
| <init-param> | |
| <param-name>aliases</param-name> | |
| <param-value>true</param-value> | |
| </init-param> | |
| <load-on-startup>0</load-on-startup> | |
| </servlet> |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Usage: tail -10000 <access_log> | ./parse-apache-log.py | |
| import os | |
| import re | |
| import sys | |
| class LogParser(object): | |
| LOG_PATTERN = re.compile(r"""^(?P<remote_host>[0-9]{,3}\.[0-9]{,3}\.[0-9]{,3}\.[0-9]{,3}) (?P<ident>[^ ]{1,}) (?P<remote_user>[^ ]{1,}|\-) \[(?P<datetime>[0-9]{2}\/[A-Za-z]{3}\/[0-9]{1,4}:[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [+\-][0-9]{4})\] "(?P<method>[A-Z ]+) (?P<uri>[^"]*) (?P<protocol>[^"]*)" (?P<status>[0-9]{3}) (?P<bytes>[0-9]{1,}|\-) "(?P<referer>[^"]*|\-)" "(?P<user_agent>[^"]+)" (?P<elapsed>[\d]+)$""") |