Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / vcs_converter.py
Last active September 28, 2015 13:20
docomoのvcsファイル(vCalenderフォーマット)によるメモ帳データをtxtファイルにコンバートします
# -*- coding: shift-jis -*-
# vcs converter
# 2015.09.23
# @Carotene
# -d : save directory path of the output text file
# -i : input vcs file path
from argparse import ArgumentParser
import os, os.path, datetime, quopri
# 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 / twitter_multi_pictures_downloader.py
Last active September 11, 2015 08:48
twitterで1ツイートで2つ以上画像が貼られてるときに一括保存するやつ
# twitter multi pictures downloader for Python 2.7
# 2015.07.25
# @Carotene
# How to Use:
# 1. Copy to clipboard the twitter page url uploaded pictures more than 2.
# 2. Run this script with an argument of save directory.
from bs4 import BeautifulSoup
from argparse import ArgumentParser