Skip to content

Instantly share code, notes, and snippets.

@lazykyama
Last active August 29, 2015 14:27
Show Gist options
  • Save lazykyama/2c967f282c84cce06790 to your computer and use it in GitHub Desktop.
Save lazykyama/2c967f282c84cce06790 to your computer and use it in GitHub Desktop.
Vagrantfiles for NLP env. 予告なく削除することがあるので注意。
--- .bash_profile.org 2015-05-19 17:23:30.458170562 +0200
+++ .bash_profile 2015-05-19 18:29:47.112947351 +0200
@@ -7,6 +7,11 @@
# User specific environment and startup programs
-PATH=$PATH:$HOME/.local/bin:$HOME/bin
+PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/mecab/mecab-0.996/bin
export PATH
+export WORKON_HOME=$HOME/.virtualenvs
+source /usr/bin/virtualenvwrapper.sh
+
+export LESS='-R'
+export LESSOPEN='| /usr/bin/src-hilite-lesspipe.sh %s'
--- .bashrc.org 2015-05-25 07:23:34.889811949 +0900
+++ .bashrc 2015-05-25 07:22:14.723676186 +0900
@@ -10,3 +10,5 @@
# User specific aliases and functions
+alias mecab-with-neolog='mecab -d /usr/local/mecab/mecab-0.996/lib/mecab/dic/mecab-ipadic-neologd'
+
/usr/local/mecab/mecab-0.996/lib
--- mecabrc.org 2015-05-19 18:37:29.984523228 +0200
+++ mecabrc 2015-05-19 18:38:06.448229128 +0200
@@ -5,6 +5,8 @@
;
dicdir = /usr/local/mecab/mecab-0.996/lib/mecab/dic/ipadic
+dicrc = /usr/local/mecab/mecab-0.996/lib/mecab/dic/ipadic
+
; userdic = /home/foo/bar/user.dic
; output-format-type = wakati
--- /vagrant/src-hilite-lesspipe.sh.org 2015-05-19 17:40:49.805894000 +0200
+++ /usr/bin/src-hilite-lesspipe.sh 2015-05-19 17:42:12.628334191 +0200
@@ -3,9 +3,9 @@
for source in "$@"; do
case $source in
*ChangeLog|*changelog)
- source-highlight --failsafe -f esc --lang-def=changelog.lang --style-file=esc.style -i "$source" ;;
+ source-highlight --failsafe -f esc --lang-def=changelog.lang --style-file=$HOME/.source-highlight/wombat.style -i "$source" ;;
*Makefile|*makefile)
- source-highlight --failsafe -f esc --lang-def=makefile.lang --style-file=esc.style -i "$source" ;;
- *) source-highlight --failsafe --infer-lang -f esc --style-file=esc.style -i "$source" ;;
+ source-highlight --failsafe -f esc --lang-def=makefile.lang --style-file=$HOME/.source-highlight/wombat.style -i "$source" ;;
+ *) source-highlight --failsafe --infer-lang -f esc --style-file=$HOME/.source-highlight/wombat.style -i "$source" ;;
esac
done
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "relativkreativ/centos-7-minimal"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "public_network", ip: "xxx.xxx.xxx.xxx", netmask: "255.255.255.0"
config.vm.hostname = "nlp"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
vb.name = "NLP sandbox"
# Customize the amount of memory on the VM:
vb.memory = "2048"
vb.customize ["modifyvm", :id, "--ostype", "RedHat_64"]
end
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sudo yum update
sudo yum -y install chrony
sudo systemctl enable chronyd
sudo systemctl status chronyd
sudo timedatectl set-timezone Asia/Tokyo
sudo localectl set-locale LANG=ja_JP.utf8
sudo yum -y install patch
sudo yum -y install vim wget curl source-highlight git nano
sudo yum -y install gcc gcc-c++ gcc-gfortran libgfortran
sudo yum -y install zlib-devel openssl-devel readline-devel ncurses-devel sqlite-devel expat-devel bzip2-devel tcl-devel tk-devel gdbm-devel
sudo yum install atlas atlas-devel lapack-devel blas-devel blas lapack
curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
sudo pip install virtualenv virtualenvwrapper
patch < /vagrant/bash_profile.patch
source ~/.bash_profile
sudo mkdir -p /usr/local/python/python-3.4.3
cd /usr/local/src && sudo wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
sudo tar xzf Python-3.4.3.tgz
chown -R vagrant:vagrant Python-3.4.3/
cd Python-3.4.3/
./configure --prefix=/usr/local/python/python-3.4.3
make
sudo make install
/usr/local/python/python-3.4.3/bin/python3 -V
mkvirtualenv py3 --python=/usr/local/python/python-3.4.3/bin/python3
cd /usr/local/src
sudo curl -O https://mecab.googlecode.com/files/mecab-0.996.tar.gz
sudo tar xzf mecab-0.996.tar.gz
chown -R vagrant:vagrant mecab-0.996/
cd mecab-0.996
sudo mkdir -p /usr/local/mecab/mecab-0.996/
./configure --prefix=/usr/local/mecab/mecab-0.996
make
sudo make install
sudo cp /vagrant/mecab-0.996.conf /etc/ld.so.conf.d/
sudo ldconfig
cd /usr/local/src
sudo curl -O https://mecab.googlecode.com/files/mecab-ipadic-2.7.0-20070801.tar.gz
sudo tar xzf mecab-ipadic-2.7.0-20070801.tar.gz
chown -R vagrant:vagrant mecab-ipadic-2.7.0-20070801/
cd mecab-ipadic-2.7.0-20070801/
sudo mkdir -p /usr/local/mecab/mecab-ipdic-2.7.0
./configure --prefix=/usr/local/mecab/mecab-ipdic-2.7.0 --with-charset=utf8
make
sudo make install
cd /usr/local/mecab/mecab-0.996/etc
patch < /vagrant/mecabrc.patch
cd /usr/local/src
sudo git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
cd mecab-ipadic-neologd/
sudo PATH=$PATH:/usr/local/mecab/mecab-0.996/bin ./bin/install-mecab-ipadic-neologd -n -y
pip install numpy
pip install scipy
pip install scikit-learn
pip install gensim mecab-python3 ipython
pip install nose
pip install protobuf
pip install chainer
cd
mkdir .source-highlight
cp /vagrant/wombat.style .source-highlight/wombat.style
cd /usr/bin
sudo patch < /vagrant/src-hilite-lesspipe.sh.patch
cd
mkdir bin
cd bin/
wget http://stedolan.github.io/jq/download/linux64/jq
chmod 755 jq
SHELL
end
keyword yellow b;
type, classname green b ;
string pink b ;
regexp orange ;
specialchar pink ;
comment cyan b ;
number purple b ;
preproc darkblue b ;
symbol white b;
function gray b;
cbracket gray b;
variable green b;
// line numbers
linenum yellow;
// other elements for ChangeLog and Log files
date blue ;
time darkblue ;
ip darkgreen ;
file darkblue ;
name darkgreen ;
// Internet related
url blue u;
// for diffs
oldfile orange;
newfile darkgreen;
difflines blue;
// for css
selector purple;
property blue;
value darkgreen i;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment