Skip to content

Instantly share code, notes, and snippets.

View yumu19's full-sized avatar

Tsubasa Yumura yumu19

View GitHub Profile
@yumu19
yumu19 / capture.sh
Last active January 15, 2021 02:52
Automatically Capture of Screenshots for Mac
#!/bin/bash
INTERVAL=60 #Interval of Capture Screen(seconds)
DIRNAME="${HOME}/Desktop/capture/"
if [ ! -e ${DIRNAME} ]; then
mkdir ${DIRNAME}
fi
while true
@yumu19
yumu19 / postreceive-mongo.js
Created November 4, 2014 10:06
node.js file which saves body of HTTP POST to MongoDB
var http = require('http');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var dataSchema = new Schema({ data: Schema.Types.Mixed});
var Data = mongoose.model('data', dataSchema);
mongoose.connect('mongodb://localhost/test');
http.createServer(function (req, res) {
if(req.method=='POST') {
var body = '';
@yumu19
yumu19 / hue.sh
Created December 1, 2014 11:45
shell script of access hue API in radihue
IPADDR="10.1.100.101"
NUM=$1
SAT=$2
BRI=$3
HUE=$4
i=0
QUERY="{\"on\":true, \"sat\":${SAT}, \"bri\":${BRI}, \"hue\":${HUE}}"
echo ${QUERY}
while [ $i -lt 555555 ]
do
@yumu19
yumu19 / radihue.js
Created December 1, 2014 11:51
node.js file of radihue control server
var http = require('http');
var url = require('url');
var exec = require('child_process').exec;
var i = 0;
var j = 1;
var command = "";
http.createServer(function (req, res) {
var now = new Date();
var parts = url.parse(req.url,true);
@yumu19
yumu19 / kanon-Dockerfile
Created January 20, 2015 12:19
Dockerfile of kanon (trac)
FROM centos:6
MAINTAINER Tsubasa YUMURA @yumu19
RUN yum -y update
RUN yum -y install mercurial which
RUN cd /tmp && hg clone https://bitbucket.org/okamototk/kanonconductor
RUN yes | /tmp/kanonconductor/kanon-setup
RUN echo 'export PATH=/opt/kanon/bin/:$PATH' >> /root/.bash_profile
RUN source /root/.bash_profile
@yumu19
yumu19 / changewallpaper.sh
Created January 29, 2015 13:11
Shell Script to Change Wall Paper of Mac
#!/bin/bash
i=0
j=1
while true
do
command="/usr/bin/osascript -e 'tell application \"Finder\" to set desktop picture to POSIX file \"/Users/yumu/Desktop/img/img${i}.png\"'"
if [ -e /Users/yumu/Desktop/hoge/img${j}.png ]; then
echo ${command}
eval ${command}
i=`expr ${i} + 1`
@yumu19
yumu19 / saveCameraImage.pde
Last active August 29, 2015 14:14
Save Camera Image
import processing.video.*;
Capture cam;
PImage img;
String path;
String command;
int i;
void setup(){
size(640,384);
cam = new Capture(this, width, height, 10);
@yumu19
yumu19 / a140.ws
Created February 26, 2015 16:37
whitespace script for output 140 times of 亞
@yumu19
yumu19 / dress.pde
Created February 28, 2015 09:24
change color of dress (need dress.png file)
import controlP5.*;
ControlP5 ctls;
PImage img;
float bg_hue = 40.0;
float bg_sat = 0.1;
float bg_bri = 1.0;
float dress_hue = 0;
float dress_sat = 0.0;
@yumu19
yumu19 / dockerBackup.rb
Created June 18, 2015 10:26
ruby script to backup(export) docker container
require 'clockwork'
include Clockwork
module Clockwork
@@rootDir = "/Users/yumu/dockerBackupDir/"
@@hourlyFormat = "%Y%m%d_%H%M"
@@dailyFormat = "%Y%m%d"
def getContainerNames
ps = `docker ps`.split("\n")