Skip to content

Instantly share code, notes, and snippets.

View fhgbaguidi's full-sized avatar
🎯
Focusing

Fréjus Gbaguidi fhgbaguidi

🎯
Focusing
  • Freelance
  • Lille, The North of France
View GitHub Profile
@fhgbaguidi
fhgbaguidi / pg_sql_find_blocking_queries.sql
Created January 24, 2023 10:27
Find blocking postgresql queries
SELECT pid, pg_blocking_pids(pid) AS blocked_by, query AS blocked_query, backend_start
FROM pg_stat_activity
WHERE pg_blocking_pids(pid)::TEXT != '{}';
@fhgbaguidi
fhgbaguidi / gh_delete_releases
Created January 9, 2023 09:19
Delete all GitHub releases / tags
# Install GH cli
https://github.com/cli/cli#installation
# set GH_TOKEN env var
export GH_TOKEN=<<your_PAT_with_repo_access>>
# delete releases
$ gh release list | sed 's/|/ /' | awk '{print $1, $8}' | while read -r line; do gh release delete -y "$line"; done
[alias]
co = checkout
b = branch
cob = checkout -b
cm = commit -m
s = status -sb
todo = ! git grep --extended-regexp -I --line-number --break --heading --color=auto 'TODO|FIXME'
p = push
ll = log --oneline
last = log -1 HEAD --stat
FROM python:2.7
RUN addgroup --gid 1002 --system app
RUN adduser -uid 1002 --system --gid 1002 app
USER app
ENTRYPOINT ["python", "-m", "SimpleHTTPServer", "8080"]
@fhgbaguidi
fhgbaguidi / git_pull_on_many_repos.sh
Created April 8, 2019 08:53
Exec git pull on all subdirectories
#bin/bash
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \;
#https://stackoverflow.com/questions/3497123/run-git-pull-over-all-subdirectories