Skip to content

Instantly share code, notes, and snippets.

@dodo5522
dodo5522 / minecraft-user-monitor.service
Last active November 13, 2022 03:41
Script to monitor users logged in on minecraft
[Unit]
Description=Minecraft User Monitor
After=network.target
[Service]
Type=simple
WorkingDirectory=/var/tmp/minecraft_user_monitor
ExecStart=/var/tmp/minecraft_user_monitor/run.sh
ExecStop=/bin/kill -TERM
Restart=always
@dodo5522
dodo5522 / mts_converter.sh
Last active September 30, 2018 03:50
SONYハンディカムHDR-PJ760等で撮影したAVCHD動画を自動的にチャプタ毎分割しつつ、適当にダウンコンバートしたmp4動画へ変換するbashスクリプト。tsMuxeR, ffmpeg必須。詳細は http://tech.uribou.tokyo/split-avchd-movie-automatically とか参照。
#!/bin/bash
usage_exit() {
echo "Usage: $0 [options] MPL_FILE" 1>&2
echo "" 1>&2
echo "options:" 1>&2
echo " -i input source file" 1>&2
echo " -d destination dir" 1>&2
echo " -r output video resolution (default: 1280x720)" 1>&2
echo " -s output video aspect (default: 16:9)" 1>&2
@dodo5522
dodo5522 / main.py
Last active August 5, 2017 22:42
This module is very simple motor driver to be run on Raspberry Pi
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
from motor import MotorDriver
from time import sleep
K = [10.0, 0.0]
CONTROLLERS = []
@dodo5522
dodo5522 / flickr_upload.uml
Created July 15, 2017 22:23
UML diagram to upload a photo into flickr.
' activity diagram
@startuml{plantuml_act_flickr_api.png}
start
:ブラウザを開く;
partition ブラウザ操作 {
:https://www.flickr.com/services/apps/create/apply\nにアクセスする;
if (営利目的か?) then (yes)
@dodo5522
dodo5522 / flickr_uploader.py
Last active May 4, 2023 21:40
Python script to upload a photo into flickr.
#!/usr/bin/env python2
# -*- encoding:utf-8 -*-
from __future__ import print_function
import argparse
import datetime
import exifread
import flickrapi
import os
import sys
@dodo5522
dodo5522 / fetch_with_sqlalchemy.py
Last active March 13, 2017 02:36
SQLAlchemy + PyMySQLでのデータ取得方法
#!/usr/bin/env python
import sys
import sqlalchemy as sa
if __name__ == "__main__":
engine = sa.create_engine(
"mysql+pymysql://{USER}:{PASS}@{HOST}/{DB}?charset=utf8".format(
USER=sys.argv[1], PASS=sys.argv[2], HOST=sys.argv[3], DB=sys.argv[4]))
@dodo5522
dodo5522 / mnist_dl.py
Last active February 16, 2017 15:55
MNISTデータをダウンロードしてgzip伸長するpythonコード
import asyncio
import aiohttp
import gzip
from io import BytesIO
import numpy as np
import pandas as pd
import requests
class MnistWrapper(object):
@dodo5522
dodo5522 / file0.txt
Created July 17, 2014 22:52
CloudFlashの便利な使い方/設定方法 ref: http://qiita.com/dodo5522/items/dc05cbc814e86c8985bb
telnet 192.168.1.1
#