Skip to content

Instantly share code, notes, and snippets.

@ryu1
ryu1 / big_file_encryption.bash
Created April 30, 2023 08:49
Big file encryption
# 秘密鍵を作成する(パスフレーズ有り)
openssl genrsa -aes256 4096 > private.key
# X.509 証明書生成 (自己署名証明書)
openssl req -new -x509 -key private.key -out cert.pem -days 36500 -subj /CN="sample"
# 証明書情報の確認
openssl x509 -noout -subject -dates -in cert.pem
# 暗号化
@ryu1
ryu1 / jdk8_download.sh
Created November 30, 2022 03:25 — forked from apiOmat/jdk8_download.sh
JDK8 command line download script; For JDK10, please check: https://gist.github.com/P7h/9741922
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget / curl.
### You can download all the binaries one-shot by just providing one BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@ryu1
ryu1 / osc52.sh
Created November 7, 2022 08:17
クリップボードを操作するエスケープシーケンス
#!/bin/sh
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Max length of the OSC 52 sequence. Sequences longer than this will not be
# sent to the terminal.
OSC_52_MAX_SEQUENCE="100000"
# Write an error message and exit.
# Usage: <message>
die() {
package test;
import org.dbunit.DefaultOperationListener;
import org.dbunit.IDatabaseTester;
import org.dbunit.IOperationListener;
import org.dbunit.JdbcDatabaseTester;
import org.dbunit.database.DatabaseConfig;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.ReplacementDataSet;
@ryu1
ryu1 / migration-m6i.large.md
Created May 13, 2022 06:48
m5.largeからm6i.largeに変更する手順
@ryu1
ryu1 / prevent-multiple-form-submission.js
Last active September 14, 2021 00:53
javascript code to prevent multiple form submission for django
window.addEventListener("load", function() {
(function ($) {
$(function () {
$('form').submit(function () {
$(this).find('input[type="submit"], button[type="submit"]').prop('disabled', 'true');
});
});
})(django.jQuery);
});

HTML-TIPS


上下中央揃え

<style type="text/css">
html, body {
	height: 100%;
}

Difference between a Factory, Provider and a Service?


Factory: Assembles classes, either by composing a bunch of bits together, or choosing type based on some kind of context

Provider: Provider is something microsoft "invented" (basically an abstract factory pattern) that is a way of doing a factory of factories, or having a common factory interface which allows factories to be swappable. It is used all over in the MS web stack as a way to keep components configurable.

Service: A service is a group of related functionality. Think of it as if you are splitting your architecture horizontally, you have a "Business Logic" layer, if you split that vertically you will have services.
@ryu1
ryu1 / find_gid_and_chown_group.sh
Last active December 21, 2020 05:01
There are shellscripts for changing ower of files or directories..
#/bin/bash
# Finds the object with the specified group ID and changes the owning group.
# _gid : Group ID that remains unchanged
# _grp : Group name you want to change
find_gid_and_chown_group() {
_gid=${1}
_grp=${2}
_buf_ifs=${IFS}
IFS=
@ryu1
ryu1 / HowToInstallMavenToEclipse.md
Last active October 20, 2020 08:19
How To Install Maven To Eclipse

How To Install Maven

Maven Central Repository は、現在、TLSv1.2でないと接続できなくなりました。

JDK1.7(を含めて)以前のバージョンで、Mavenビルドを実行している環境では、デフォルトでは、JDKがTLSv1.2をサポートしていないため、以下のようなエラーが発生していることと思います。

Received fatal alert: protocol_version -> [Help 1]