Skip to content

Instantly share code, notes, and snippets.

tknr tknr

View GitHub Profile
@tknr
tknr / optimize_sqlite_db.sh
Created Mar 21, 2019
optimize sqlite db files
View optimize_sqlite_db.sh
## http://d-goo.hatenablog.com/entry/2013/07/30/124148
for db in `find ~/ -name *.db`;do echo ${db};sqlite3 ${db} vacuum; sqlite3 ${db} reindex;done
View install_maildev.sh
#!/bin/bash -x
echo "this command must be executed in root user."
if [ ${EUID:-${UID}} != 0 ]; then
echo 'do this with being root . for example : sudo su - '
exit 1;
fi
## install maildev
yum -y install nodejs npm postfix
View maildev
#! /bin/bash
### BEGIN INIT INFO
# Provides: maildev
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Maildev
# Description: This file starts and stops Maildev server
#
View update_mysqltuner.sh
#!/bin/bash -x
## https://github.com/major/MySQLTuner-perl
wget http://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
chmod +x mysqltuner.pl
View gist:616da71c15d636afaeec28f3dab16494
# Overview — Livestreamer 1.12.2 documentation http://docs.livestreamer.io/index.html
su -
pip install livestreamer
exit
livestreamer <youtube url> best -o <output filename>
@tknr
tknr / rename_zen2han
Created Jun 13, 2017
rename zenkaku alphabet to hankaku alphabet
View rename_zen2han
export IFS=$'\n';for filename in `ls -1`;do mv -v ${filename} `echo ${filename}|nkf -m0Z1 -W -w`;done
You can’t perform that action at this time.