Skip to content

Instantly share code, notes, and snippets.

View aoki's full-sized avatar
🔰
I started learn programming

aoki aoki

🔰
I started learn programming
View GitHub Profile
@aoki
aoki / sbt-suppress-warnings.scala
Last active March 20, 2018 04:15
Suppress SBT warnings
/** Filter messages sent through loggers produced by `coreLogMgr`.
*
* @param logf Invoke for each acquired logger; invoke its result
* for each log message that comes in.
* @see https://xuwei-k.hatenablog.com/entry/20141230/1419930900
* @see https://github.com/ermine-language/ermine-legacy/blob/d576a7b97/build.sbt#L39-L59
* @see https://github.com/ermine-language/ermine-legacy/blob/d576a7b97/project/Build.scala#L42-L61
*/
def filterLogs(
coreLogMgr: LogManager

Commit Emoji

Emoji Description
📝 Update documents or comments
🔌 Update plugins or library
🎉 Release
🔧 Update build tools
Refactoring/Formatting
@aoki
aoki / cors-check.js
Last active October 12, 2017 14:41
CORS check js
var url = 'https://github.com/ringohub';
var req = new XMLHttpRequest();
req.open('GET', url);
req.onreadystatechange = function () {
switch (req.readyState) {
case 0:
console.log('UNSENT');
break;
case 1:
console.log('OPEND');
@aoki
aoki / ansh.sh
Created October 12, 2017 04:38
Interactive ansible-playbook execution script.
#!/bin/bash -eu -o pipefail
trap 'printf "\nAborted. Bye 👋\n"; exit 1' 1 2 3 15
inventory=$(ls inventories | fzf --reverse --header "📦 Choose inventory")
echo "📦 : ${inventory}"
hosts=$(cat inventories/${inventory} | grep -v '\[' | grep -v '^$' | grep -v '=' | fzf -m --reverse --header "✨ Choose target hosts"| tr '\n' ',' | rev | cut -c 2- | rev)
echo "✨ : ${hosts}"
case ${inventory} in
@aoki
aoki / ansible-test-docker.sh
Last active October 12, 2017 14:40
Ansible execution test scripts on docker.
#!/bin/bash -eu
read -p "📦 Input component (e.g. web/batch): " component
read -p "🎫 Input task if you want to choice start task (e.g. 'Install docker-compose'): " startAt
read -p "💡 Using --step? (y/n): " step
case $step in
[yY]|[yY]es|yes|YES) step='--step';;
*) unset step;;
esac
@aoki
aoki / ssh-host.sh
Last active October 12, 2017 04:41
Set iTerm profile from server environment before ssh login.
#!/bin/bash
if [[ "$@" =~ dev ]]; then
PROFILE='Develop'
elif [[ "$@" =~ stg ]]; then
PROFILE='Stage'
elif [[ "$@" =~ prod ]]; then
PROFILE='Production'
fi
@aoki
aoki / homebrew-template.sh
Last active October 12, 2017 04:46
Inject variables into a homebrew formula.
f='() {eval "$(echo "cat <<EOF\\n$(cat $1)\\nEOF")"}' \
version=\$(grep "# @version" foo | cut -d ' ' -f 3) \
website=\$(grep "# @website" foo | cut -d ' ' -f 3) \
sha256=\$(shasum -a 256 foo | cut -d ' ' -f 1) \
eval $f formula > foo.rb
@aoki
aoki / 00.md
Created October 9, 2015 05:42 — forked from hayajo/00.md
運用エンジニア向け シェルの基礎とSSH Tips
@aoki
aoki / openIdea.sbt
Last active October 12, 2017 05:07
Open IntelliJ IDEA from sbt
commands += BasicCommands.newAlias("openIdea",
s"""eval sys.process.Process("/Applications/IntelliJ IDEA 13.app/Contents/MacOS/idea" :: "${(baseDirectory in LocalRootProject).value}" ::Nil).!""")
@aoki
aoki / packer_build_sl65.log
Created June 2, 2014 16:13
Packer build log for Scientific linux 6.5
$ packer build -only=virtualbox-iso template.json
virtualbox-iso output will be in this color.
==> virtualbox-iso: Downloading or copying Guest additions checksums
virtualbox-iso: Downloading or copying: http://download.virtualbox.org/virtualbox/4.3.10/SHA256SUMS
==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: http://download.virtualbox.org/virtualbox/4.3.10/VBoxGuestAdditions_4.3.10.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://ftp.riken.jp/Linux/scientific/6.5/x86_64/iso/SL-65-x86_64-2014-01-27-Install-DVD.iso
==> virtualbox-iso: Starting HTTP server on port 8081