Skip to content

Instantly share code, notes, and snippets.

View gil-obradors's full-sized avatar

Gil Obradors gil-obradors

View GitHub Profile
@gil-obradors
gil-obradors / editExistingPdf.py
Created April 17, 2019 18:59 — forked from kzim44/editExistingPdf.py
Edit an existing PDF using Python
from pyPdf import PdfFileWriter, PdfFileReader
import StringIO
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
packet = StringIO.StringIO()
# create a new PDF with Reportlab
can = canvas.Canvas(packet, pagesize=letter)
can.drawString(100,100, "Hello world")
can.save()
@gil-obradors
gil-obradors / tmux.md
Created July 4, 2019 06:05 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@gil-obradors
gil-obradors / gist:91c93e6e00f24b4d603b97f8570c19f3
Created September 29, 2019 18:11
Automated PPTP-CLient Devian creater
#!/bin/bash
# Inspired from https://www.prado.lt/how-to-set-up-pptp-client-on-debian-9
#apt-get install pptp-linux
if dpkg -l | grep pptp-linux ; then echo "No instalarem paquet" ; else apt-get install pptp-linux ; fi
echo "Ip del servidor de tunel?"
read server
##########################3333
SD Card RPI microSDHC EVO PLUS 32GB Class 10
gil@gil-NUC10i7FNH:/media/gil/9016-4EF8$ fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=1G --readwrite=randrw --rwmixread=75
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.16
Starting 1 process
test: Laying out IO file (1 file / 1024MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=4688KiB/s,w=1445KiB/s][r=1172,w=361 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=562556: Thu Jul 2 20:35:30 2020
@gil-obradors
gil-obradors / disaster_recovery.txt
Created May 11, 2021 10:46
Disaster recovery from my pc
# Unhash ~/.ssh/known_hosts
HashKnownHosts
if $(grep -q "HashKnownHosts" /etc/ssh/ssh_config 2>&1 > /dev/null ) ; then