Skip to content

Instantly share code, notes, and snippets.

@shouhei
shouhei / Dockerfile
Created April 13, 2020 09:33
DockerでVMware Remote Console Client を使うためのDockerfile
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninterractive
COPY ./VMware-Remote-Console-11.1.0-15913118.x86_64.bundle /root/
RUN apt update && \
apt install -y libgtk-3-dev libaio-dev libpcsclite1 libasound2-dev desktop-file-utils less && \
cd /root && \
./VMware-Remote-Console-11.1.0-15913118.x86_64.bundle --required --console --eulas-agreed && \
apt clean && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["vmrc"]
(package-initialize)
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa". "http://melpa.org/packages/")))
(keyboard-translate ?\C-h ?\C-?)
(load-theme 'wheatgrass t)
(setq make-backup-files nil)
(setq auto-save-default nil)
@shouhei
shouhei / Dockerfile
Last active June 24, 2018 03:18
[Nomad] Use client side variables.
FROM python:latest
RUN pip install flask
COPY ./app.py /root/app.py
CMD python /root/app.py
@shouhei
shouhei / docker-compose.yml
Created June 9, 2018 12:08
gitlab pages を試すサンプル
version: "3.6"
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.example.local'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.example.local'
nginx['listen_https'] = false
@shouhei
shouhei / app.rb
Last active March 29, 2018 10:53
Multi process echo server
require 'socket'
def main(host, port)
Process.setproctitle "ruby_init"
s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
sockaddr = Socket.sockaddr_in(port, host)
s.bind(sockaddr)
s.listen(5)
Process.fork do
Process.setproctitle "ruby_server"
@shouhei
shouhei / config.json.example
Created December 10, 2017 15:08
kea dhcp with control-agent
{
"Control-agent": {
"http-host": "0.0.0.0",
"http-port": 8080,
"control-sockets": {
"dhcp4": {
"socket-type": "unix",
"socket-name": "/var/run/socket-dhcp-v4"
}
@shouhei
shouhei / fluent.conf
Created November 5, 2017 17:28
fluentd config template from docker logging driver
<source>
type forward
port 24224
bind 0.0.0.0
</source>
<match stdout.**>
@type stdout
</match>
<match stderr.**>
@type stdout
@shouhei
shouhei / git-credential-env.sh
Last active August 22, 2017 13:29
git-credential-env
#!/bin/bash
if [ $# -ne 1 ] || [ "${1,,}" != "get" ];
then
exit 0
fi
echo "protocol=${GIT_PROTOCOL}"
echo "host=${GIT_REMOTE_HOST}"
echo "username=${GIT_USER}"
@shouhei
shouhei / make_iso_app_icon.sh
Created May 27, 2017 13:50
iosのアイコン作るスクリプト
#!/usr/local/bin/bash
BASE_IMAGE=$1
if [ $# -ne 1 ]; then
echo "Please set base png image."
exit 1
fi
sips -Z 120 $BASE_IMAGE --out Icon-60@2x.png
sips -Z 180 $BASE_IMAGE --out Icon-60@3x.png
sips -Z 76 $BASE_IMAGE --out Icon-76@.png
sips -Z 152 $BASE_IMAGE --out Icon-76@2x.png
@shouhei
shouhei / sample.rb
Created March 29, 2017 14:53
プロジェクトオイラー17
# http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2017
base_one = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
base_ten = ["ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
base_hundred = "hundred"
base_thousand = "thousand"
exceptions = ["eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
base = base_one + base_ten + exceptions + base_ten.slice(1..-1).product(base_one).map { |set| set[0] ++ set[1] }
punctuation = base_one.map{ |b| b + base_hundred }
middle = base + punctuation.product(base).map { |set| set[0] + "and"+ set[1] }