Skip to content

Instantly share code, notes, and snippets.

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

LoreLLo lorello

🏠
Working from home
View GitHub Profile
@lorello
lorello / get_github_team_keys
Created April 5, 2019 13:13
Add the ssh public keys of a github team to a local user
#!/bin/bash
#
# Enable an ops team defined in github to connect to a server using ssh keys
#
# Requirements:
#
# - jq
# - httpie
#
# On debian based:
@lorello
lorello / -parse-server-dockerized
Last active February 8, 2019 18:21
ParseServer setup with official docker images and HTTPS
Enjoy a local environment of ParsePlatform
www.parseplatform.org

Keybase proof

I hereby claim:

  • I am lorello on github.
  • I am lorello (https://keybase.io/lorello) on keybase.
  • I have a public key whose fingerprint is 3A46 1358 838A 8100 F5AE AC79 1D71 C87F E705 70C9

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am lorello on github.
  • I am lorello (https://keybase.io/lorello) on keybase.
  • I have a public key whose fingerprint is 3A46 1358 838A 8100 F5AE AC79 1D71 C87F E705 70C9

To claim this, I am signing this object:

@lorello
lorello / mysql-master-binlog-purge
Created November 7, 2016 11:09
Mysql utility: purge master binlogs after as soon as slave has received them
#!/bin/bash
#
# This utility is thought to be run on a Mysql Slave and enables you to safely
# purge (delete) binary logs by ensuring that any files which are in use or
# required by the slave in a replication topology are not deleted.
# This is achieved by checking which binary logs have been read on the slave.
# This determines the minimal set of binary log files that can be purged.
#
# Inspired by mysqlbinlogpurge that cannot run on centos 6
# https://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlbinlogpurge.html
@lorello
lorello / .bash_aliases
Created May 2, 2016 12:36
Ubuntu Two-Lines Prompt with GIT and SVN info
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
set -e
[ ! -d .git ] && echo "Not a git repo, fatal error" && exit 1
[ ! -d log ] && mkdir log && echo "Create log dir"
if [ ! -f log/.keep ]; then
touch log/.keep
echo "Create log/.keep file"
git add log/.keep
@lorello
lorello / svn-repo-infos.sh
Last active February 23, 2016 11:43
SVN Repository Report
#!/bin/bash
#
# Create a simple CSV report with relevant info about
# your old SVN repositories, so you can easly decide
# what archive offline and what migrate to GIT :)
#
REPO_ROOT=/var/svn/
REPOS=$(find $REPO_ROOT -mindepth 1 -maxdepth 1 -type d)
echo "name,size,last commit date,last commit author"
@lorello
lorello / bind-mitingating-denying-hosts.sh
Last active February 9, 2016 13:59
Bind 9 Mitigating DNS based attack using Iptables
#!/bin/bash
#
# Written for an old bind without rate-limiting feature
#
LOG_WINDOW=1000
SECURITY_LOG=/var/log/named/security.log
IPTABLES_CHAIN=INPUT
DENIED_LIMIT=10
@lorello
lorello / mysql-rebuild-indexes
Created December 21, 2015 16:08
mysql rebuild indexes
#!/bin/bash
#
# Rebuild indexes on a single table or in a whole database
#
DB=$1
TABLES=$2
function syntax() {
echo -e "\nSYNTAX\n\t$0 <dbname> [\"table1 table2 table3 ...\"]\n\n"