Skip to content

Instantly share code, notes, and snippets.

View tsuyo's full-sized avatar
💭
Where there is a will, there is a way

Tsuyoshi Miyake tsuyo

💭
Where there is a will, there is a way
View GitHub Profile
@tsuyo
tsuyo / htpasswd_batch.py
Created October 4, 2021 12:06
htpasswd_batch.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from subprocess import Popen,PIPE
dav_svn_passwd = '/etc/apache2/dav_svn.passwd'
if len(sys.argv) < 2:
print "Usage:", sys.argv[0], "<passwd.txt>"
@tsuyo
tsuyo / create_git_repo_on_local.sh
Created October 4, 2021 11:58
Create a git repo on local disk
#!/bin/sh
# variables
git_location=$1
proj_name=`basename $PWD`
# error check
[ "${git_location}" = "" ] && echo "usage: $0 <git_dir>" && exit
# git commands
@tsuyo
tsuyo / create_mysql_db.sh
Created October 4, 2021 11:54
Create a MySQL Database
usage() {
echo "Usage: $0 <DB_NAME> <DB_USER> <DB_PASSWORD>"
exit
}
DB_NAME=$1
DB_USER=$2
DB_PASSWORD=$3
[ -z "${DB_NAME}" -o -z "${DB_USER}" -o -z "${DB_PASSWORD}" ] && usage
@tsuyo
tsuyo / rename-rt-repo.sh
Last active May 11, 2021 09:55
Rename a JFrog Artifactory repository
#!/bin/bash
# Rename a JFrog Artifactory repository
# See https://jfrog.com/knowledge-base/is-there-a-way-to-rename-a-repository/ for details
usageAndExit() {
echo "Usage: "
echo " $ export ARTIFACTORY_USER=..."
echo " $ export ARTIFACTORY_PASS=..."
echo " $ $0 -u <ARTIFACTORY_URL> [-d] <OLD_REPO> <NEW_REPO>"
@tsuyo
tsuyo / dashboard-adminuser.sh
Created May 7, 2020 13:09
Quick installation & configuration for k8s dashboard on Mac
#!/bin/bash
cat > /tmp/dashboard-adminuser-1.yaml << EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF

Jenkins Installation and Setup

@tsuyo
tsuyo / jfrog_artifactory_installation_and_setup.md
Last active April 11, 2020 10:57
JFrog Artifactory Installation and Setup

Standalone on Mac / Linux (tested on Mac)

Download Artifactory or Download Artifactory from Bintray

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home
$ export JFROG_HOME=/opt/jfrog
$ tar -C $JFROG_HOME -zxvf jfrog-artifactory-pro-7.2.1-darwin.tar.gz
$ ln -s /opt/jfrog/artifactory-pro-7.2.1 $JFROG_HOME/artifactory-pro
$ $JFROG_HOME/artifactory-pro/app/bin/artifactoryctl start
hdfs dfs -mkdir input
hdfs dfs -put ${HADOOP_HOME}/etc/hadoop/*.xml input
hadoop jar ${HADOOP_HOME}/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar grep input output 'dfs[a-z.]+'
hdfs dfs -cat output/*
create 'test', 'cf'
list 'test'
describe 'test'
put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'
scan 'test'
get 'test', 'row1'
disable 'test'
enable 'test'
@tsuyo
tsuyo / README.md
Last active March 4, 2018 12:51
Toggle input sources (English or Japanese) by shift + space in Karabiner-Elements

How to use

  1. Copy this "shift_space_input_source.json" to ~/.config/karabiner/assets/complex_modifications/
  2. Karabiner-Elements -> Preferences -> Complex Modifications -> Add rule -> Enable "Toggle input sources (English or Japanese) by shift + space"