Skip to content

Instantly share code, notes, and snippets.

View koi-chan's full-sized avatar

koi-chan koi-chan

View GitHub Profile
# /etc/default/
WEB_CONCURRENCY=2
RACK_MAX_THREADS=2
require 'json'
require 'time'
unless ARGV.length == 1
$stderr.puts("Usage: ruby #{File.basename($PROGRAM_NAME)} JSON")
abort
end
entries = []
begin
@koi-chan
koi-chan / clean-migration.sql
Created June 25, 2019 13:29
conversation_message-show_create_table.sql
CREATE TABLE `conversation_messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`channel_id` int(11) DEFAULT NULL,
`timestamp` datetime NOT NULL,
`nick` varchar(64) NOT NULL DEFAULT '',
`message` text,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`type` varchar(255) DEFAULT NULL,
`irc_user_id` int(11) NOT NULL DEFAULT '0',
@koi-chan
koi-chan / ドイツ語特殊文字入力.js
Created September 23, 2016 02:19
Mery 用のマクロファイル集
// -----------------------------------------------------------------------------
// ドイツ語特殊文字
//
// Copyright (c) koi-chan. All Rights Reserved.
// www: http://cre.jp/koi-chan/
// Twitter: @koichan779
// License: MIT
// -----------------------------------------------------------------------------
var special = {
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>IRCS</short>
<description>Internet Relay Chat over SSL</description>
<port protocol="tcp" port="6697" />
</service>
[Unit]
Description=Daily renewal of Let's encrypt's certificates
[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=Let's Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/local/bin/certbot-auto renew --standalone --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'
ExecStartPost=/bin/systemctl reload charybdis.service
#!/usr/bin/ruby
#--*-coding:utf-8-*--
Encoding.default_external='utf-8' if defined?(Encoding) && Encoding.respond_to?('default_external')
require 'rubygems'
require 'cgi'
require 'fcgi'
require 'logger'
$logger = Logger.new('./fcgilog.txt')
[Unit]
Description=DodontoF spawn-fcgi
After=nginx.service
Wants=nginx.service
[Service]
Type=forking
User=nginx
Group=nginx
PIDFile=/home/nginx/dodontof.example.com/dodontof.pid
# vim: filetype=nginx
server {
listen 80;
server_name dodontof.example.com;
root /home/nginx/dodontof.example.com/public_html;
index index.html index.htm;
client_max_body_size 128M;