Skip to content

Instantly share code, notes, and snippets.

View phanect's full-sized avatar

Jumpei Ogawa phanect

View GitHub Profile

How to show total directory size of directories in current directory:

$ du --max-depth=1 -h ./
47M     ./foo
2.0M    ./bar
6.6G    ./hoge
4.0K    ./fuga
docker rm --force $(docker ps --all --quiet); docker rmi --force $(docker images --all --quiet); docker volume rm $(docker volume ls --quiet)
@phanect
phanect / dropnhalt
Last active May 28, 2016 21:57
Shutdown computer when Dropbox sync finished
dropbox start
while [[ $(dropbox status) != "Up to date" ]]; do
sudo echo $(dropbox status)
sleep 120
done && sudo shutdown now
@phanect
phanect / kdejp-pukiwiki-to-static.py
Last active May 12, 2024 23:26
A script used for server migration from kde.gr.jp to jp.kde.org in 2014. This script exported all pages of Pukiwiki to static html pages.
#!/usr/bin/env python
from bs4 import BeautifulSoup
import urllib2
import os
import random
import string
urls = []