Skip to content

Instantly share code, notes, and snippets.

View chimerast's full-sized avatar
😴
Beautiful Dreamer

Hideyuki Takeuchi chimerast

😴
Beautiful Dreamer
View GitHub Profile
@chimerast
chimerast / CryptoSample.kt
Created June 15, 2021 09:53
KotlinでPEM形式の公開鍵暗号ペアファイルを扱う
/*
このコードはKotlinでPEM形式のRSAおよびEC公開鍵暗号を利用したサンプルプログラムです。
**警告**: 文字列になっている公開暗号鍵ペアは絶対にそのまま使用しないこと。
opensslコマンドを打って必ず自分で生成してください。
実行結果:
[RSA/ECB/PKCS1Padding] matched: true, original: Hello world!, decrypted: Hello world!
[SHA256withRSA] valid: true, original: Hello world!
[SHA256withECDSA] valid: true, original: Hello world!
@chimerast
chimerast / server.ts
Created September 21, 2020 14:28
WiFiのMACアドレスを利用したRADIUS認証
import dgram from 'dgram';
import radius from 'radius';
const server = dgram.createSocket('udp4');
const RADIUS_SECRET = 'HOGEHOGE'; // RADIUSの共有シークレット
function auth(mac: string): boolean {
return mac === '00:00:00:00:00:00'; // 認証したいMACアドレス
}
@chimerast
chimerast / CoroutineExercise.kt
Created September 4, 2020 17:45
Coroutineの説明用に作って見た
package example
import kotlinx.coroutines.*
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger
fun main() {
val nCount = 100000
@chimerast
chimerast / bbq.py
Created March 20, 2019 09:50
回答: 難問解けたらjustInCaseのBBQに無料ご招待! https://www.wantedly.com/projects/289455
from urllib.request import *
from urllib.parse import *
import json
import base64
from sympy import *
q = 'W1t4LCAxXV1AW1sxLCAtODcuNjcwNV0sWy04Ny42NzA1LCA0OTc1LjQwNDQxXV1AW1t4XSwgWzFdXQ%3D%3D'
formula = base64.b64decode(unquote(q)).decode('utf-8')
x = Symbol('x')
@chimerast
chimerast / index.js
Created July 8, 2018 16:28
[HyperTerm Configuration]
exports.decorateBrowserOptions = (options) => {
return Object.assign({}, options, {
titleBarStyle: 'hidden'
});
}
exports.getTermProps = (uid, parentProps, props) => {
return Object.assign(props, {
onDecorated: (term) => {
term.term.setOption('letterSpacing', 1);
{
"title": "chimerast's custom bindings",
"rules": [
{
"description": "Input backslash(\\) if pressed Yen-mark",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "international3",
@chimerast
chimerast / DefaultKeyBinding.dict
Created February 14, 2018 14:14
[DefaultKeyBinding.dict]
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally
@chimerast
chimerast / makegif
Created April 19, 2017 06:53
Make gif animation file from movie
#!/bin/bash
set -eux
INPUT_FILE=${1}
OUTPUT_FPS=${2:-8}
OUTPUT_HEIGHT=${3:--1}
TEMPFILE_CUT=cut.mp4
TEMPFILE_PALLETE=pallete.png
@chimerast
chimerast / sen.patch
Created January 24, 2017 14:09
sen.patch
Index: src/java/net/java/sen/util/DoubleArrayTrie.java
===================================================================
--- src/java/net/java/sen/util/DoubleArrayTrie.java (revision 89)
+++ src/java/net/java/sen/util/DoubleArrayTrie.java (working copy)
@@ -1,3 +1,18 @@
+
+
+
+
+
@chimerast
chimerast / buildnumber-maven-plugin.patch
Created January 24, 2017 14:01
buildnumber-maven-plugin with hg branch
Index: pom.xml
===================================================================
--- pom.xml (revision 19341)
+++ pom.xml (working copy)
@@ -13,7 +13,7 @@
<artifactId>buildnumber-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Build Number Maven Plugin</name>
- <version>1.2</version>
+ <version>1.2.1</version>