Skip to content

Instantly share code, notes, and snippets.

View vasmani's full-sized avatar

Jihong Lee vasmani

View GitHub Profile
@vasmani
vasmani / gist:8928902
Created February 11, 2014 03:41
파일명 일괄 변경
#!/bin/sh
for i in `ls -- *.mp`do
fbody=`basename -- $i .mp`
mv -- ${fbody}.mp ${fbody}.mp3
done
@vasmani
vasmani / gist:8208850
Created January 1, 2014 15:30
Arduino 16진수로 변환
char temp[3];
unsigned int kmh;
void setup() {
// put your setup code here, to run once:
Serial.begin(38400);
temp[0] = 'C';
temp[1] = 'A';
}
@vasmani
vasmani / gist:8144151
Last active January 1, 2016 12:19
jarduino -- 과연 잘 되어야 하는데.. 방법 : jarduino의 HC-05옆에 점퍼선을 연결한후에 아래 코드를 usb모드로 입력, 실 사용시에는 BT모드로 변환하면 된다.
#include <Event.h>
#include <Timer.h>
#include <SPI.h>
#include <LiquidCrystal.h>
#include <dht.h>
#define ledpin_red 13 //Arduino output pin for Shift Light Red led
#define BT_CMD_RETRIES 5 //Number of retries for each Bluetooth AT command in case of not responde with OK
#define OBD_CMD_RETRIES 20 //Number of retries for each OBD command in case of not receive prompt '>' char
@vasmani
vasmani / gist:6404682
Last active December 22, 2015 02:38
MIDI!
#include <MIDI.h>
#include <CapacitiveSensor.h>
int threshold = 2000, // for 10Mohm
threshold2 = 200, // for 1Mohm
channel = 1, velocity = 100, instrument = 0;
boolean status1 = false, prev_status1 = false,
status2 = false, prev_status2 = false,
status3 = false, prev_status3 = false,
@vasmani
vasmani / gist:6398550
Created August 31, 2013 14:24
aconnect시 자동으로 포트를 찾아 연결해 준다.
#!/bin/bash
aconnect=/usr/bin/aconnect
para="`$aconnect -i | grep ttymidi | awk '{print $2}' `0 `$aconnect -o | grep TiMidity | grep user | awk '{print $2}'`0"
$aconnect $para
@vasmani
vasmani / gist:5748134
Last active December 18, 2015 07:39
raspberry pi && gopro for time lapse
pi@raspberrypi ~/public_html/gopro $ cat take_picture_and_send.sh
#!/bin/bash
## volume 100%
curl "http://10.5.5.9/camera/BS?t=goprohero&p=%02"
sleep 1
## mode to photo
curl "http://10.5.5.9/camera/CM?t=goprohero&p=%01"
sleep 1
## take picture
curl "http://10.5.5.9/bacpac/SH?t=goprohero&p=%01"
@vasmani
vasmani / gist:5747847
Created June 10, 2013 10:36
raspberry pi - gopro - wpa_supplicant
--- wpa_supplicant.conf ---
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ctrl_interface_group=root
update_config=1
#ap_scan=0
network={
ssid="GOPRO-WIFI"
psk="goprohero"
proto=WPA2
@vasmani
vasmani / gist:4983572
Created February 19, 2013 06:25
datetime to datetime...
function dates(from, to){
var format = 'YYYY-MM-DD HH:mm',
f = moment(from, format),
t = moment(to, format),
current = '',
result = [];
while(current != to){
current = f.add('m',1).format(format);
result.push(current);