Skip to content

Instantly share code, notes, and snippets.

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

Guillaume Falourd GuillaumeFalourd

🏠
Working from home
View GitHub Profile
@alexandrefvb
alexandrefvb / writeup-zup-ctf-2022.md
Last active July 6, 2022 19:00
Writeup - CTF ZUP 2022

Write-up - CTF Zup 2022 - Alexandre Fidélis Vieira Bitencourt

se FOR fácil eu MATO - v2

Este desafio era sobre a utilização de um buffer overflow para sobrepor o valor de uma variável inteira. O código fonte da página era o seguinte:

image

Caso o atacante conseguisse sobrepor o valor da variável inteira que era iniciado com zero a flag seria revelada.

@horothesun
horothesun / github_billing.sh
Last active July 13, 2021 02:08
github_billing
# IMPORTANT: GITHUB_TOKEN with "Update ALL user data" permission
#
# Dependencies:
# - curl
# - jq
#
# Run:
# GITHUB_TOKEN=<token> GITHUB_USER=<username> ./github_billing.sh
#
@rponte
rponte / using-uuid-as-pk.md
Last active June 29, 2024 15:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@iridiumcao
iridiumcao / check_git_branch_exists.sh
Created March 22, 2020 13:57
How to check if a git branch exists in the local/remote repository?
# Local:
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists
# test if the branch is in the local repository.
# return 1 if the branch exists in the local, or 0 if not.
function is_in_local() {
local branch=${1}
local existed_in_local=$(git branch --list ${branch})
if [[ -z ${existed_in_local} ]]; then
echo 0
@genyrosk
genyrosk / Makefile
Last active April 26, 2024 15:59
Makefile for a Python environment with virtualenv
SHELL:=/bin/bash
VIRTUAL_ENV=env
JUPYTER_ENV_NAME=env
PORT=8888
PYTHON=${VIRTUAL_ENV}/bin/python3
# .ONESHELL:
DEFAULT_GOAL: help
.PHONY: help run clean build venv ipykernel update jupyter
@wosephjeber
wosephjeber / git_revision.js
Last active June 5, 2024 15:33
Get branch and commit names from Node (synchronously)
const { execSync } = require('child_process');
function executeGitCommand(command) {
return execSync(command)
.toString('utf8')
.replace(/[\n\r\s]+$/, '');
}
const BRANCH = executeGitCommand('git rev-parse --abbrev-ref HEAD');
const COMMIT_SHA = executeGitCommand('git rev-parse HEAD');
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active July 5, 2024 16:56
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@maxim
maxim / gh-dl-release
Last active July 4, 2024 00:00
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@rponte
rponte / get-latest-tag-on-git.sh
Last active July 4, 2024 10:55
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@VojtechVitek
VojtechVitek / redirects.go
Last active July 7, 2023 19:10
Golang: Workaround for too many redirects - "stopped after 10 redirects" error
sourceURL := "http://example.com"
// Resolve URL up to 12 redirects.
client := &http.Client{
CheckRedirect: func() func(req *http.Request, via []*http.Request) error {
redirects := 0
return func(req *http.Request, via []*http.Request) error {
if redirects > 12 {
return errors.New("stopped after 12 redirects")
}