Skip to content

Instantly share code, notes, and snippets.

@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 / auto_overrider.py
Created November 20, 2015 02:03
メタクラスによる自動オーバーライド(自動キャスト)
# === base classes ===
class OverrideProcessor(object):
def __init__(self,target_class):
self.method_names = tuple() # names tuple of override method
self.target_class = target_class # target class to override methods
self.reference_methods = {} # reference methods dict fot override target
self.setup()
self.do()
@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 / MapUpdater.java
Created July 18, 2016 09:11
Bukkit Plugin for Automated Updating of Maps in Item Frames
// MapUpdater plugin
// 2016.07.18
// @Carotene
// Usage:
// /updatemap <maps_name> <radius>
// /updatemap <maps_name> <radius> <x> <y> <z>
// - <maps_name> is just for messaging.
// - <radius> is the search range of the maps in item frames.
@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|
@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_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
@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
"""
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