Skip to content

Instantly share code, notes, and snippets.

mipsparc mipsparc

Block or report user

Report or block mipsparc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mipsparc
mipsparc / nicovideo-dl
Created Apr 16, 2016
Fork of nicovideo-dl(https://osdn.jp/projects/nicovideo-dl/). Made for private using purpose
View nicovideo-dl
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Keiichiro Nagano
# Copyright (c) 2009 Kimura Youichi
# Copyright (c) 2006-2008 Ricardo Garcia Gonzalez
# Copyright (c) 2008 Ying-Chun Liu (PaulLiu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@mipsparc
mipsparc / multimp3.py
Last active Apr 16, 2016
simultaneously download nicovideo
View multimp3.py
#!/usr/bin/env python3
import multiprocessing
import subprocess
accounts =[
{'id':'1@example.com', 'pass':'password'},
{'id':'2@example.com', 'pass':'password'},
]
def download(account, download_urls):
@mipsparc
mipsparc / dequoter.py
Last active May 30, 2016
ALINCO Clone UtilityのCSVインポート機能は「"」が一番右の行についているとその列を無視してしまうので、すべてのセルから「"」を削除する。あと改行コードもWindowsに合わせる
View dequoter.py
import os.path
filename = input('CSV filename: ')
data = open(filename).readlines()
name, ext = os.path.splitext(filename)
out = open(name+'_ok'+ext, 'w')
outdata = ''
for row in data:
outrow = row.replace('\n','').replace('\r','').replace('\'','').replace('"','')
@mipsparc
mipsparc / pidcount.py
Last active Dec 11, 2018
MPEG2-TSファイルを解析して、含まれているPIDと数を列挙する
View pidcount.py
#! /usr/bin/env python3
#coding:utf-8
#require bitstring
import bitstring
import math
import sys
filename = sys.argv[1]
packet_length = 188
@mipsparc
mipsparc / totts.py
Last active Aug 23, 2016
MPEG2-TSの中のTDTパケットを取り出して、中に入ってる時刻情報を表示するやつ
View totts.py
#! /usr/bin/env python3
#coding:utf-8
#require bitstring
import bitstring
import math
import sys
filename = sys.argv[1]
packet_length = 188
@mipsparc
mipsparc / totts_stream.py
Last active Aug 23, 2016
totts.py(MPEG2-TSの中のTDTパケットを取り出して、中に入ってる時刻情報を表示するやつ)のリアルタイムストリーム入力可能にしたバージョン。
View totts_stream.py
#! /usr/bin/env python3
#coding:utf-8
#require bitstring
import bitstring
from sys import argv
import math
import sys
import io
import time
@mipsparc
mipsparc / isdbt_clock.py
Last active Aug 23, 2016
チューナーから標準入力されたストリームを読み込んで時刻情報パケット(TDT)から時刻を取得し、GUIの時計を表示します
View isdbt_clock.py
#!/usr/bin/env python3
#coding:utf-8
import json
import random
import time
try:
from gi import pygtkcompat
except ImportError:
pygtkcompat = None
@mipsparc
mipsparc / exif_year.py
Created Aug 5, 2017
標準入力で与えられたファイル名のJPEGファイルのEXIF情報を読み込み、撮影された年を標準出力で返す
View exif_year.py
#/usr/bin/env python3
from PIL import Image
from datetime import datetime
imgname = input();
img = Image.open(imgname)
#DateTimeOriginal のExif tag ID
taken_datetime_exif = img._getexif()[0x9003]
@mipsparc
mipsparc / renamedirs.sh
Created Aug 5, 2017
renamedirs.txtにあるディレクトリのそれぞれ1番最初にあるJPEGファイルの撮影年をディレクトリ名に付加する
View renamedirs.sh
#!/bin/bash
cat renamedirs.txt | while read DIRN
do
FILENAME=`ls -1 $DIRN | sed -n '1p'`
YEAR=`echo ${DIRN}/${FILENAME} | python3 photodir_year.py`
echo "renaming ${DIRN}"
mv $DIRN ${DIRN}_${YEAR}
done
@mipsparc
mipsparc / door_led_indicator.c
Last active Apr 10, 2018
E233系ドア上ランプをイメージして、接点状態が変化すると0.3秒点滅を5回繰り返すPIC16F677向けCプログラム
View door_led_indicator.c
// CONFIG
#pragma config FOSC = INTRCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config MCLRE = OFF // MCLR Pin Function Select bit (MCLR pin function is digital input, MCLR internally tied to VDD)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = ON // Brown-out Reset Selection bits (BOR enabled)
#pragma config IESO = OFF // Internal External Switchover bit (Internal External Switchover mode is disabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
You can’t perform that action at this time.