Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile
@kujiy
kujiy / Vagrantfile
Last active January 22, 2022 02:02
Vagrantfile
Vagrant.configure("2") do |config|
# config.vm.box = "centos/7"
# 共有フォルダが使えるイメージ
config.vm.box = "geerlingguy/centos7"
config.vm.synced_folder "/Users/<name>/repos", "/repos"
config.vm.provision "shell", inline: <<-SHELL
sudo yum install -y vim net-tools iputils
SHELL
config.vm.define :node1 do |node|
@kujiy
kujiy / gist:2434ffeb724cdfe5169a98618ca1b04b
Last active November 18, 2021 00:36
discussion forum highlight
@-moz-document regexp("https://my.uopeople.edu/mod/.*") {
article > div > article
{
box-shadow: -20px 0 0 #76AFB5
}
article > div > article > div > article
{
box-shadow: -20px 0 0 #AAA
}
}
@kujiy
kujiy / rename.py
Created October 17, 2021 01:58
Rename files in dirs with the dir names
"""
# rename files in dirs
current_dir
|- dir1
|- 001.jpg
|- 002.jpg
|- dir2
|- 001.jpg
|- 002.jpg
@kujiy
kujiy / cent7.sh
Last active October 1, 2021 08:27
Let's Encrypt DST Root CA X3 Expiration: Work Around 1
# cleanup
mv /etc/pki/ca-trust/source/blacklist/* /tmp
mv /etc/pki/ca-trust/source/anchors/* /tmp
# fix the issue
cd /etc/pki/ca-trust/source/blacklist
wget -O dst.pem https://crt.sh/?d=0687260331A72403D909F105E69BCF0D32E1BD2493FFC6D9206D11BCD6770739
cd /etc/pki/ca-trust/source/anchors
wget --no-check-certificate https://letsencrypt.org/certs/isrgrootx1.pem
@kujiy
kujiy / gist:299f5143b6df066b268a36f7fb211e27
Created September 4, 2021 06:52
authorized_keys-from-Github.sh
USER=kujiy
curl -s https://api.github.com/users/$USER/keys | jq -r ".[0].key" > ~/.ssh/authorized_keys
chmod 600 authorized_keys
@kujiy
kujiy / Makefile
Created November 5, 2020 07:26 — forked from robstradling/Makefile
Parse Chrome EV metadata
chrome_ev:
gcc -o chrome_ev chrome_ev.cc
@kujiy
kujiy / Dockerfile
Last active April 7, 2022 13:09
Dockerfile for Nginx with custom modules
FROM alpine:3.10.1
LABEL maintainer "Adrian B. Danieli - https://github.com/sickp"
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]
ENV NGINX_VERSION 1.19.1
RUN set -ex \
@kujiy
kujiy / commit-msg
Created October 9, 2019 03:26
Add the branch name to commit message
#!/bin/sh
#ブランチ名を取得
Branch="$(git rev-parse --abbrev-ref HEAD)"
#コミットメッセージの最初にブランチ名を追加
#echo "Hook is working..."
#echo "コミットメッセージにbranch名を強制付与しています..."
@kujiy
kujiy / nginx.conf
Created July 31, 2019 16:46 — forked from hiboma/nginx.conf
Nginx+Lua+Redis で動的upstream
worker_processes 1;
error_log /dev/stderr debug;
events {
worker_connections 256;
}
http {
server {
@kujiy
kujiy / phpmyadmin-dblist.py
Created December 14, 2017 01:42
A tool creating comma-separated server list for docker phpmyadmin container #
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# A tool creating comma-separated server list for docker phpmyadmin container
# Make these lines from python dictionary
#
## PMA_VERBOSES=server1,server2,server3,...
## PMA_HOSTS=192.168.1.2,10.0.0.200,172.16.1.3,...
## PMA_PORTS=3306,13306,3307,...
#
# How to use