Skip to content

Instantly share code, notes, and snippets.

View ivanmonteiro's full-sized avatar

Ivan Monteiro Cantalice ivanmonteiro

  • Brazil
View GitHub Profile
@ivanmonteiro
ivanmonteiro / create-docker-toolbox-vm-virtualbox.sh
Last active October 27, 2021 16:04
Create a Docker Toolbox Virtualbox VM with 6 cpus, 4gb RAM and 32gb hard disk
// Creates a docker virtual machine with static ip, 8 cpus, 4GB RAM and 32GB disk size
// Using the cidr ip range to 192.168.100.1/24 should set the virtual machine's ip to 192.168.100.100 upon boot
docker-machine create -d virtualbox \
--virtualbox-cpu-count 8 \
--virtualbox-memory 4096 \
--virtualbox-disk-size "32000" \
--virtualbox-hostonly-cidr "192.168.100.1/24" \
default
@ivanmonteiro
ivanmonteiro / nginx.conf
Created October 10, 2020 00:52
Best practice secure NGINX configuration for WordPress
# From blog post https://www.getpagespeed.com/server-setup/nginx/best-practice-secure-nginx-configuration-for-wordpress
server {
server_name example.com;
root /srv/www/example.com/public;
security_headers on;
@ivanmonteiro
ivanmonteiro / settings.json
Created August 5, 2020 05:43
My Windows Terminal Settings
// This file was initially generated by Windows Terminal 0.11.1251.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@ivanmonteiro
ivanmonteiro / mysql-5.7-docker.sh
Last active October 9, 2019 23:29
Mysql 5.7 docker with data volume, restart unless stopeed and custom config
docker run --name mysql --env-file /home/ubuntu/mysql-env/.env -v /home/ubuntu/mysql-data:/var/lib/mysql -v /home/ubuntu/mysql-config/my.cnf:/etc/my.cnf -p 3306:3306 -d --restart unless-stopped mysql:5.7
#Script to install Opencv 3.4.4 with optmizations for raspberry pi that can increase performance up to 50%!
#install pre-requisites
sudo apt-get install build-essential checkinstall cmake pkg-config yasm git gfortran libjpeg-dev libjasper-dev libpng-dev libtiff5-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgtk2.0-dev libtbb-dev qt5-default libatlas-base-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libopencore-amrnb-dev libopencore-amrwb-dev libavresample-dev x264 v4l-utils libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev libgphoto2-dev libeigen3-dev libhdf5-dev doxygen
#add symlink for libv4l
sudo ln -s -f /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
#download and install Intel TBB precompiled for raspberry pi 2/3 b
git clone https://github.com/abhiTronix/TBB_Raspberry_pi.git
cd TBB_Raspberry_pi/
@ivanmonteiro
ivanmonteiro / raspberry-pi-3-compile-optimizations.txt
Last active July 15, 2019 18:27
Raspberry Pi 3 Model B - Opencv 3.4.4 compile
#install pre-requisites
sudo apt-get install build-essential checkinstall cmake pkg-config yasm git gfortran libjpeg-dev libjasper-dev libpng-dev libtiff5-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgtk2.0-dev libtbb-dev qt5-default libatlas-base-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libopencore-amrnb-dev libopencore-amrwb-dev libavresample-dev x264 v4l-utils libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev libgphoto2-dev libeigen3-dev libhdf5-dev doxygen
#add symlink for libv4l
sudo ln -s -f /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
#download and install Intel TBB precompiled for raspberry pi 2/3 b
git clone https://github.com/abhiTronix/TBB_Raspberry_pi.git
cd TBB_Raspberry_pi/
sudo dpkg -i libtbb-dev_4.5-1_armhf.deb
docker run -d -p 1883:1883 -p 9001:9001 --name mosquitto --restart=always -v ~/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf -v ~/mosquitto/data -v ~/mosquitto/log eclipse-mosquitto
docker run -d -p 1880:1880 -v ~/node-red-data:/data --name nodered --restart nodered/node-red-docker
@ivanmonteiro
ivanmonteiro / metabase-docker-memory-limit-512mb
Last active October 17, 2018 02:37
Run metabase on docker with java_options memory limit of 1gb
docker run -d -p 3000:3000 -e "JAVA_TOOL_OPTIONS=-Xmx1g" -v ~/metabase-data:/metabase-data -e "MB_DB_FILE=/metabase-data/metabase.db" --name metabase metabase/metabase