This file contains 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
# encoding:utf-8 | |
require 'serialport' | |
$serial_port = '/dev/ttyUSB0' | |
$serial_baudrate = 9600 | |
$serial_databit = 8 | |
$serial_stopbit = 1 | |
$serial_paritycheck = 0 | |
sp = SerialPort.new($serial_port, $serial_baudrate, $serial_databit, $serial_stopbit, $serial_paritycheck) |
This file contains 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
#if 0 | |
#!/bin/bash | |
src=$0 | |
obj=${src%.*} | |
gcc -g -Wl,--no-as-needed `pkg-config --cflags --libs libcurl libssl libp11` -o $obj $src | |
exit | |
#endif | |
/* perform HTTPS GET on ssl client verification using curl,OpenSSL ENGINE pkcs11 and libp11 | |
* |
This file contains 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
/* | |
* perform HTTPS GET on SSL client verification using Java PKCS#11 | |
* | |
* requirement: | |
* * PKCS#11 enable security token | |
* * the token has stored cert and key for ssl client verification,and ca cert | |
* PKCS#11 library(.dll or .so) for the token | |
* | |
* usage: | |
* java -cp . -D java.security.debug=sunpkcs11 TestPKCS11 https://www.example.com/ |
This file contains 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
#if 0 | |
#!/bin/bash | |
src=$0 | |
obj=${src%.*} | |
gcc -g -Wl,--no-as-needed `pkg-config --cflags --libs libmondai` -o $obj $src | |
$obj | |
exit | |
#endif | |
#include <stdio.h> |
This file contains 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
filetype indent off | |
"set sw=2 expandtab | |
set tabstop=4 | |
set ignorecase | |
set noautoindent | |
set fileencoding=utf-8 | |
set fileencodings=utf-8,euc-jp,iso-2022-jp | |
inoremap <C-h> <Left> | |
inoremap <C-j> <Down> |
This file contains 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
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <memory.h> | |
#ifdef __LP64__ | |
typedef long Obj; | |
#else |
This file contains 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
ops = { | |
:ssl_options => { | |
:use_ssl => true, | |
:vefify_mode => OpenSSL::SSL::VERIFY_PEER, | |
:cert => OpenSSL::X509::Certificate.new(File.read(CERT_FILE)), | |
:key => OpenSSL::PKey::RSA.new(File.read(KEY_FILE)), | |
:ca_file => CA_FILE | |
} | |
} | |
ops[:params] = {:id => 1, :data => 2} |
This file contains 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
require 'barby' | |
require 'barby/outputter/rmagick_outputter' | |
barcode = Barby::Code128B.new(ARGV[1]) | |
File.open(ARGV[0],"w"){|f| | |
f.write barcode.to_png(:height=>32,:margin=>1) | |
} |
This file contains 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
#if 0 | |
#!/bin/bash -x | |
src=$0 | |
out=${src%.*} | |
obj=$out.o | |
gcc -g -Wl,--no-as-needed `pkg-config --cflags --libs libpng12 ` -lm -c $src | |
gcc -g -Wl,--no-as-needed `pkg-config --cflags --libs libpng12 ` -lm -o $out $obj /usr/lib/libbarcode.a | |
$out | |
rm $obj $out | |
exit |
This file contains 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
#if 0 | |
#!/bin/bash | |
src=$0 | |
obj=${src%.*} | |
gcc -o $obj $src | |
$obj | |
exit | |
#endif | |
#define PRICE "99" |