Skip to content

Instantly share code, notes, and snippets.

View carlosb1's full-sized avatar

Carlos B carlosb1

View GitHub Profile
@carlosb1
carlosb1 / camera_install.sh
Last active September 29, 2020 11:51
install
#!/bin/bash -ex
pass_repository="QWt-AqnBNJQryrKyxexy"
current_user="optima"
sudo apt-get update
sudo apt-get install -y curl wget git kmod vim
# install docker
sudo apt-get install \
## Quick Start
### normal mode / visual mode
* start: `<C-n>` start multicursor and add a _virtual cursor + selection_ on the match
* next: `<C-n>` add a new _virtual cursor + selection_ on the next match
* skip: `<C-x>` skip the next match
* prev: `<C-p>` remove current _virtual cursor + selection_ and go back on previous match
* select all: `<A-n>` start multicursor and directly select all matches
You can now change the _virtual cursors + selection_ with **visual mode** commands.
For instance: `c`, `s`, `I`, `A` work without any issues.
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.train.en > Books.train.en.norm
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.train.fr > Books.train.fr.norm
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.dev.en > Books.dev.en.norm
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.dev.fr > Books.dev.fr.norm
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.test.en > Books.test.en.norm
perl ./moises/scripts/tokenizer/replace-unicode-punctuation.perl < Books.test.fr > Books.test.fr.norm
perl ./moises/scripts/tokenizer/normalize-punctuation.perl -l en < Books.train.en.norm > Books.train.en.norm2
perl ./moises/scripts/tokenizer/normalize-punctuation.perl -l fr < Books.train.fr.norm > Books.train.fr.norm2
@carlosb1
carlosb1 / set_up_ec2.sh
Last active April 17, 2019 18:53
Set up Amazon ec2 for flask news
apt-get install default-jdk
apt-get install software-properties-common
add-apt-repository ppa:linuxuprising/java
apt-get update
apt-get install oracle-java11-installer
apt-get install gnupg
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
add-apt-repository "deb https://artifacts.elastic.co/packages/6.x/apt stable main"
apt-get update --allow-insecure-repositories
@carlosb1
carlosb1 / set_up_docker.sh
Created October 19, 2018 13:00
set_up_docker.sh
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
cd /home/ubuntu
cd data
ln -s /opt/imagenet
ln -s /opt/fasttext
ln -s /opt/draagu
ln -s /opt/faces
mkdir tmp
# sys.path.append(os.path.abspath('/opt/ai_tools/fastai-code/')
# PATH = Path('/home/ubuntu')
@carlosb1
carlosb1 / mount_data.sh
Last active August 1, 2018 10:33
Mount data
sudo mkdir /opt/data
sudo mount /dev/$1 /opt/data
sudo chown ubuntu:ubuntu /opt/data
cd /home/ubuntu
mkdir devise
ln -s /opt/data/imagenet
sudo mkdir /opt/ai_tools
sudo mount /dev/$1 /opt/ai_tools
sudo chown -R ubuntu:ubuntu /opt/ai_tools
cd /opt/ai_tools/fastai-code
conda env update
source activate fastai
pip install cython
pip install fasttext
jupyter-notebook --generate
@carlosb1
carlosb1 / format.sh
Created July 17, 2018 09:03
Dummy script to format python code...
#!/bin/bash
if (($# < 1)); then
echo "It necessary one argument"
exit;
fi
for filename in $1/*.py; do
yapf -i $filename && autoflake -i $filename;
done
@carlosb1
carlosb1 / commands_virtualbox_mac.txt
Created February 27, 2018 11:08
configure mac image in virtualbox ubuntu
$ VBoxManage modifyvm "macOS Sierra 10.12" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
$ VBoxManage setextradata "macOS Sierra 10.12" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
$ VBoxManage setextradata "macOS Sierra 10.12" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
$ VBoxManage setextradata "macOS Sierra 10.12" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F2238BAE"
$ VBoxManage setextradata "macOS Sierra 10.12" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
$ VBoxManage setextradata "macOS Sierra 10.12" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1