Skip to content

Instantly share code, notes, and snippets.

View reilee's full-sized avatar
😫
I may be slow to respond.

Reilee reilee

😫
I may be slow to respond.
  • Rakuten
  • Tokyo
View GitHub Profile
@reilee
reilee / docker-log.sh
Created May 8, 2020 02:59
Truncate docker container log
export CONTAINER_ID=<container_name_or_id>
truncate -s 0 $(docker inspect --format='{{.LogPath}}' ${CONTAINER_ID})
## or
echo "" > $(docker inspect --format='{{.LogPath}}' ${CONTAINER_ID})
@reilee
reilee / ssl.sh
Created April 7, 2020 07:42
CLI: check SSL expiration
TARGET_DOMAIN='www.example.com'
echo | openssl s_client -connect ${TARGET_DOMAIN}:443 2> /dev/null | openssl x509 -noout -enddate
@reilee
reilee / orphan-branch.sh
Created February 27, 2020 07:56
Create empty branch in git
git checkout --orphan EMPTY-BRANCH
git rm -rf .
git commit --allow-empty -m "root commit"
git push origin EMPTY-BRANCH
@reilee
reilee / yum-failed.sh
Created February 27, 2020 06:25
rebuild RPM database
cd /var/lib/rpm/
## backup
for i in `ls | grep 'db.'`;do mv $i $i.bak;done
rpm --rebuilddb
yum clean all