Skip to content

Instantly share code, notes, and snippets.

@adriaPerez
adriaPerez / git-clean.sh
Last active September 15, 2016 11:15
Delete merged branches
git branch --merged | grep -v \* | xargs git branch -D
@adriaPerez
adriaPerez / reset-docker.sh
Created September 6, 2016 07:51
Docker: Remove all images and containers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@adriaPerez
adriaPerez / git-log.sh
Created October 5, 2016 16:07
Git network in the terminal
git log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local
@adriaPerez
adriaPerez / arch.md
Last active April 1, 2021 09:14
ArchLinux installation

Arch Linux
Intel® Core™ i7-4790K 4.0Ghz
2x8GB DDR3 1866 PC3-14900
GeForce GTX 970/PCIe/SSE2
MSI Z97 Gaming 5

  1. Download the iso from the Archlinux Oficial Download Page.
  2. Make sure the checksum of the downloaded iso is the same that the previous download page says:
@adriaPerez
adriaPerez / git-profile.sh
Created October 27, 2016 15:03
Change multiple git configurations
#!/bin/bash -l
#$ -S /bin/bash
#$ -N $1
if [ $1 = "github" ]
then
echo "Github profile activated!"
git config --global user.name "USERNAME"
git config --global user.email "EMAIL"
elif [ $1 = "gitlab" ]

Keybase proof

I hereby claim:

  • I am adriaPerez on github.
  • I am adriaperez (https://keybase.io/adriaperez) on keybase.
  • I have a public key whose fingerprint is A8FF 09FB 0E5C 2464 3CC7 3668 E2BC 47F8 214A EC6D

To claim this, I am signing this object:

@adriaPerez
adriaPerez / rebase-project-commits
Last active October 31, 2016 12:22
Rebase commits with incorrect creator data
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
043f7bbbbe5b2aa8af7930d01a6b574b96098105ee24bb607a854323c3beb5dbd3e77ffaaee92877bea261277d725b908783b08fa3a9e32ed6885b353222197b9f;nortss
# Remove archived journal files until the disk space they use falls below 100M
sudo journalctl --vacuum-size=100M
# Make all journal files contain no data older than 2 weeks
sudo journalctl --vacuum-time=2weeks
@adriaPerez
adriaPerez / setup-pass.md
Last active November 24, 2018 12:45
Setup pass storage and remote git sync

Setup pass with git

  1. Install pass utility

    sudo pacman -S pass
  2. Create a GPG key using the default RSA also (if not yet created)

gpg --full-gen-key