Skip to content

Instantly share code, notes, and snippets.

@sonots
sonots / dotfiles.sh
Created December 8, 2012 11:02
Install .dotfiles
#!/bin/sh
[[ -e ~/.dotfiles ]] || git clone git@github.com:sonots/.dotfiles.git ~/.dotfiles
pushd ~/.dotfiles
git submodule init
git submodule update
for i in `ls -a`
do
[ $i = "." ] && continue
@liveaverage
liveaverage / getadsmtp.py
Last active November 16, 2021 16:06
Python alternative to getadsmtp.pl; Runs faster and performs the same AD query for valid SMTP recipients. Credits noted in the comments.
#!/usr/bin/env python
#Credits: Marc Smith, http://marcitland.blogspot.com/2011/02/python-active-directory-linux.html
# DarkPixel, https://github.com/darkpixel/scripts/blob/master/getadsmtp.py
# JR, http://liveaverage.com
import sys, ldap, argparse
import ldap.modlist as modlist
from ldap.controls import SimplePagedResultsControl
@chikuchikugonzalez
chikuchikugonzalez / rubyshell.bat
Created January 15, 2013 15:42
時分の環境でMinGW RubyとActiveRubyとJRubyを切り替えるために作った簡易バッチファイル
@echo off
:: vim: set sts=4 ts=4 sw=4 expandtab:
setlocal ENABLEDELAYEDEXPANSION
set _rubyhome_ruby=E:\Ruby\Ruby1.9
set _rubyhome_ruby18=E:\Ruby\Ruby1.8
set _rubyhome_ruby19=E:\Ruby\Ruby1.9
set _rubyhome_activeruby=E:\Ruby\ActiveRuby1.9
set _rubyhome_activeruby18=E:\Ruby\ActiveRuby1.8
set _rubyhome_activeruby19=E:\Ruby\ActiveRuby1.9
@ck-on
ck-on / ocp.php
Last active March 4, 2026 04:51
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@shtwave
shtwave / gist:5162614
Last active November 10, 2021 07:04
netfilterチューニング
ip_conntrack: table full, dropping packet.
この一行のログに悩まされた方は多いのではないでしょうか。
自分もその一人です。
多くのブログには echo '500000' > /proc/sys/net/ipv4/netfilter/ip_conntrack_max で解決。みたいなことが書いてあると思います。
では、この数字について根拠はなんでしょうか。そもそも何のためにconntrack tableというものがあるのか考えたことはありますか?
闇雲に最大値をあげることにたいして抵抗がある方もいると思います。
このテキストは、転職後2日目にGWとして使っているLinux NAT BOXが爆発したことを起因とした、netfilterのチューニングについてまとめようと思います。
@jpetazzo
jpetazzo / README.md
Last active August 21, 2019 17:55
Give network superpowers to docker

Unionize: network superpowers for your docker containers

Unionize lets you connect together docker containers in arbitrarily complex scenarios.

Note: I recommend to use https://github.com/jpetazzo/pipework instead.

  • pipework is a better name than unionize
  • it's hosted on a "real" github repo instead of a small gist :-)

Now if you want Unionize, it's still here. Just check those examples.

@mikeda
mikeda / analyze_access_log.rb
Last active June 30, 2021 02:44
アクセスログ集計スクリプトのとりあえず版
#!/usr/local/bin/ruby
# アクセスログを1時間ごとに集計。アクセスタイプごとのアクセス数をTSV形式で出力する
# usage : analyze_access_log.rb <YYYYMMDD> <access_log>...
require 'json'
require 'time'
require 'pp'
ANALYZE_DATE = ARGV.shift # YYYYMMDD
@tcnksm
tcnksm / docker_cheat.md
Last active January 14, 2025 15:09 — forked from wsargent/docker_cheat.md
Docker 虎の巻

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@blizzz
blizzz / serverSupportsPagedResults.php
Created October 21, 2014 17:42
Tests whether the server specified by parameters supports Paged Results (RFC 2696)
<?php
if($argc < 4 || $argc === 5) {
print('Usage: php -f ' . $argv[0] . ' HOST PORT BASE [DN] [PWD]' . PHP_EOL);
die;
}
$host = $argv[1];
$port = $argv[2];
$host .= ':' . $port;
$base = $argv[3];
$dn = $argc > 4 ? $argv[4] : '';