Recuperar disco

Cuando un disco empieza a fallar lo primero es sacar una copia completa a otro medio antes de que empeore, y trabajar después sobre esa copia. Esta receta explica cómo hacerlo con ddrescue.

Instalar Debian con un pendrive USB

Imagen a grabar

Descarga la imagen ISO «net-install» desde https://www.debian.org/CD/netinst/ para tu arquitectura (normalmente amd64). Estas imágenes aparte de poderse grabar en un CD, también son «bootables» desde USB.

Tutorial básico de dig

Algunos comandos básicos con dig para hacer consultas DNS.

Mini referencia de SQL con Postgres

Esto es sólo una pequeña referencia rápida de operaciones habituales con Postgres.

Edición de vídeo desde consola con ffmpeg

Edición básica de vídeo desde consola

Volcar (y recuperar) una base de datos PostgreSQL

Esta receta explica una forma sencilla de hacer una copia de seguridad de una base de datos PostgreSQL completa para poderla restaurar en caso de catástrofe o mudanza.

Systemd service config overwride

You may tune systemd service files without touch provided package files just with something like:

$ sudo systemctl edit bluetooth.service

Then, write your modifications:

[Service]
ExecStart=
ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap

References

  • https://raspberrypi.stackexchange.com/questions/40839/sap-error-on-bluetooth-service-status/99920#99920

My git cheat-sheet

— [ edit | raw ]

Delete all remote branches

$ git fetch -p; git branch -r | grep -v master | sed "s/origin\///" | xargs git push origin --delete

Sync remote and local branches

$ git fetch --prune

Option ‘prune’ removes local branches absent in remote.

My docker cheat-sheet

Open a shell in container

Or exec any program inside a running container:

$ docker exec -it <container-id-or-name> sh

Remove ALL containers

$ docker rm -f $(docker ps -aq)

Remove ALL images

$ docker rmi $(docker images -aq)

Fixing raw shell tty

— [ edit | raw ]

[This is a clone of this post just for avoid it may be lost. All attribution is to its author (Mike)]

I’ve seen the python pty trick in a few places, first when taking OSCP labs. However, if you’ve noticed there’s still some problems. 2 years ago at HackFest @r00k did a presentation where he improved the quality of the shell dramatically. Last year at HackFest, @jeffmcjunkin posted further improvements. All credit goes to them, and the excerpt below comes directly from Jeff McJunkin’s SEC560 notes.