Skip to content

Instantly share code, notes, and snippets.

View filippo's full-sized avatar

Filippo Pacini filippo

View GitHub Profile
@filippo
filippo / git-manage-multiple-remotes.md
Created April 9, 2020 08:14
GIT-multiple-remote-repositoies

GIT working with remote repositories

To see all the remote repositories: git remote -v

To add a remote (eg. named tokyo): git remote add tokyo git@remote_server:path-toproject/project.git

To remove a remote : git remote rm tokyo

To see details on a remote:

@filippo
filippo / openssl_commands.md
Created January 18, 2019 15:40 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@filippo
filippo / gist:a814ab7d8509b69aae3ea8b5f0542121
Created May 22, 2018 16:51 — forked from mikhailov/gist:9639593
Nginx S3 Proxy with caching
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
@filippo
filippo / jwtRS256.sh
Last active January 24, 2019 15:46 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@filippo
filippo / react-file-upload.js
Created March 14, 2018 09:52 — forked from AshikNesin/react-file-upload.js
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}
@filippo
filippo / fix-unicode-error.py
Created April 2, 2017 11:06
Python v2.7 - Error Cheetah Unicode
# In case of unicode decoding errors in Python 2.7 we can fix with an ugly hack:
# file Compiler.py row 1579 wrap the line:
source = unicode(source)
# in a try that intercepts the error and returns the template unchanged
try:
source = unicode(source)
except UnicodeDecodeError:
@filippo
filippo / Hourly Rate Contract Sample
Created July 21, 2016 12:12 — forked from iChris/Hourly Rate Contract Sample
Hourly Rate contract idea.
# Lemon Productions Hourly Contract
Date: [[Date of Document]]
Between Lemon Productions
and [Your Company]
## Summary
We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.
@filippo
filippo / ssh_persistent_connections
Last active December 7, 2017 08:58 — forked from rasky/.config
SSH persistent connections
# this re-enables ssh-dss on Fedora 23... until I change all the keys
PubkeyAcceptedKeyTypes +ssh-dss
#add to .ssh/config
Host *
ControlPersist yes
ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p
ServerAliveInterval 60
@filippo
filippo / WORDPRESS
Last active August 29, 2015 14:17
wordpress tips and tricks
this gist contains various tips and tricks for wordpress management and development
@filippo
filippo / zimbra-backup-emails.sh
Created January 28, 2015 16:04
How to backup and restore emails of a specific account on zimbra
# The command below creates a tgz file with all emails for user@domain.com in .eml format:
# execute as root
/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/account.tgz
# You can do the same via a REST URL:
wget http://ZIMBRA.SERVER/home/user@domain.com/?fmt=tgz
# to restore email:
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz