Skip to content

Instantly share code, notes, and snippets.

🙆
LGTM

Shin'ya Ueoka ueokande

Block or report user

Report or block ueokande

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:80bc25b93d7b6d3b6ae6de5bc195dd3e
docker run \
--name mysql-dev \
-d --rm \
-p 3306:3306 \
-e MYSQL_DATABASE=my-database \
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
--tmpfs /var/lib/mysql \
circleci/mysql:5.7
@ueokande
ueokande / start.sh
Created Aug 29, 2018
Screencast on Linux
View start.sh
sudo modprobe v4l2loopback
ffmpeg -video_size 3840x2160 -framerate 30 -f x11grab -i :0.0 -f v4l2 /dev/video0
View main.go
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/coreos/etcd/clientv3"
)
View gist:224b28e111595428930e27a1709f9d14
xwininfo
ffmpeg -video_size ${w}x${height} -framerate 12 -f x11grab -i :0.0+${x},${y} output/%04d.png
@ueokande
ueokande / shell-ip-address
Last active Jun 25, 2018
Calculating network addresses in tthe shell script
View shell-ip-address
#!/bin/sh
# converts IPv4 as "A.B.C.D" to integer
# ip4_to_int 192.168.0.1
# => 3232235521
ip4_to_int() {
IFS=. read -r i j k l <<EOF
$1
EOF
echo $(( (i << 24) + (j << 16) + (k << 8) + l ))
@ueokande
ueokande / leader-election-with-etcd.sh
Last active Jan 25, 2018
Leader election with etcd
View leader-election-with-etcd.sh
#!/bin/sh
ID=$(uuidgen)
LEADER_KEY="localhost:2379/v2/keys/master"
TTL=5
INTERVAL=1
i_am_leader() {
echo "I am leader";
while true; do
View new-consumer-configs.md

bootstrap.servers

A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers irrespective of which servers are specified here for bootstrapping—this list only impacts the initial hosts used to discover the full set of servers. This list should be in the form host1:port1,host2:port2,.... Since these servers are just used for the initial connection to discover the full cluster membership (which may change dynamically), this list need not contain the full set of servers (you may want more than one, though, in case a server is down).

key.deserializer

Deserializer class for key that implements the Deserializer interface.

value.deserializer

View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
(1..2).each do |n|
config.vm.define "ap-#{n}" do |node|
node.vm.provider "docker" do |docker|
docker.build_dir = "vanilla"
docker.expose = [8000, 12201]
View print-rowkey
#!/usr/bin/env ruby
utsname = []
topic = []
if ARGV.length < 1
STDERR.puts("Missing arguments")
exit 1
end
View tamago.js
var page = require('webpage').create();
page.open('http://www.tamagoya.co.jp/menu_list.html', function() {
var rect = page.evaluate(function() {
var menuDate = Array.prototype.find.call(
document.querySelectorAll('.menutitle_date'),
(e) => e.textContent.includes("26") );
var menuTitle = menu_date.parentElement;
var menuList = menuTitle.nextElementSibling
var menuBottom = menuList.nextElementSibling
You can’t perform that action at this time.