This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z "$CLIENT_IP_ADDR" ]; then | |
echo '$CLIENT_IP_ADDR is required' | |
exit 1 | |
fi | |
sudo yum install squid -y | |
sudo systemctl enable squid | |
sudo sh -c "cat << 'EOF' > /etc/squid/squid.conf | |
# ACL My IP address | |
acl client_ip_addr src $CLIENT_IP_ADDR/32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sort() { | |
const TARGET_SHEETS = ['全て'] | |
const sheet = SpreadsheetApp.getActiveSheet() | |
if (!TARGET_SHEETS.includes(sheet.getName())) | |
return | |
const [_, targetColumn] = sheet | |
.getRange(1, 1, 1, sheet.getMaxColumns()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum groupinstall "Development Tools" -y | |
sudo yum install readline readline-devel systemd-devel -y | |
wget -O - https://ftp.postgresql.org/pub/source/v11.4/postgresql-11.4.tar.bz2 | tar jxf - | |
cd postgresql-11.4 | |
# ref: https://www.postgresql.org/docs/11/install-short.html | |
./configure --with-systemd | |
make | |
sudo make install | |
sudo adduser postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def boolify(value): | |
""" | |
Convert to bool. | |
>>> falsy = None, False, 0, b'', '', '0', 'false', 'off' | |
>>> truthy = True, 1, b'\\0', '1', 'true', 'on', 'A' | |
>>> any(boolify(x) for x in falsy) | |
False | |
>>> all(boolify(x) for x in truthy) | |
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = new Date() | |
s = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('/') | |
(async function(text, n) { | |
data = new TextEncoder().encode(text) | |
hash = await window.crypto.subtle.digest('SHA-1', data) | |
uint = new DataView(hash, 0).getUint32() | |
console.log(text, uint % n) | |
})(s, 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wt -w 0 nt -d %cd%\%1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import subprocess | |
try: | |
import cv2 | |
except ModuleNotFoundError: | |
import sys | |
subprocess.run(f'{sys.executable} -m pip install opencv-python', | |
shell=True) | |
import cv2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it mysql mysql -h host.docker.internal -u root -p --default-character-set=utf8 test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev tar wget | |
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz | |
sudo tar zxf Python-3.8.0.tgz | |
cd Python-3.8.0 | |
sudo ./configure --enable-optimizations | |
sudo make -j 4 | |
sudo make altinstall | |
python3.8 -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it debian:latest /bin/bash |
NewerOlder