Skip to content

Instantly share code, notes, and snippets.

View GitHub30's full-sized avatar
🌴
On vacation

GitHub30

🌴
On vacation
  • Osaka, Japan
View GitHub Profile
set -x \
&& yum install -y gcc \
&& curl -s 'http://jp.softether-download.com/files/softether/v4.27-9666-beta-2018.04.21-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.27-9666-beta-2018.04.21-linux-x64-64bit.tar.gz' | tar xz \
&& cd vpnclient/ \
&& make i_read_and_agree_the_license_agreement \
&& ./vpnclient start \
&& set +x
set -xe \
&& sudo apt update \
&& sudo apt install -y git make gcc build-essential libreadline-dev libssl-dev libncurses-dev zlib1g-dev \
&& git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git \
&& cd SoftEtherVPN/ \
&& git checkout refs/tags/5.1 \
&& ./configure \
&& make \
&& sudo make install \
&& set +xe
async function avatarUrl(url) {
const html = await fetch('https://allow-any-origin.appspot.com/' + url).then(res => res.text());
const doc = new DOMParser().parseFromString(html, "text/html");
if (url.includes('youtube')) {
return doc.querySelector('img[src$="photo.jpg"]').src;
} else if (url.includes('twitter')) {
return doc.querySelector('.ProfileAvatar-image').src;
}
}
@GitHub30
GitHub30 / play-with-docker.sh
Last active July 10, 2018 20:20 — forked from humbertodias/gist:3138cf7753b6814d37b606764fb9efaf
Exporting Mysql server to internet
# port forwarding(-p 3306:3306) required
docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7 # play with docker (https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded/49944625#49944625#answer-49944625 for mysql8)
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
# tunnel online(free authtoken required)
./ngrok tcp 3306
# In local
ORCLCDB=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLCDB.localdomain)))
ORCLPDB1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLPDB1.localdomain)))
@GitHub30
GitHub30 / config.txt
Created July 18, 2018 11:54
java -jar openapi-generator-cli.jar config-help -g spring
CONFIG OPTIONS
sortParamsByRequiredFlag
Sort method arguments to place required parameters before optional parameters. (Default: true)
ensureUniqueParams
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)
allowUnicodeIdentifiers
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)
sudo apt-get install -y python3-gtts sox libsox-fmt-mp3
echo 'こんにけわに' | gtts-cli -l ja - | play -t mp3 -
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
sudo apt-get install -y alien
wget https://download.canon.jp/pub/driver/bj/linux/bjfilter-common-2.50-3.i386.rpm https://download.canon.jp/pub/driver/bj/linux/bjfilter-pixusip3100-2.50-2.i386.rpm https://download.canon.jp/pub/driver/bj/linux/bjfilter-pixusip3100-lprng-2.50-2.i386.rpm
sudo alien -i --scripts bjfilter-common-2.50-3.i386.rpm bjfilter-pixusip3100-2.50-2.i386.rpm bjfilter-pixusip3100-lprng-2.50-2.i386.rpm
sudo ln -s /usr/lib/libpng12.so.0 /usr/lib/libpng.so.2
sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
sudo ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml.so.1
firefox https://wiki.ubuntu.com/HardwareSupportComponentsPrinters/PIXMA
@GitHub30
GitHub30 / healthcheck.sh
Created August 20, 2018 23:24
Oracle database health check with docker event
docker events --filter 'container=oradb' --filter 'event=health_status' --format '{{.Status}}' | while read status; do [ "$status" == "health_status: healthy" ] && pkill -INT -f 'docker events --filter container=oradb'; done