Skip to content

Instantly share code, notes, and snippets.

View leonardobiffi's full-sized avatar
💭
working... ☕

Leonardo Biffi leonardobiffi

💭
working... ☕
View GitHub Profile
@leonardobiffi
leonardobiffi / docker-compose.yml
Created October 22, 2019 17:55
Docker Compose LAMP
version: "3"
services:
web:
image: php:7.2-apache
ports:
- "80:80"
volumes:
- ./app:/var/www/html
links:
- mysql
@leonardobiffi
leonardobiffi / ubuntu_posinstall.sh
Last active December 21, 2019 12:53
Pos Install Ubuntu 19.10
#!/usr/bin/env bash
#VARIAVEIS
URL_GOOGLE_CHROME="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
URL_TEAMVIEWER="https://download.teamviewer.com/download/linux/version_13x/teamviewer_amd64.deb"
DIRETORIO_DOWNLOADS="$HOME/Downloads/programas"
PROGRAMAS_PARA_INSTALAR=(
flameshot
@leonardobiffi
leonardobiffi / Popcorn-Time.desktop
Created January 26, 2020 18:51 — forked from ed-flanagan/Popcorn-Time.desktop
Gnome Popcorn Time application launcher
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Popcorn Time
Name[en_US]=Popcorn Time
GenericName=BitTorrent Stream Player
GenericName[en_US]=BitTorrent Stream Player
Comment=Run the Popcorn Time application
Comment[en_US]=Run the Popcorn Time application
Type=Application
@leonardobiffi
leonardobiffi / function.py
Created February 10, 2020 13:46 — forked from brandond/function.py
Python script to auto-tag AWS EBS Snapshots and Volumes using AMI and Instance tags
import copy
import logging
import os
import boto3
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO'))
ec2 = boto3.client('ec2')
logger = logging.getLogger(__name__)
@leonardobiffi
leonardobiffi / checkSession.php
Last active October 14, 2020 14:26 — forked from lukas-buergi/checkSession.php
Check whether sessions work in php
<?php
error_reporting( E_ALL );
ini_set( 'display_errors', 1);
if(!isset($_GET['action'])){
die('Param is missing. Look at the <a href="https://gist.github.com/2995743">source</a>.');
}
switch($_GET['action']) {
@leonardobiffi
leonardobiffi / Makefile
Created November 18, 2020 17:37 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@leonardobiffi
leonardobiffi / redis_migrate.py
Created September 14, 2021 17:04 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@leonardobiffi
leonardobiffi / Remove all git tags
Created July 12, 2022 11:59 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@leonardobiffi
leonardobiffi / delete_vpc.sh
Created January 23, 2024 20:40
Script to delete AWS default VPCs from regions using AWS CLI
#!/usr/bin/env bash
REGIONS='us-east-1
us-east-2'
INDENT=' '
echo "Using profile $AWS_PROFILE"
for region in $REGIONS; do
@leonardobiffi
leonardobiffi / drop-table.sh
Created February 23, 2024 16:46
MySQL drop all tables in database
#!/bin/bash
USER="$1"
PASS="$2"
DB="$3"
HOST="$4"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)