Skip to content

Instantly share code, notes, and snippets.

View constrict0r's full-sized avatar
👘
The plan is programmed in all of my thousand robots

Victor Mattei constrict0r

👘
The plan is programmed in all of my thousand robots
  • @cslucr @lamportcomputing
  • Costa Rica
View GitHub Profile
@constrict0r
constrict0r / docker-pull-access.sh
Last active September 6, 2019 17:54
Docker pull image, access image.
docker pull constrict0r/catalyst
docker run -v /home/username/Documents/jupyter:/projects -v ~/.catalyst:/root/.catalyst -p 8888:8888/tcp --name catalyst -ti constrict0r/catalyst
# Run on another shell.
docker exec -it catalyst catalyst ingest-exchange -x bitfinex -i btc_usd
docker exec -it catalyst catalyst ingest-exchange -x bitfinex -i btc_usd -f minute
docker exec -it catalyst catalyst run -f /projects/bull_conservative.py -x bitfinex --start 2019-1-5 --end 2019-1-6 -c usd --capital-base 10000 -o /projects/bull_conservative.pickle
@constrict0r
constrict0r / hamachi-client-setup.py
Last active October 9, 2019 15:54
Hamachi linux client setup
wget https://www.vpn.net/installers/logmein-hamachi_2.1.0.203-1_amd64.deb
sudo dpkg -i logmein-hamachi_2.1.0.203-1_amd64.deb
sudo hamachi login
sudo hamachi join <network-name>
sudo hamachi list
@constrict0r
constrict0r / dd-zero.sh
Created August 28, 2019 03:31
Write zeros to drive
dd if=/dev/zero of=/dev/sda bs=4096
sudo badblocks -v /dev/sda10 > badsectors.txt
sudo e2fsck -l badsectors.txt /dev/sda10
ansible-vault encrypt_string 1234 --ask-vault-pass
@constrict0r
constrict0r / python-url-check.sh
Last active July 25, 2019 21:55
Multiple ways to check if an URL is alive.
# Using requests.
import request
request = requests.get(value)
if request.status_code == 200:
return True
return False
# Using httplib2.
import httplib2
@constrict0r
constrict0r / .gitignore
Last active October 25, 2019 18:09
Git ignore files.
# Ansible.
*.retry
# Binaries.
*.jpg
# Buffers.
*~
# Coverage.
@constrict0r
constrict0r / git-subtree.sh
Last active September 14, 2019 01:20
Handle git subtree.
# Add.
git subtree add --prefix docs/source/parts [email protected]:constrict0r/parts.git master --squash
# Update.
git subtree pull --prefix docs/source/parts [email protected]:constrict0r/parts.git master --squash
# Remove.
git filter-branch --index-filter 'git rm --cached --ignore-unmatch -rf docs/source/parts' --prune-empty -f HEAD
@constrict0r
constrict0r / pandoc-rst.sh
Last active June 28, 2019 06:44
Generate pandoc rst.
cd my_project/docs/source
pandoc -s -o ../build/singlerst/README.rst title.rst ingredients.rst index_plain.rst
@constrict0r
constrict0r / git-submodule.sh
Last active September 13, 2019 18:14
Handle git submodule.
# Add.
git submodule add -b branch_name https://github.com/constrict0r/submodulename optional_directory_rename
# Get.
git submodule update --init --recursive
git submodule update --recursive
# Remove.
git rm submodulename
rm -rf .git/modules/submodulename