Skip to content

Instantly share code, notes, and snippets.

include_recipe "apt"
cookbook_file "/etc/apt/sources.list.d/mysql.list" do
source "mysql.list"
mode 0644
owner "root"
group "root"
notifies :run, resources(:bash => "mysql keys"), :immediately
end
@samber
samber / README.md
Last active May 10, 2024 00:46
Password leak check (data source: 4iQ - Dec 2017 - 1.4 billion creds)
#
# This script builds a database containing credentials, in order to check if email+password have leak.
# For a few searchs, the grep command is perfect. No need of an aircraft carrier for fishing in a lake. ;)
# Data source contains 1.4 billon (yes, billon!) passwords from 4iQ (41GB large)
#
# PS: Use. Don't abuse !
#

mkdir 1.4B-password-dump/
@samber
samber / install.sh
Created March 21, 2018 10:33
Terraform Install (Epitech talk)
#!/bin/bash
wget https://releases.hashicorp.com/terraform/0.11.4/terraform_0.11.4_linux_amd64.zip
unzip terraform_0.11.4_linux_amd64.zip
sudo mv terraform /usr/local/bin/
@samber
samber / chiffres.py
Created March 7, 2018 23:08
Des chiffres et des lettres
# When you get bored in plane and want to play with your french friend
#
# $> python3 chiffres.py
#
# Enjoy ;)
import random
print("find:")
print(random.randint(100, 1000))
@samber
samber / main.go
Created January 15, 2018 17:47
Streaming read of StackExchange user dump (https://archive.org/details/stackexchange)
package main
import (
"fmt"
"os"
"flag"
"encoding/xml"
)
type Row struct {
@samber
samber / notify.sh
Created November 29, 2017 21:41
Notify coinbase UP
#!/bin/bash
function make_noise() {
say -v '?' | awk '{print $1}' | while read voice; do printf "using $voice...\\
n"; say -v $voice "hello, this is me using the $voice voice"; sleep 1; done
}
function notify_coinbase_up() {
COUNTER=1
<html>
<head></head>
<body>
<div id="tweet" tweetID="934142793836089344"></div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script sync src="https://platform.twitter.com/widgets.js"></script>
@samber
samber / drive-to-dropbox.gs
Last active November 11, 2017 22:53
Google Apps Script for building a backup of a folder, from Google Drive to Dropbox, every night
// To store personal documents that really matter (such as tax reports, bank terms,
// employment conditions...) you should opt for a cloud storage (Dropbox, Google Drive...).
// Even if famous SaaS services might be safe enough to not make backups by ourselves, it
// may be even safer to not rely on them and setup this short script for copying a Drive folder
// into Dropbox.
// To generate a Dropbox access token, please follow this guide: http://99rabbits.com/get-dropbox-access-token/
// Don't forget to setup a cronjob:
// 1- Click on 'Edit' menu > 'Current project's triggers'
@samber
samber / script.py
Created September 20, 2017 16:59
POC gmail api (Oauth2 + Gmail api)
#!/usr/bin/env python3
import httplib2
import apiclient
from oauth2client.client import OAuth2WebServerFlow
scopes = [
'https://mail.google.com/',
'https://www.googleapis.com/auth/gmail.settings.basic',
'https://www.googleapis.com/auth/userinfo.profile',
@samber
samber / sample.json
Created September 2, 2017 15:57
D3 flame graph
{
"name": "root",
"value": 1,
"children": [
{
"name": "(root)",
"value": 1,
"children": [
{
"name": "_handle.close",