Skip to content

Instantly share code, notes, and snippets.

ADDR=$(docker inspect $CONTAINER_NAME | perl -ne '/"IPAddress": "([^"]+)"/ && print "$1\n"')
echo "host-record=$CONTAINER_NAME,$ADDR" > /etc/dnsmasq.d/docker-$CONTAINER_NAME
service dnsmasq restart
@henrich
henrich / distro-hacklab.md
Last active August 29, 2015 14:08
distro hacklab の開催アイデア

hacklabとは?

techなイベントなどでセッションを聞くとかではなく、「何か作業したい人が集まって作業する部屋」のことです。

distro-hacklabとは?

そんな「hacklab」の部屋的なイベントを一つ一つは小さなdistro横断で実施してみよう、という試みです。 勉強会で人の話を聞くというよりは、イベントをきっかけに手を動かそう、という感じ。 Debian界隈ではずーっと100回以上も「Debian勉強会」が行われてきましたが、Debianに閉じるよりも他とも交流するとおもしろいよね、ということで他のdistroと経堂でイベント開催をしていけたらいいなーと思いついたのがきっかけです。

@mikkun
mikkun / Fork_bomb.svg
Created November 10, 2014 09:00
SVG file for printing "Fork bomb" stickers. This file is under the public domain.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nekoruri
nekoruri / docker_memo.md
Last active August 29, 2015 14:10
Dockerに関するメモ
@kamipo
kamipo / server_id
Created February 11, 2015 04:07
MySQLとか(Tokyo|Kyoto)ナントカのserver_idを計算するために使ってたコマンド
#!/usr/bin/perl -l
use strict;
use warnings;
$ENV{LANG} = "C";
$ENV{PATH} ||= "/usr/local/bin:/usr/bin/:/bin";
my $eth = shift || "eth0";
`ip addr list dev $eth|grep 'inet '` =~ m{\.(\d+?)\.(\d+?)\/};
#!/bin/bash
unset tmpfile
trap "[ -f $tmpfile ] && rm -f $tmpfile" 1 2 3 15
tmpfile=$(mktemp 2>/dev/null||mktemp -t tmp)
if [ "$#" -eq 0 ]; then
cat > $tmpfile
vim -c 'silent! normal! ggVG=ZZ' $tmpfile 2> /dev/null
else
@achillean
achillean / ssh-fingerprints.csv
Created February 17, 2015 20:11
Top 1,000 Duplicate SSH Fingerprints on the Internet
dc:14:de:8e:d7:c1:15:43:23:82:25:81:d2:59:e8:c0 245272
32:f9:38:a2:39:d0:c5:f5:ba:bd:b7:75:2b:00:f6:ab 197846
d0:db:8a:cb:74:c8:37:e4:9e:71:fc:7a:eb:d6:40:81 152046
34:47:0f:e9:1a:c2:eb:56:eb:cc:58:59:3a:02:80:b6 140777
df:17:d6:57:7a:37:00:7a:87:5e:4e:ed:2f:a3:d5:dd 91904
81:96:a6:8c:3a:75:f3:be:84:5e:cc:99:a7:ab:3e:d9 80499
7c:a8:25:21:13:a2:eb:00:a6:c1:76:ca:6b:48:6e:bf 78172
1c:1e:29:43:d2:0c:c1:75:40:05:30:03:d4:02:d7:9b 71851
8b:75:88:08:41:78:11:5b:49:68:11:42:64:12:6d:49 70786
c2:77:c8:c5:72:17:e2:5b:4f:a2:4e:e3:04:0c:35:c9 68654
digraph autoconf_automake {
graph [ fontname = "Helvetica" fontsize = 12 ]
node [ fontname = "Helvetica" fontsize = 12 shape = "box"
style=filled fillcolor=palegreen
]
edge [ fontname = "Helvetica" fontsize = 12 ]
aclocal_m4 [label="aclocal.m4"]
config_h_in [label="config.h.in"]
config_h [label="config.h"]
@kamipo
kamipo / gist:61ee662ee0b1127f0989
Last active August 28, 2018 01:51
MySQL Unicode Collation Behavior

MySQL Unicode character set has following collations mainly:

  • xxx_bin: compare all characters by these code point as weight.
  • xxx_general_ci: compare almost characters by these code point as weight.
  • xxx_unicode_ci: compare all characters by these collating weight.

ref. http://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html

When xxx is utf8, can treat only BMP characters.

mysql> show processlist;
+----+------+-----------+-------+---------+------+-------------------------+-----------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+-------+---------+------+-------------------------+-----------------------------+
| 2 | root | localhost | mysql | Query | 0 | starting | show processlist |
| 3 | root | localhost | NULL | Query | 13 | Waiting for table flush | FLUSH TABLES WITH READ LOCK |
| 4 | root | localhost | mysql | Query | 4 | Waiting for table flush | SELECT * FROM user |
+----+------+-----------+-------+---------+------+-------------------------+-----------------------------+
3 rows in set (0.00 sec)