Skip to content

Instantly share code, notes, and snippets.

View iitenkida7's full-sized avatar

iitenkida7 iitenkida7

View GitHub Profile
@iitenkida7
iitenkida7 / setup.sh
Last active March 7, 2024 15:42
setup.sh
#!/bin/bash
GITHUB=iitenkida7
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install -y docker-ce zsh make vim
sudo systemctl start docker
#!/bin/bash
# See: SpecialThanks! => https://colabmix.co.jp/tech-blog/install-zabbix-slack/
SLACK_WEBHOOKSURL='https://hooks.slack.com/services/XXXXXXXXXX/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
SLACK_USERNAME='Zabot'
SLACK_ICON=':zabbix:'
# "Send to" for Zabbix User Media Setting
@iitenkida7
iitenkida7 / setup.sh
Created August 2, 2022 10:12
xserver に linuxbrew 導入
#!/bin/bash -xue
cd
rm -rf .linuxbrew
rm -rf opt
export PATH="$PATH:/home/iitenkida7/opt/bin"
wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
tar xvfz openssl-1.0.2k.tar.gz
@iitenkida7
iitenkida7 / AwsS3Select.php
Created July 14, 2022 15:51
awsS3Select 使って あるjsonファイルを取得する例
<?php
namespace App\Libraries;
use Aws\Credentials\Credentials;
use Aws\S3\S3Client;
class AwsS3Select
{
protected S3Client $client;
@iitenkida7
iitenkida7 / getAudio.sh
Created February 4, 2022 13:01
get aws polly audio
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname $0); pwd)
DATA_JSON=${SCRIPT_DIR}/../nuxt/typing_data.json
DIST_DIR=${SCRIPT_DIR}/../nuxt/public/audio
export AWS_PAGER=""
mkdir -p ${DIST_DIR}
for WORD in $(cat ${DATA_JSON} | jq -r ".[].word") ; do
var assert = require('assert');
var request = require('request');
var util = require('util');
const requestPromise = util.promisify(request);
var newrelicApiKey = $secure.NEWRELIC_API_KEY;
var insightKey = $secure.INSIGHTKEY;
var accountId = $secure.ACCOUNTID;
var options = {
#!/bin/bash -eu
# mozjpeg 使って指定ディレクトリのjpeg ファイルを再帰的に 圧縮
# https://github.com/mozilla/mozjpeg
if [ ! -d $1 ] ;then
echo "該当ディレクトリが見当たりません" 1>&2
exit 1
fi
#!/bin/bash -x
yum -y update
amazon-linux-extras install -y php7.2 nginx1.12
yum -y install mysql
sed -i.bk 's/\(user\|group\) = apache*/\1 = nginx /g' /etc/php-fpm.d/www.conf
systemctl start nginx
systemctl enable nginx
systemctl enable php-fpm
#!/bin/bash
#概要:URLリストを渡し、「200 OK」 ステータスのものだけ表示する。
#実行:check_url_200ok @file_name@
#OUT :200 OK URL一覧
function check_url_200ok (){
for URL in $(cat $1) ; do
RESULT_CODE=$(curl -LI ${URL} -o /dev/null -s -w '%{http_code}\n' -s)
if [ "_${RESULT_CODE}" == "_200" ] ; then
echo "${URL}"
#!/bin/bash
#概要 wget で 該当URL及びリンク先のコンテンツを根こそぎダウンロードする。
# 動的サイトを静的に取得したい時に便利
# ドメイン名のディレクトリが作成されて保存される
#参考サイト
#https://sites.google.com/site/michinobumaeda/cms/geeklogwget
function get_site_all_contents(){
wget -m -k -p -E $1