Skip to content

Instantly share code, notes, and snippets.

View thinmy's full-sized avatar
🎯
Focusing

Thinmy Patrick Alves thinmy

🎯
Focusing
View GitHub Profile
@thinmy
thinmy / install-python.sh
Created October 9, 2018 10:50
Install Python 3.6.5 in Ubuntu 16+
#!/bin/bash
export PYTHON_VERSION=3.6.5
export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
sudo apt update
sudo apt install --no-install-recommends -y \
software-properties-common build-essential \
libssl-dev libreadline-dev libbz2-dev libsqlite3-dev zlib1g-dev \
python-minimal
@thinmy
thinmy / install-node.sh
Created October 9, 2018 10:50 — forked from ndaidong/install-node.sh
Install Node 8.10.0 in Ubuntu 16+
#!/bin/bash
export NODE_VERSION=8.10.0
export NODE_DOWNLOAD_URL=https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.gz
wget "$NODE_DOWNLOAD_URL" -O node.tar.gz
tar -zxvf node.tar.gz
cd node-v$NODE_VERSION
./configure
make
sudo make install
@thinmy
thinmy / create_swap.sh
Created October 9, 2018 10:51
Create swap
#!/bin/sh
export SWAP_SIZE=2G
sudo fallocate -l $SWAP_SIZE /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo bash -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
@thinmy
thinmy / setup-u1804.sh
Created October 9, 2018 10:51
Setup dev environment using Ubuntu 18.04 MinimalCD, with Xubuntu Minimal DE, Node.js, Python, Golang, and more stuff.
#!/bin/sh
export USER=ndaidong
export GIT_NAME='Dong Nguyen'
export GIT_EMAIL='[email protected]'
export PYTHON_VERSION=3.6.5
export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
@thinmy
thinmy / install_python3.6.sh
Created October 9, 2018 11:02 — forked from rafpyprog/install_python3.6.sh
Script for install of Python 3.6 on Ubuntu
#!/bin/bash
add-apt-repository ppa:jonathonf/python-3.6 && apt-get update
apt-get install -y python3.6
@thinmy
thinmy / gmail_imap_example.py
Created June 11, 2019 04:06 — forked from robulouski/gmail_imap_example.py
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@thinmy
thinmy / imap-search
Created June 28, 2019 00:11 — forked from martinrusev/imap-search
IMAP Search criteria
@thinmy
thinmy / django-settings.py
Created April 13, 2020 23:32 — forked from ilosamart/django-settings.py
Graylog2 (apache and nginx)
"""
... some code
"""
import socket
HOSTNAME=socket.gethostname()
"""
... some more code
@thinmy
thinmy / docker-compose.yml
Created December 7, 2020 11:43
Docker nginx proxy with letsencrypt companion
version: '3.2'
services:
nginx-proxy:
container_name: nginx-proxy
image: jwilder/nginx-proxy
environment:
- ENABLE_IPV6=true
ports:
- "80:80"
FROM python:3.8-buster
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /src/app/
WORKDIR /src
ADD requirements.txt /src/requirements.txt
RUN pip install -r requirements.txt