Skip to content

Instantly share code, notes, and snippets.

@juice500ml
juice500ml / docker.txt
Created July 27, 2016 18:25
docker cheatsheet
docker-compose up / down
docker images
docker rm {{ ps -al }}
docker rmi {{ image id }}
docker ps -a
ex)
docker-compose run web bash
@juice500ml
juice500ml / mail.py
Last active July 27, 2016 18:16
python2 smtp mail sender func
#!/usr/bin/python
# -*- coding:utf-8 -*-
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
from email import Utils
from email.header import Header
@juice500ml
juice500ml / alanpeabody-juice500.zsh-theme
Created February 25, 2016 06:05
zsh theme(modified from alanpeabody)
local user='%{$fg[magenta]%}%n%{$reset_color%}'
local pwd='%{$fg[blue]%}%~%{$reset_color%}'
local tme='%{$fg[red]%}⌚ %*%{$reset_color%}'
local rvm=''
if which rvm-prompt &> /dev/null; then
rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
else
if which rbenv &> /dev/null; then
rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
@juice500ml
juice500ml / .bashrc
Last active November 14, 2018 07:29
dotfiles
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@juice500ml
juice500ml / brightness.sh
Created February 16, 2016 08:34
input: turn off/on seconds of monitor brightness.
id=$(xrandr | sed -n 2p | awk '{print $1}')
read -p "Enter turned on seconds : " on
read -p "Enter turned off seconds : " off
while [ 1 ]
do
xrandr --output $id --brightness 1
sleep $on
xrandr --output $id --brightness 0