Skip to content

Instantly share code, notes, and snippets.

View sclo's full-sized avatar

SClo sclo

View GitHub Profile
@sclo
sclo / deloldtweets.py
Created January 28, 2021 12:05 — forked from intentionally-left-nil/deloldtweets.py
Delete (very) old tweets obtained from a twitter archive
#!/bin/python3
# Largely copied from http://www.mathewinkson.com/2015/03/delete-old-tweets-selectively-using-python-and-tweepy
# However, Mathew's script cannot delete tweets older than something like a year (these tweets are not available from the twitter API)
# This script is a complement on first use, to delete old tweets. It uses your twitter archive to find tweets' ids to delete
# How to use it :
# - download and extract your twitter archive (tweet.js will contain all your tweets with dates and ids)
# - put this script in the extracted directory
# - complete the secrets to access twitter's API on your behalf and, possibly, modify days_to_keep
# - delete the few junk characters at the beginning of tweet.js, until the first '[' (it crashed my json parser)
# - review the script !!!! It has not been thoroughly tested, it may have some unexpected behaviors...
@sclo
sclo / README.md
Created July 26, 2018 16:52 — forked from dberstein/README.md
Git commit hook that prepends message with Jira issue(s) found in branch name (PR branch) otherwise requires message contains at least one Jira issue

With this commit-msg git hook and your branch names have Jira reference(s), your commit messages will be automatically updated to include any missing reference(s) too.

Installation

Place contents of this gist's commit-msg file into your checkout's .git/hooks/commit-msg file and make it executable.

Bash

cd path/to/your/git/checkout \
&& install -vbm 755 <(curl -s https://gist.githubusercontent.com/dberstein/dcc50e171163c3f6e0f23b2b5de5dd49/raw/5e5372ff22a872321ad1f5469a4d579c15ce498a/commit-msg) "$(git rev-parse --git-dir)/hooks/commit-msg"
@sclo
sclo / Instructions.md
Created July 26, 2018 16:10 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@sclo
sclo / Makefile
Created July 12, 2018 11:36 — forked from hansode/Makefile
wakame-vdc dialog
OBJS = blockdiag nwdiag seqdiag
all: generate
clean:
rm -f *.png
generate:
for obj in $(OBJS); do \
echo "> $$obj <"; \
@sclo
sclo / Keepass_file_format_explained.md
Last active May 17, 2018 09:26 — forked from lgg/readme.md
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.

@sclo
sclo / AWS IAM Policy - ForceMFA.json
Created May 9, 2018 06:46 — forked from incyclum/AWS IAM Policy - ForceMFA.json
AWS IAM Policy - Force MFA - This policy allows users to manage their own passwords and MFA devices but nothing else unless they authenticate with MFA -- *EDIT*: I forgot where I found it in the 1st place. In fact this policy is explained statement by statement in AWS docs: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_users-self-man…
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:ListUsers",
"iam:GetAccountPasswordPolicy",
@sclo
sclo / setup.sh
Created April 12, 2018 09:45 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@sclo
sclo / install.sh
Created November 2, 2017 08:16 — forked from marklit/install.sh
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz