Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
ffmpeg -ss $1 -i "$2" -t $3 -codec:v copy -b:v 5000k "$4"
@eyasuyuki
eyasuyuki / pivot.md
Last active November 18, 2020 04:18

MySQL (MariaDB) で行と列を入れ替える

結論

CASE WHENで行を列に変換し、GROUP_CONCATで連結する。

テーブルと得たい結果のイメージ

以下のテーブルがあったとする。

@eyasuyuki
eyasuyuki / InstallAnsible2Windows.md
Last active October 26, 2020 03:09
How to install Ansible to Windows

Requirements

  • Cygwin
  • gcc-core
  • openssh
  • python
  • python-setuptools

Install pip and Ansible

@eyasuyuki
eyasuyuki / sample.yml
Last active June 15, 2020 15:41
Ansible playbook example before install Fluentd
- hosts: all
remote_user: eyasuyuki
sudo: yes
vars:
limits_conf: /etc/security/limits.conf
sysctl_conf: /etc/sysctl.conf
tasks:
- name: before install fluentd check ulimit
shell: grep "{{ item }}" {{ limits_conf }}
with_items:
  • Install youtube-dl
brew install youtube-dl
  • Save your youtube cookies

** Open Google Chrome

# from https://weblabo.oscasierra.net/python/keras-mnist-sample.html
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, InputLayer
from keras.optimizers import RMSprop
# read MNIST
(x_train, y_train), (x_test, y_test) = mnist.load_data()
mariadb-data:
image: busybox
volumes:
- /var/lib/mysql
container_name: mariadb-datastore
mariadb:
image: mariadb:latest
volumes_from:
- mariadb-data
#!/bin/sh
if [ -z "$1" ]; then
echo "$0 <vm name>"
exit -1
fi
docker-machine ssh $1 -- tce-load -wi python.tcz
docker-machine ssh $1 -- sudo ln -s /usr/local/bin/python /usr/bin/python
docker-machine ssh $1 -- 'curl https://bootstrap.pypa.io/get-pip.py | sudo python -'
docker-machine ssh $1 -- sudo pip install docker-py
# -*- coding: utf-8 -*-
import sys
import commands
hosts = """\
[docker]
{0}
"""