Skip to content

Instantly share code, notes, and snippets.

View antespi's full-sized avatar

Antonio Espinosa antespi

View GitHub Profile
@antespi
antespi / HowTo: Sorted disk usage (du)
Last active June 25, 2024 17:10
List first level directories inside a directory, sorted by size. Useful when your disk is full and you are searching something to erase or move elsewhere.
du -k -d1 * | sort -nr | cut -f2 | xargs -d '\n' du -sh
@antespi
antespi / HowTo: Git patching
Last active December 24, 2015 21:19
Git patching
Get a patch from a git branch
=============================
Create a branch, or go to the branch in which we want to modify code
# git checkout -b fix_empty_poster
Make your changes, and see your commits in log
# git log --pretty=oneline -3
@antespi
antespi / HowTo: Dump and Restore disk image
Last active December 26, 2015 04:19
Dump/Restore disk image
Dump disk into zip file
=======================
# /bin/dd if="$DEVICE" conv=sync,noerror bs=64K | /bin/gzip -c > "$FILE"
Restore from zip file
=======================
# gunzip -c "$FILE" | dd of="$DEVICE" conv=sync,noerror bs=64K
@antespi
antespi / HowTo: Git discard changes.md
Last active December 26, 2015 07:19
Discard changes in working tree

Save changes to stash

git stash save --keep-index

Discard stash

@antespi
antespi / BugFix : Nemo memory leak
Last active December 27, 2015 13:29
Bugfix: Nemo 1.8.3 has a memory leak bug (https://bugs.launchpad.net/linuxmint/+bug/1203406) Add ppa repository by Gwendal LE BIHAN fix it, and updates all packages for cinnamon and raring Mint distro version Notice: cinnamon-stable repository added, not cinnamon-nigthly!
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get -traring install nemo
sudo nano /etc/apt/preferences # Add this lines at the end of the file
Package: *
Pin: origin ppa.launchpad.net
Pin-Priority: 700
@antespi
antespi / HowTo: Decode base64
Created November 6, 2013 17:07
HowTo: Decode/Encode base64 using OpenSSL
Decode
======
openssl enc -base64 -d <<< SGVsbG8sIFdvcmxkIQo=
Encode
======
openssl enc -base64 <<< 'Hello, World!'
@antespi
antespi / Preferences: Date formats
Created November 9, 2013 09:39
My favorite date formats
date('d/m/Y H:i:s') => 31/12/1970 10:45:56
date('d/m/Y') => 31/12/1970
@antespi
antespi / Odoo - Rename an addon without losing data.md
Last active August 14, 2024 18:19
Odoo - Rename an addon without losing data

Odoo - Rename an addon without losing data

Rename addon

  • Change __openerp__.py addon name field
  • Change README.rst file
@antespi
antespi / fish_prompt.fish
Created November 27, 2016 00:48
My fish prompt
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
set -l fish_custom_color_user purple
set -l fish_custom_color_host red
set -l fish_custom_color_normal yellow
set -l fish_custom_color_cwd yellow
# User
set_color $fish_custom_color_user
echo -n (whoami)