Skip to content

Instantly share code, notes, and snippets.

View diegoponciano's full-sized avatar
🏠
Working from home

Diego Ponciano diegoponciano

🏠
Working from home
  • Sao Paulo - Brazil
View GitHub Profile
@diegoponciano
diegoponciano / resume.json
Last active December 20, 2021 21:23
registry.jsonresume.org/diegoponciano
{
"meta":{
"theme":"paper"
},
"basics":{
"name":"Diego Ponciano",
"label":"Software Engineer at Loadsmart",
"email":"diegoponciano@protonmail.com",
"phone":"+5511991026657",
"website":"http://diegoponciano.github.io/",
@diegoponciano
diegoponciano / pyenv_install_ssl_error.sh
Last active June 15, 2023 09:04
Solution to "The Python ssl extension was not compiled. Missing the OpenSSL lib?"
#!/bin/sh
# Taken from https://github.com/pyenv/pyenv/issues/1184#issuecomment-469450250
wget https://www.openssl.org/source/openssl-1.1.0j.tar.gz
tar -xvzf openssl-1.1.0j.tar.gz
cd openssl-1.1.0j/
./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11
make
make install
@diegoponciano
diegoponciano / ngrok-install.sh
Last active January 25, 2018 14:41 — forked from joaolucasl/ngrok-install.sh
Ngrok install script
#!/bin/bash
pushd /tmp
echo "Downloading ngrok"
rm -f /tmp/ngrok.zip
curl --silent https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -o /tmp/ngrok.zip
echo "Downloaded"
unzip /tmp/ngrok.zip
if echo "$PATH" | grep /usr/local/bin; then
echo -e "\n Enter pwd if prompted"
@diegoponciano
diegoponciano / install-telegram.sh
Last active June 2, 2017 15:41 — forked from slavafomin/install-telegram.sh
Install Telegram on Ubuntu using shell automatically
#!/bin/bash
set -o errexit
set -o pipefail
shopt -s nullglob
INSTALL_PATH="$HOME/opt/Telegram"
TEMP_PATH="$HOME/.tmp"
sudo apt-get install exo-utils xz-utils
@diegoponciano
diegoponciano / dump.sh
Last active December 16, 2016 11:06 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
#!/usr/bin/env python3
# dateutil, pdftools
import argparse
import os
from pdftools import pdf_split
from PyPDF2 import PdfFileReader
from dateutil import parser, relativedelta
from shutil import move
@diegoponciano
diegoponciano / .vimrc
Last active August 23, 2023 23:56
.vimrc
" vim-bootstrap 2023-08-09 21:43:03
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
@diegoponciano
diegoponciano / transmission_default_magnet.sh
Created March 15, 2016 10:32
Set Transmission as the default magnet link handler.
xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet
#!/bin/bash
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
#
# See also:
# - http://stackoverflow.com/questions/4581727/convert-sqlite-sql-dump-file-to-postgresql
# - https://gist.github.com/bittner/7368128
#!/usr/bin/env python3
import sys, os
import imageio
filename = sys.argv[1]
reader = imageio.get_reader(filename)
duration = reader.get_meta_data()['ANIMATION']['FrameTime']
frames = [frame for frame in reader]