Skip to content

Instantly share code, notes, and snippets.

@gitcrtn
gitcrtn / mc_chat_speker.py
Created June 21, 2016 13:16
Minecraftのチャット読み上げ
# mc chat speaker
# 2016.06.21
# @Carotene
import time, os, re, codecs, winsound
from voicetext import VoiceText
latest_log = os.getenv('appdata').replace('\\','/') + '/.minecraft/logs/latest.log'
VT_API_KEY = 'YOUR_API_KEY'
@gitcrtn
gitcrtn / vnt_converter.py
Last active June 25, 2016 01:46
vntファイルをtxtファイルにコンバートするやつ
# -*- coding: shift-jis -*-
# vnt converter
# 2015.09.28
# @Carotene
from argparse import ArgumentParser
import os, os.path, datetime, quopri
# -d : date format (US/UK/JP)
# -i : input vnt file path or input directory path
@gitcrtn
gitcrtn / out_new_tag.rb
Created July 18, 2016 09:56
Fluentd Plugin for changing tag
# fluentd plugin - out new_tag
# 2016.07.06
# @Carotene
class Fluent::NewTagFilterOutput < Fluent::Output
Fluent::Plugin.register_output('new_tag', self)
config_param :tag, :string, :default => ''
def emit(tag, es, chain)
es.each {|time,record|
# mario.coffee for CoffeeCollider
# 2015.09.20
# @Carotene
master_gain = 0.5
syn = SynthDef (tone, gain=1.0, dur="bpm190 l16")->
Out.ar(0, Pan2.ar(Pulse.ar(XLine.kr(tone.midicps(), 100, 100)) * Line.kr(0.25, 0, dur:dur, doneAction:2) * gain * master_gain, 0))
.send()
@gitcrtn
gitcrtn / python_to_ubuntu.sh
Created May 19, 2019 03:24
Python Installation Steps for Clean Installed Ubuntu
# change repository location for japan
sudo sed -i.bak -e "s%http://us.archive.ubuntu.com/ubuntu/%http://ftp.jaist.ac.jp/pub/Linux/ubuntu/%g" /etc/apt/sources.list
sudo sed -i.bak -e "s%http://ja.archive.ubuntu.com/ubuntu/%http://ftp.jaist.ac.jp/pub/Linux/ubuntu/%g" /etc/apt/sources.list
sudo sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://ftp.jaist.ac.jp/pub/Linux/ubuntu/%g" /etc/apt/sources.list
sudo apt update
# install dependencies
sudo apt install build-essential
sudo apt install zlib1g-dev libssl-dev libsqlite3-dev \
libbz2-dev libncurses5-dev libgdbm-dev \
@gitcrtn
gitcrtn / install_pebble_face.py
Last active January 13, 2020 01:07
Install Pebble face from Termux
"""
Install Pebble face from Termux
Requires:
- libpebble2
Usage:
python2 install_pebble_face.py <pbw path>
"""
import sys
@gitcrtn
gitcrtn / install_pebble_sdk.sh
Created January 12, 2020 03:12
Install Pebble SDK with patch to Ubuntu 64bit
#!/usr/bin/env bash
#
# Install Pebble SDK for Ubuntu 64bit (2020)
#
# switch to python2
# install dependencies for sdk
mkdir $HOME/pebble-dev
cd $HOME/pebble-dev
if [ -x "$(command -v pyenv)" ]; then
"""
dump UPnP actions
Requirements:
- upnpclient
- pyyaml
- click
Usage:
python dump_upnp_actions.py -d <output_dir>
@gitcrtn
gitcrtn / install_hotas_driver.sh
Last active March 16, 2020 00:10
Remote Flight Stick for WebGL Game
#!/usr/bin/env bash
git clone https://github.com/walterschell/tflight4.git
cd tflight4
make
sudo cp hid-tflight4.ko /lib/modules/$(shell uname -r)/kernel/drivers/hid/
sudo insmod /lib/modules/$(shell uname -r)/kernel/drivers/hid/hid-tflight4.ko
#!/usr/bin/env bash
# Required: Python 2.7, git
# prepare venv
python2 -m pip install virtualenv
python2 -m virtualenv venv
. venv/bin/activate
# prepare required modules
pip install cython==0.20 numpy==1.9.0