This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# define | |
LEFT_WINDOW_WIDTH=1920 | |
DEBUG_FLG=0 | |
LOG_FILE="/tmp/maximize.log" | |
# debug statement | |
if [ -z "$1" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Bitcoin Core Base128 Serializer | |
# https://github.com/bitcoin/bitcoin/blob/v0.16.3/src/serialize.h#L317 | |
def b128_encode( n ) | |
puts (n).to_s(2) | |
tmp = [] | |
while true do | |
tmp.push( ((n & 0x7F) | (tmp.length>0 ? 0x80 : 0x00) ).chr ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Unsigned LEB128 Converter | |
# https://en.wikipedia.org/wiki/LEB128 | |
def leb128_encode( n ) | |
tmp = [] | |
while true do | |
tmp.push( ((n & 0x7F) | 0x80 ).chr ) | |
if n <= 0x7F |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Bitcoin Core Amount compression | |
# https://github.com/bitcoin/bitcoin/blob/v0.16.3/src/compressor.cpp#L133 | |
def compress_amount(n) | |
if n == 0 | |
return 0 | |
end | |
e = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Unsigned LEB128 Converter | |
# https://en.wikipedia.org/wiki/LEB128 | |
def encode( num, with_hex=false) | |
bs_n = num.to_s(2) | |
len = bs_n.length | |
# 0 padding for 7-bit | |
padding_len = (len / 7 + ( len % 7 > 0 ? 1 : 0 )) * 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://mtunn.wordpress.com/odroid-u2★セットアップ/radikoの録音・再生(archlinux)/ | |
pid=$$ | |
wkdir='/var/tmp' | |
playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf | |
playerfile="${wkdir}/player.swf" | |
keyfile="${wkdir}/authkey.png" | |
auth1_fms="${wkdir}/auth1_fms_${pid}" | |
auth2_fms="${wkdir}/auth2_fms_${pid}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (C) Matthieu Patou <[email protected]> 2010-2011 | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import tarfile,gzip,os | |
from time import time,strftime | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
class S3Backup: | |
bucket=None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pdf=$(echo $1|sed 's/.pdf//g') | |
# 変換 | |
convert -density 150 -geometry 800x600 +antialias \ | |
-rotate 90 -type GrayScale ${pdf}.pdf pdfpage_%02d.jpg | |
# 圧縮 | |
zip ${pdf}.zip pdfpage_*.jpg |