Skip to content

Instantly share code, notes, and snippets.

View debuti's full-sized avatar
😀

Borja Garcia debuti

😀
  • Spain
View GitHub Profile
@debuti
debuti / dbxcli-getr
Last active December 20, 2022 02:18 — forked from shadiakiki1986/README.md
Wrap "dbxcli get" command to download files from a dropbox dir recursively
#!/usr/bin/env python3
import os
import sys
import subprocess
import re
import argparse
import hashlib
args = None
@debuti
debuti / httpd.sh
Created September 11, 2018 10:27
Simplest HTTP server with netcat
while true; do
(echo -e 'HTTP/1.1 200 OK\r\n'; echo -e "\n\tMy website has date function" ; echo -e "\t$(date)\n") | nc -lp 8080;
done
@debuti
debuti / pag-empleo.py
Last active September 10, 2018 15:04
Scrapping script for public positions in Spain cityhalls
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
import re
import json
import datetime
urlbase = 'https://administracion.gob.es/pagFront/empleoBecas/empleo'
url = urlbase + '/buscadorEmpleoAvanzado.htm'
@debuti
debuti / bx
Last active August 27, 2018 10:58
Base64 multi-encoding/decoding script
#!/bin/bash
# Source this file
# The output length follows an expotential sequence, the same as the computation time
function bex { outstr=$1; incount=$2; while [[ ! incount -eq 0 ]]; do outstr=$(echo "$outstr" | base64 -w0); (( incount-- )); done; echo $outstr; }
function bdx { outstr=$1; incount=$2; while [[ ! incount -eq 0 ]]; do outstr=$(echo "$outstr" | base64 -d); (( incount-- )); done; echo $outstr; }
@debuti
debuti / Makefile
Last active August 21, 2018 08:29
ARM C to ASM call
CROSS_COMPILE ?= arm-unknown-eabi
AOPS = --warn --fatal-warnings
COPS = -Wall -Werror -O0 -nostdlib -nostartfiles -ffreestanding
callasm.bin: print.s callasm.c
$(CROSS_COMPILE)-as $(AOPS) print.s -o print.o
$(CROSS_COMPILE)-cc -c $(COPS) callasm.c -o callasm.o
# Caution! The order of the object files is critical
$(CROSS_COMPILE)-ld callasm.o print.o -o callasm.elf
@debuti
debuti / .gbdinit
Last active August 19, 2019 12:01
My gdbinit
# set to 1 to enable 64bits target by default (32bit is the default)
set $64BITS = 1
# Allows the prettyprinting of structs
set print pretty on
set confirm off
set verbose off
set output-radix 0x10
@debuti
debuti / embedded-x86_64-kernel
Last active June 24, 2023 02:35
Kernel and rootfs build for qemu simulator
#!/bin/bash
mkdir -p ~/dev/i386
cd ~/dev/i386
# Vanilla
mkdir vanilla
cd vanilla
## Crosstool
@debuti
debuti / docker-cmds
Last active June 11, 2018 14:05
Docker cmds cheatsheet
# State flow diagram
https://i.stack.imgur.com/vGuay.png
# Delete containers
docker rm $(docker ps -a -q)
# List containers
docker container ls -a
# Delete images
@debuti
debuti / .vimrc
Created April 9, 2018 10:40
My vimconfig
" Enable syntax highlighting
syntax on
" Disable use of the mouse for visual
set mouse-=a
" Display line numbers on the left
set number
@debuti
debuti / .bash_profile
Last active February 1, 2019 15:20
My gitconfig and related utils
# Taken from https://gist.github.com/kevinchappell/09ca3805a9531b818579
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;36m\]\w \[\033[1;35m\]$(parse_git_branch) \[\033[1;33m\]\$ \[\033[0m\]'