Skip to content

Instantly share code, notes, and snippets.

@yaegashi
yaegashi / hosts
Last active August 29, 2015 14:05
https://github.com/ansible/ansible/issues/8633 test case on a role with only library modules
# /hosts
localhost ansible_connection=local
#!/bin/sh
set -e
if test $# -lt 2; then
echo "Usage: $0 <common name> <output> [<start> <end>]" >&2
exit 1
fi
cn=$1
@yaegashi
yaegashi / card.sh
Last active August 29, 2015 14:23
Card hand generator & matcher http://unix.stackexchange.com/a/211717/116972
#!/bin/bash
# This version conforms to Bash 3.2.53 on OS X.
stab=('\e[0;31;47m ♦' '\e[0;31;47m ♥' '\e[0;30;47m ♠' '\e[0;30;47m ♣')
ntab=(2 3 4 5 6 7 8 9 10 J Q K A)
match() {
for i; do
printf " ${stab[$((i/13))]}${ntab[$((i%13))]}\e[0m"
@yaegashi
yaegashi / gist:2361136
Created April 11, 2012 18:22
Git pre-commit hook script to verify file encodings.
#!/usr/bin/env perl
# Git pre-commit hook script to verify file encodings.
# Works with Perl 5.8. The bundled perl in msysgit is also supported.
# Copyright (C) 2012 Takeshi Yaegashi
# Encodings allowed to be committed.
my @allowed = qw/ascii utf8/;
# Encodings possible to be seen - optional.
@yaegashi
yaegashi / monitrc
Created July 13, 2012 01:11
Minimal monit config example
# /etc/monit/monitrc
set daemon 60
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
set eventqueue basedir /var/lib/monit/events slots 100
set mailserver mail.example.com
set alert monit@example.com
set httpd port 2812 and use address localhost allow localhost
include /etc/monit/conf.d/*
@yaegashi
yaegashi / setup-redmine.sh
Created November 12, 2012 12:36
Set up a redmine instance with sub-uri: http://localhost:8080/redmine
#!/bin/sh -x
export RAILS_ENV=production
export REDMINE_LANG=ja
git clone https://github.com/redmine/redmine
cd redmine
rm config.ru
echo 'gem "unicorn"' >Gemfile.local
cat <<EOF >config/database.yml
$RAILS_ENV:
adapter: sqlite3
#!/bin/sh
# Start ssh-agent and register environment variables permanently in HKCU.
# Copyright (C) 2013 YAEGASHI Takeshi <t@keshi.org>
# Use a fixed path for the ssh-agent socket endpoint.
# SSH_FIXED_SOCK="/tmp/ssh-agent-$(id -u).sock"
eval $(ssh-agent -k)
@yaegashi
yaegashi / a
Created September 30, 2016 02:29
a
$ ansible-playbook -i localhost, basicexp-playbook.yml
PLAY [localhost] **************************************************************
TASK: [OK: ['a', 'b', 'c']] ***************************************************
ok: [localhost] => {
"msg": [
"a",
"b",
"c"
@yaegashi
yaegashi / DxDiag.txt
Created January 18, 2020 21:33
DxDiag output on Azure Standard_NV4as_v4
------------------
System Information
------------------
Time of this report: 1/18/2020, 21:25:32
Machine name: d-tmpy1-win1
Machine Id: {DC52ECD2-6A96-4BED-A6AA-21A61A740026}
Operating System: Windows Server 2019 Datacenter 64-bit (10.0, Build 17763) (17763.rs5_release.180914-1434)
Language: English (Regional Setting: English)
System Manufacturer: Microsoft Corporation
System Model: Virtual Machine