Skip to content

Instantly share code, notes, and snippets.

@msnoigrs
msnoigrs / CaddyFile
Last active September 13, 2018 09:53
Setting caddy for gitlab
https://gitlab.example.home {
log /var/log/caddy/gitlab.access.log {
rotate_size 50
rotate_age 90
rotate_keep 20
rotate_compress
}
errors /var/log/caddy/gitlab.errors.log {
404 /opt/gitlab/embedded/service/gitlab-rails/public/404.html
422 /opt/gitlab/embedded/service/gitlab-rails/public/422.html
@msnoigrs
msnoigrs / main.go
Created February 4, 2018 05:44 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
#!/bin/bash
CPUQuota=90
CPUWeight=50
MemoryMax=
EMERGE=$HOME/bin/autoemerge
props=
if [ -n "${CPUQuota}" ]; then
props+="-p CPUQuota=${CPUQuota}% "
@msnoigrs
msnoigrs / 01-input
Created March 13, 2017 06:55
/etc/X11/xinit/xinitrc.d/01-input
#! /bin/bash
export XMODIFIERS="@im=fcitx"
export XIM=fcitx
export XIM_PROGRAM=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
@msnoigrs
msnoigrs / TLPDB.DB.patch
Last active January 27, 2017 06:59
TexLive 2016をWindowsにインストールするときに、"Permission denied" でランダムに失敗する場合、tlpkg/TeXLive/TLPDB.pmの以下の位置にwaitを入れるとうまくいく。close後のsleepが重要。必要であればsleepする時間を長くする。
--- TLPDB.pm.orig 2016-05-16 11:49:27.000000000 +0900
+++ TLPDB.pm 2017-01-27 15:25:47.149889400 +0900
@@ -479,9 +479,17 @@
my $path = $self->location;
mkdirhier(dirname($path));
my $tmppath = "$path.tmp";
- open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!";
+ my $count = 0;
+ while(1) {
+ open(FOO, ">$tmppath") && last;
@msnoigrs
msnoigrs / ctrlbsime.ahk
Last active January 27, 2017 06:58
Ctrl + backslash でIMEをトグルしたい。IME.ahkは検索して取ってきてください。
#Include IME.ahk
^\::
getIMEMode := IME_Get()
if (%getIMEMode% = 0)
{
IME_SET(1)
return
}
else
{
[path]
emacs=myemacs.bat
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force
DetectHiddenWindows,On
ini_file = StartEmacs.ini
path_emacs := read_ini_file_path(ini_file)
@echo off
set PATH=C:\emacs-25.1\bin;C:\WinPython-64bit-3.5.2.3Qt5\python-3.5.2.amd64;C:\WinPython-64bit-3.5.2.3Qt5\python-3.5.2.amd64\Scripts;C:\msys64\usr\bin;%PATH%
set NLS_LANG=Japanese_Japan.AL32UTF8
cd c:\XXXXXXXX
c:\emacs-25.1\bin\runemacs.exe
/*
The MIT License (MIT)
Copyright (c) 2014-2015 Russel Lindsay
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is