Skip to content

Instantly share code, notes, and snippets.

View achauve's full-sized avatar

Adrien Chauve achauve

View GitHub Profile
seq -w 1 100 | xargs -n1 -I% sh -c 'dd if=/dev/urandom of=file.% bs=$(shuf -i1-1000 -n1) count=1024'

Multiple repos -> mono repo with history from old repos

mkdir monorepo
cd monorepo
git init .

# fetch old repos
git remote add repo_1 XXX
git fetch repo_1
@achauve
achauve / psql.md
Last active February 16, 2024 15:43 — forked from revolunet/psql.md
PSQL tips and tricks

Cheat sheet

  • better display of results:
\pset format wrapped
\pset columns 100
\pset linestyle unicode
  • list all databases: \l
  • List all schemas: \dn

Keybase proof

I hereby claim:

  • I am achauve on github.
  • I am adrienchauve (https://keybase.io/adrienchauve) on keybase.
  • I have a public key ASCg_0q9-XJUjiCy3ZmjH5w6lxOVBxivDJ76QqwBVcRLuwo

To claim this, I am signing this object:

@achauve
achauve / slack_deploy_bot_template.py
Last active November 20, 2020 05:29
Template of Slack bot for deployment
import logging
import os
import time
import traceback
# pip install slackclient
from slackclient import SlackClient
machine:
environment:
CURRENT_IP: $(dig +short myip.opendns.com @resolver1.opendns.com)
dependencies:
override:
- pip install -r requirements.txt
# also install awscli tools
- pip install awscli==1.7.36
@achauve
achauve / gist:bd38a0d182bed3b9f272
Last active August 29, 2015 14:25
Snippet to retrieve external IP
CURRENT_IP = $(dig +short myip.opendns.com @resolver1.opendns.com)