Skip to content

Instantly share code, notes, and snippets.

View yuuichi-fujioka's full-sized avatar

yuuichi fujioka yuuichi-fujioka

View GitHub Profile
@yuuichi-fujioka
yuuichi-fujioka / sudoers
Created February 27, 2014 05:50
no password when sudo
ubuntu ALL=(root) NOPASSWD: ALL
wget -q -O - https://foo/bar.sh | bash
@yuuichi-fujioka
yuuichi-fujioka / urldecode.sh
Created March 5, 2014 01:31
url encode and decode with shell
echo %E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%82%8F | tr = % | nkf -WwmQ
# Create Screen with window title
screen -S ${screen_name} -t ${window_title}
# Send text to input buffer with window title
screen -S ${screen_name} -p ${window_title} -X stuff $'echo hello\r'
# Send Ctrl c to window
screen -S ${screen_name} -p ${window_title} -X stuff $'\003'
# Send up to window
@yuuichi-fujioka
yuuichi-fujioka / rc.d_register.sh
Created March 10, 2014 03:15
regist service to rc.d
sudo update-rc.d <service name> defaults
@yuuichi-fujioka
yuuichi-fujioka / print full path.sh
Created March 13, 2014 00:08
get full path of sh
echo `readlink -f "${0}"`
import openpyxl
wb = openpyxl.Workbook()
wb.save(filename='/tmp/foo.xlsx')
@yuuichi-fujioka
yuuichi-fujioka / upstart.template.conf
Created April 4, 2014 03:53
upstart config file template
description "description of service"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
pre-start script
mkdir -p /var/run/${SERVICE_NAME}
end script
post-stop script
@yuuichi-fujioka
yuuichi-fujioka / install workdpress.sh
Created April 5, 2014 15:41
Install wordpress on Ubuntu 12.04.04 LTS. see also: https://help.ubuntu.com/community/WordPress
# install wordpress and requirements
sudo apg-get install wordpress mysql-server apache2 php5 libapache2-mod-php5
# set wordpress folder to www root
# * in other way, setting wordpress folder to DocumentRoot in /etc/apache2/sites-enabled/000-default, it is the same effect as above commands.
sudo rm -fr /var/www
sudo ln -s /usr/share/wordpress /var/www
sudo chown www-data:www-data /usr/share/wordpress/ -R
# configuration wordpress and mysql
awk 'NR>1 {print $1}' file