Choose a box (vagrant template) you like.
$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up
Choose a box (vagrant template) you like.
$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up
require 'base64' | |
require 'json' | |
require 'net/https' | |
def detect_text_from(image) | |
api_key = 'YOUR-API-KEY' | |
api_url = "https://vision.googleapis.com/v1/images:annotate?key=#{api_key}" | |
enc_image = Base64.strict_encode64(File.new(image, 'rb').read) |
import csv | |
import random | |
# 1000000 and 52 == roughly 1GB (WARNING TAKES a while, 30s+) | |
rows = 1000000 | |
columns = 52 | |
def generate_random_row(col): | |
a = [] | |
l = [i] |
#!/bin/bash -eu | |
echo -n "enter sudo password: " | |
stty -echo | |
read password | |
stty echo | |
echo | |
wiki_dir=/var/www/html/wiki | |
backup_file="~/backup/`/bin/date +%Y%m%d%H%M%S`_wiki.tar.gz" |
#!/bin/bash -eu | |
# ---------------------------------------------------------------------- | |
# argument validation and initialize | |
# | |
if [ $# -eq 2 ]; then | |
echo -e "*** if you want to stop this script, exec --- kill -TERM -$$ ---" | |
ip_list=$1 | |
interval=$2 | |
else |
#!/bin/bash | |
echo | |
echo "------------------------------------------------------------------" | |
echo "HOSTNAME : `hostname`" | |
echo "DATE : `date \"+%Y-%m-%d %H:%M:%S\"`" | |
echo "USER : `whoami`" | |
echo "PWD : `pwd`" | |
echo "------------------------------------------------------------------" | |
echo |
#!/bin/bash | |
# argument validation | |
if [ $# -eq 2 ];then | |
target=$1 | |
interval=$2 | |
log="`/bin/date +%Y%m%d%H%M%S`_`/bin/hostname -i`---$1_ping.log" | |
else | |
echo -e "USAGE: ./ping.sh <IP_ADDRESS or HOSTNAME> <PING_INTERVAL[sec]>\n" | |
exit 1 |
# conding: utf-8 | |
def random_string( length ) | |
str = ('a'..'z').to_a + ('A'..'Z').to_a + | |
('0'..'9').to_a + ['-', '+', '_', '@', '=', '&', '$', '#', '?'] | |
Array.new( length ){ str[rand( str.size )] }.join | |
end | |
# ------------------------------------------------------------------- |