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 / 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
@yuuichi-fujioka
yuuichi-fujioka / while.read.line.sh
Created April 8, 2014 06:04
while read line sample
cat hoge.txt | while read line
do
echo $line
done
whle read line
do
echo $line
done < hoge.txt
@yuuichi-fujioka
yuuichi-fujioka / su_git.sh
Created April 16, 2014 23:58
su to git that login shell is git-bash.
sudo su -s /bin/bash - git
import string
import random
length = 10
print ''.join([random.choice(string.ascii_letters + string.digits) for i in range(length)])
@yuuichi-fujioka
yuuichi-fujioka / install package to qcow image.sh
Created April 17, 2014 04:14
install apt-get package to qcow2 image
sudo apt-get install qemu-utils
sudo modprobe nbd
sudo qemu-nbd --connect=/dev/nbd0 /full/path/to/qcow2/image/file
sudo mkdir /mnt/ubuntu
sudo mount /dev/nbd0p1 /mnt/ubuntu
@yuuichi-fujioka
yuuichi-fujioka / do unit test in batch.bat
Created April 21, 2014 15:09
Do unit test with unity test tools on windows
"d:\Program Files (x86)\Unity\Editor\Unity.exe" -batchmode -executeMethod UnityTest.Batch.RunUnitTests -projectPath "D:\workspaces\Unity\Template" -logFile .\unittest.log -resultFilePath=D:\workspaces\Unity\Template
VPNCMD="sudo /usr/local/vpnserver/vpncmd localhost:443 /SERVER /CMD"
# Create virtual hub
${VPNCMD} HubCreate ${HubName} /PASSWD:admin
# Create local bridge(connect to physical device)
${VPNCMD} BridgeCreate ${HubName} /DEVICE:${phy_dev_name:-eth0}
# Create local bridge(create tap interface)
@yuuichi-fujioka
yuuichi-fujioka / vpnbridge.sh
Created May 28, 2014 00:17
Softether VPN Bridge
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnbridge/vpnbridge
LOCK=/var/lock/subsys/vpnbridge
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
dd if=/dev/cdrom of=~/foo.iso