Skip to content

Instantly share code, notes, and snippets.

View rodrigomelo9's full-sized avatar

Rodrigo A. Melo rodrigomelo9

View GitHub Profile
@rodrigomelo9
rodrigomelo9 / pdftk.sh
Last active November 9, 2023 18:31
Remove pages from PDFs
pdftk <SOURCE>.pdf cat <INIPAGE1>-<ENDPGAE1> <INIPAGE2>-<ENDPGAE2> output <DEST>.pdf
pdftk <SOURCE>.pdf burst
@rodrigomelo9
rodrigomelo9 / README.md
Last active July 20, 2023 21:25
Bootable Linux USB
# cp debian.iso /dev/sdX
# sync
git tag -d <TAGNAME>
git push --delete origin <TAGNAME>
git tag -a <TAGNAME>
git push --follow-tags
@rodrigomelo9
rodrigomelo9 / config.v
Last active September 9, 2022 00:15
Verilog configuration
config cfg;
design top;
instance top.aux_inst.mod_inst use mod2;
endconfig
module top (input a, output b);
aux aux_inst (.a(a), .b(b));
endmodule
module aux (input a, output b);
@rodrigomelo9
rodrigomelo9 / remove-i386.md
Created April 14, 2022 11:48
Remove i386 in Debian/Ubuntu

Optional checks:

dpkg --print-foreign-architectures
dpkg -l | grep i386

Remove:

apt-get purge ".*:i386"
dpkg --remove-architecture i386
@rodrigomelo9
rodrigomelo9 / git-fix-email
Last active June 7, 2024 16:42
Fix the email in the commits of a branch
* git config [--global] user.email "new@email.com"`
* git config [--global] user.name "New name"
* git log (find previous commit reference)
* git rebase -i <previous commit reference> -x "git commit --amend --reset-author -CHEAD"
* Verify and close the opened editor
* git log (to verify)
* git push --force
@rodrigomelo9
rodrigomelo9 / git-ssh.md
Last active February 3, 2022 15:40
git with a new ssh key
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example
cd example
git config core.sshCommand 'ssh -i ~/.ssh/id_rsa_example'

It is normally useful when you need a new user, so probably a new email, so in the repo directory:

$ git config user.email "new@email.com"

Join:

gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=newfile.pdf file1.pdf file2.pdf

Split:

gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=15 -dLastPage=30 -sOutputFile=newfile.pdf origfile.pdf

Pyenv notes

Mainly a summary from Managing Multiple Python Versions With pyenv

Installation

In a Debian based systems, as root:

apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl