Skip to content

Instantly share code, notes, and snippets.

@holly
holly / initializer.yml
Last active July 22, 2021 14:40
ansible-bestpractice-directory yml
# localhost上で、AnsibleのBestpracticeなディレクトリ構成の雛形を作成します。
#
# 以下のように、localhost指定で作成します・
# ansible-playbook -i localhost, -c local initializer.yml
- hosts: localhost
vars_prompt:
- name: "root_dir_name"
prompt: "生成するディレクトリ名を指定してください。"
confirm: no
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use autodie;
use feature qw(say);
use File::Spec;
use FindBin qw($Script $Bin);
use LINE::Notify::Simple;
@holly
holly / worker_cpu_affinity.sh
Last active January 30, 2021 15:50
nginx worker_cpu_affinity generator (inspire from https://github.com/cubicdaiya/nwcagen/blob/master/nwcagen.go)
#!/bin/bash
cpu_num=$(nproc)
array=()
echo -n "worker_cpu_affinity "
if [ $cpu_num = 1 ]; then
echo "auto;"
exit
fi
@holly
holly / md_sync_call.sh
Created January 17, 2021 15:11 — forked from tagomoris/md_sync_call.sh
Run "check" about specified md device if it's status is "idle"
#!/bin/sh
TARGET_MD=$1
### call md verifying when idle.
######
# HOW TO USE
### md_sync_call.sh md0
error_exit() {
@holly
holly / sshd_config
Last active January 17, 2021 08:12
sshd_config sample
Port 9022
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
@holly
holly / VBAAccelator.cls
Created December 20, 2020 02:13
VBA Acclelation Class
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "VBAAccelator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
@holly
holly / mariadb-server-mem2G.cnf
Last active December 19, 2020 15:16
mariadb-server-mem2G.cnf
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
port = 3306
socket = /run/mysqld/mysqld.sock
datadir = /var/lib/mysql
server-id=1
@holly
holly / ModuleUtility.bas
Last active January 5, 2021 02:56
ModuleUtility
Attribute VB_Name = "ModuleUtility"
Option Explicit
'=== 参照設定で有効にしておく項目 ===
'Microsoft Scripting Runtime
' FileSystemObject
'
'ストリーミング関係(UTF-8なcsvを出力や読み込みなど)
'Microsoft ActiveX Data Objects x.x Library
' ADODB.stream
@holly
holly / systemd-nspawn@.service
Created October 3, 2020 17:20
systemd-nspawn@.service
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Container %i
Documentation=man:systemd-nspawn(1)
@holly
holly / rss2mail.pl
Last active October 10, 2020 15:09
from rss to mail perl script
#!/usr/bin/env perl
package State ;
use strict;
use warnings;
use feature qw(say);
use base qw(Class::Accessor);
use Storable qw(lock_nstore lock_retrieve);
use Digest::SHA qw(sha256_hex);