Skip to content

Instantly share code, notes, and snippets.

View paolobasso99's full-sized avatar
👋

Paolo Basso paolobasso99

👋
View GitHub Profile
@noelboss
noelboss / git-deployment.md
Last active July 16, 2024 09:50
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@alok-mishra
alok-mishra / trakt-remove-all-from-collection.js
Last active July 20, 2024 20:04
Remove all items from Trakt collection
// Removes all items from a page of the Trakt collection
// Run script from console of user's collection page
// Must be run on each page
$(".posters .grid-item").each(function() {
actionWatch($(this).closest('.grid-item'), 'collect', true)
})
@t-io
t-io / xvfb_screen_recording.py
Created November 17, 2017 10:34
ScreenRecording xvfb
from selenium import webdriver
import sys, getopt, time, subprocess, shlex
from xvfbwrapper import Xvfb
def run():
print('Sreencast website animation')
xvfb = Xvfb(width=1280, height=720, colordepth=24)
xvfb.start()
@jesgs
jesgs / deploying-from-github-to-vps-using-travis-ci.md
Last active September 12, 2022 19:39
Deploying from Github to VPS using Travis CI

From: https://www.jesgs.com/blog/2017/12/18/deploying-from-github-to-vps-using-travis-ci

Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.

Starting with your local machine and you have your project already checked out from Github.

Setting Up

  • Assuming you have Ruby (at least 2.3.1) installed, run gem install travis. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server.
  • This tutorial also assumes that you have a working repo and a Travis-CI account set up.
@jaredmales
jaredmales / rclone-cron.sh
Last active January 8, 2024 01:56
An rclone backup script for cron
#!/bin/bash
##############################################################################
# An rclone backup script by Jared Males (jaredmales@gmail.com)
#
# Copyright (C) 2018 Jared Males <jaredmales@gmail.com>
#
# This script is licensed under the terms of the MIT license.
# https://opensource.org/licenses/MIT
#
@paolobasso99
paolobasso99 / restic-backup.sh
Last active March 3, 2024 15:35
Restic backup script
#!/bin/bash
# This script will run a restic backup and remove snapshots according to a policy.
# In order for this script to work two environment vaiables must be set:
# RESTIC_PASSWORD which is the restic repository password (or read https://restic.readthedocs.io/en/latest/faq.html#how-can-i-specify-encryption-passwords-automatically)
# MY_RESTIC_LOGS_PATH which is the path where to save logs. For example: /home/paolo/restic/logs
#
# WARNING: This script prunes ond backups! Be careful not to delete backups that you need.
# Customize the removing policy according to https://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy
#
@paolobasso99
paolobasso99 / cloudflare-ufw.sh
Last active March 11, 2021 02:07
Cloudflare UFW rules
#!/bin/sh
# Automatically whitelist Cloudflare ips with UFW.
# This script should be runned daily with a cron job (place it in /etc/cron.daily).
# Remember to make this script executable.
# Reference: https://github.com/Paul-Reed/cloudflare-ufw/blob/master/cloudflare-ufw.sh
curl -s https://www.cloudflare.com/ips-v4 -o /tmp/cf_ips
curl -s https://www.cloudflare.com/ips-v6 >> /tmp/cf_ips