Skip to content

Instantly share code, notes, and snippets.

View secondarykey's full-sized avatar

secondarykey secondarykey

View GitHub Profile
@secondarykey
secondarykey / main.go
Created September 5, 2023 05:11
一般社団法人サイバー技術・インターネット自由研究会の電子公告のGo版
package main
import (
"bufio"
"fmt"
"net"
"time"
"golang.org/x/text/encoding/japanese"
"golang.org/x/text/transform"
@secondarykey
secondarykey / encrypt.go
Created November 21, 2016 00:13
Go言語でAES256(CBC)の暗号を作る(opensslでsaltを指定した場合)
//
// 暗号的に弱いsalt方式なので、サンプルは一生でないと思いなんとなく作成しておいた
//
// echo "test" | openssl enc -e -aes-256-cbc
//
// と同じかな?
// p=パスフレーズ,d=暗号化するデータ
//
func encrypt(p, d string) (string, error) {
package main
import (
"crypto/cipher"
"crypto/aes"
"fmt"
)
var block cipher.Block
package main
import (
"fmt"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"time"
@secondarykey
secondarykey / image.go
Created February 2, 2016 15:19
gxuiにgo-opencvから動画データを流し込んでみた。
package main
import (
"image"
"image/draw"
_ "image/jpeg"
_ "image/png"
"github.com/google/gxui"
"github.com/google/gxui/drivers/gl"
filetype off
filetype plugin indent off
" Golang Vim
set runtimepath+=$GOROOT/misc/vim
" Golang gocode
exe "set runtimepath+=".globpath($GOPATH, "src/github.com/nsf/gocode/vim")
" NeoBundle
if has('vim_starting')
let mapleader = '\\'
" Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" Vundle本体
Bundle 'sgur/vundle'
"Vundleの設定
URL url = new URL("https://api.dropbox.com/1/oauth/request_token");
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setDoInput(true);
connection.addRequestProperty("Authorization", buildOAuthHeader(false));
connection.setRequestMethod("GET");
InputStream inStream = connection.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(inStream));
String line = input.readLine();