Skip to content

Instantly share code, notes, and snippets.

View ksato9700's full-sized avatar

Ken Sato ksato9700

View GitHub Profile
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install <python-version>
function update-awscli-mfa() {
if [ "x$1" = "x" ]; then
echo "update-awscli-mfa <mfa code>"
return 1
fi
device=$(sed -n '/^\[mfa/,/^\[/p' ~/.aws/credentials|awk '$1=="aws_mfa_device"{print $3}')
if [ "x$device" = "x" ]; then
echo "no mfa profile or aws_mfa_device found in ~/.aws/credentials"
return 2
@ksato9700
ksato9700 / errorlog.txt
Created February 10, 2019 00:57
schema-utils test error log
$ yarn run test
yarn run v1.13.0
$ jest --env node --verbose --coverage
FAIL test/index.test.js
● Test suite failed to run
custom keyword definition is invalid: data/errors should be boolean
at Ajv.addKeyword (node_modules/ajv/lib/keyword.js:65:13)
at Object.<anonymous>.module.exports (node_modules/ajv-errors/index.js:10:7)
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
$ cat << EOF > .gitattributes
*.yaml export-ignore
EOF
git archive --worktree-attributes --format=tgz HEAD > repo.tgz
@ksato9700
ksato9700 / .bash_profile
Last active February 8, 2016 02:07
prompt setting for future pyenv-virtualenv
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
function updatePrompt {
PS1="\u@\h:\W\$ "
if [[ $VIRTUAL_ENV != "" ]]; then
PS1="(${VIRTUAL_ENV##*/})$PS1"
fi
}
export PROMPT_COMMAND='updatePrompt'
@ksato9700
ksato9700 / gist:6c2141fc662906a03531
Last active August 29, 2015 14:19
boot2docker proxy setting
boot2docker ssh
sudo sh -c "cat <<EOF > /var/lib/boot2docker/profile"
export HTTP_PROXY=<proxy>
export HTTPS_PROXY=<proxy>
export NO_PROXY=/var/run/docker.sock
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
@ksato9700
ksato9700 / emacs.rb
Last active January 13, 2016 06:25
emacs 24.4 homebrew formula with japanese option
require "formula"
class Emacs < Formula
homepage "https://www.gnu.org/software/emacs/"
stable do
url "http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.xz"
mirror "https://ftp.gnu.org/pub/gnu/emacs/emacs-24.4.tar.xz"
sha256 "47e391170db4ca0a3c724530c7050655f6d573a711956b4cd84693c194a9d4fd"
@ksato9700
ksato9700 / gist:8abc093ebf3a2cdc15c2
Created October 22, 2014 00:25
Install Xcode command line tool on command line
$ xcode-select --install
@ksato9700
ksato9700 / gist:11131309
Created April 21, 2014 03:15
Setting to ignore lid switch of note pc
/etc/systemd/logind.conf
HandleLidSwitch=ignore