Skip to content

Instantly share code, notes, and snippets.

View paselin's full-sized avatar

paselin paselin

View GitHub Profile
@paselin
paselin / Amazonのリンクを短くするブックマークレット的なやつ
Last active November 12, 2019 11:08
この中身をコピペしてブックマークのURLに貼り付けてね
javascript:var%20protocol=location.protocol;var%20hostname=location.hostname;var%20path=location.pathname;var%20dpCode='';if(!hostname.match(/www\.amazon\.co\.jp/)){exit;}if(path.match(/\/dp\/[a-zA-Z0-9]*/)){dpCode=path.match(/\/dp\/[a-zA-Z0-9]*/);}if(path.match(/\/gp\/*\/[a-zA-Z0-9]*/)){dpCode="/dp/"+path.match(/gp.*\/([a-zA-Z0-9]*)/)[1];}var%20newUrl=protocol+"//"+hostname+dpCode;alert(newUrl);
@paselin
paselin / tv_rec_test.sh
Last active November 23, 2019 16:33
録画テスト用シェルスクリプト
echo 'test directory is /tmp/rec_test.'
echo 'mkdir rec_test.'
pushd /tmp
mkdir -p rec_test
RECTIME=10
# テストする物理チャンネルを入力
TVCHANNEL=(
30
31
#!/bin/bash
ENCODE_QUE=()
FLG=0
cd /home/pi/chinachu/
PS=`ps ax | grep ./encode.sh | grep -v "grep ./encode.sh"`
echo ${PS}
if test -z "${PS}" ; then
for REC in `ls -F ./video/ | grep -v / | sed -e "s/\.m2ts//"`
do
FLG=0
#!/bin/sh
INPUT="$1"
JSON="$2"
CAT="etc"
FLG=0
TMP=`echo $INPUT | cut -f3 -d "/"`
LEN=`expr ${#TMP} - 5`
FILENAME=`echo $TMP | cut -c 1-$LEN`
TMPOUT="./video/tmp/$FILENAME.mp4"
OUTPUT="./video/encoded/$FILENAME.mp4"
#!/bin/sh
INPUT="$1"
TMP=`echo $INPUT | cut -f3 -d "/"`
LEN=`expr ${#TMP} - 5`
FILENAME=`echo $TMP | cut -c 1-$LEN`
TMPOUT="./video/tmp/$FILENAME.mp4"
OUTPUT="./video/encoded/$FILENAME.mp4"
TARGET_HEIGHT="720"
ping 192.168.0.1 -n 1 >> res.txt
ping 192.168.0.2 -n 1 >> res.txt
ping 192.168.0.3 -n 1 >> res.txt
ping 192.168.0.4 -n 1 >> res.txt
ping 192.168.0.5 -n 1 >> res.txt
ping 192.168.0.6 -n 1 >> res.txt
ping 192.168.0.7 -n 1 >> res.txt
ping 192.168.0.8 -n 1 >> res.txt
ping 192.168.0.9 -n 1 >> res.txt
ping 192.168.0.10 -n 1 >> res.txt