Skip to content

Instantly share code, notes, and snippets.

@nurely
nurely / docker-setup.sh
Last active October 19, 2023 20:35
Docker - DockerCompose - Let's Encrypt
sudo apt update
sudo apt upgrade
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker $USER
@nurely
nurely / simple_upload.py
Last active April 11, 2018 21:07
Simple File Upload - Make Sure to have a folder named upload in the same directory
import os
from flask import Flask, request, redirect, url_for
from werkzeug import secure_filename
PROJECT_HOME = os.path.dirname(os.path.realpath(__file__))
UPLOAD_FOLDER = '{}/uploads/'.format(PROJECT_HOME)
ALLOWED_EXTENSIONS = set(['txt','pdf'])
app = Flask(__name__)
import RPi.GPIO as GPIO #Initialising GPIO
import time
# This Code Runs the Flask Web API, you can run on remote RPI or the Local One
#
#
#
#You can add more ports and routes to add further object.
import nltk
import speech_recognition as sr
# You can run this code on the same RPI where Flask Server is running or on your Hosts to access
# remote station.
#
#
#Variables for Usage
@nurely
nurely / deployApplication.php
Last active March 29, 2023 09:15
You can use this script to handle the Git Auto Deployment on Cloudways for any number of servers and applications using Git Webhooks.
<?php
const API_KEY = "YOUR API KEY HERE";
const API_URL = "https://api.cloudways.com/api/v1";
const EMAIL = "YOUR EMAIL GOES HERE";
/* examples
const BranchName = "master";
const GitUrl = "git@bitbucket.org:user22/repo_name.git";
*/