Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View amatellanes's full-sized avatar

Adrián Matellanes amatellanes

View GitHub Profile
@amatellanes
amatellanes / sublime.sh
Last active October 26, 2021 20:34
Install Sublime Text 3 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/sublime-text-3;
sudo apt-get update;
sudo apt-get install sublime-text-installer;
sudo ln -s /usr/lib/sublime-text-3/sublime_text /usr/local/bin/sublime;
@amatellanes
amatellanes / chrome.sh
Created November 12, 2013 11:10
Install Google Chrome 64-bit version on Ubuntu 14.04 LTS (Trusty Tahr)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb;
sudo apt-get -f install
@amatellanes
amatellanes / mdcharm.sh
Last active June 11, 2021 12:58
Install MdCharm 1.2 on Ubuntu 14.04 LTS (Trusty Tahr)
wget https://github.com/zhangshine/MdCharm/releases/download/1.2.0/mdcharm_1.2_amd64.deb;
sudo dpkg -i mdcharm_1.2_amd64.deb;
sudo apt-get -f install
@amatellanes
amatellanes / bleachbit.sh
Last active December 28, 2015 02:39
Install BleachBit 1.2 on Ubuntu 14.04 LTS (Trusty Tahr)
wget http://katana.oooninja.com/bleachbit/sf/bleachbit_1.2_all_ubuntu1404.deb;
sudo dpkg -i bleachbit_1.2_all_ubuntu1404.deb;
sudo apt-get -f install;
@amatellanes
amatellanes / oracle_java8.sh
Last active June 8, 2021 23:37
Install Oracle Java 8 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/java;
sudo apt-get update;
sudo apt-get install oracle-java8-installer;
sudo update-alternatives --config java;
java -version;
@amatellanes
amatellanes / handy_git_commands.sh
Last active May 4, 2021 22:31
Handy Git commands
$ git reset --hard HEAD~1
$ git push -f # removes last commit.
$ git diff --staged # will show you the diff that you're about to commit.
$ git commit -am "First commit" # adds all changes to tracked files and uses the commit message from the command-line.
$ git diff -M # only considers a file that disappeared as the source of a rename.
$ git diff -b # the -b means ignore whitespace, useful since we've changed some html indenting.
@amatellanes
amatellanes / forms.py
Last active February 19, 2021 09:55
A Yes/No field for Django.
from django import forms
class Form(forms.Form):
field = forms.TypedChoiceField(coerce=lambda x: x =='True',
choices=((False, 'No'), (True, 'Yes')))
@amatellanes
amatellanes / django_ext_script.py
Last active March 9, 2018 22:54
Bypassing manage.py in Django.
from django.core.management import setup_environ
from myproject import settings
setup_environ(settings)
# As of Django 1.4
import os
@amatellanes
amatellanes / Configure Spanish keyboard on Ubuntu
Created June 6, 2014 22:26
Configure Spanish keyboard on Ubuntu.
# Fast method. Run next command on terminal
sudo setxkbmap -layout 'es,es' -model pc105
# Modify /etc/X11/xorg.conf file
Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105″
@amatellanes
amatellanes / git_archive.sh
Created July 20, 2014 10:12
Create tarball and zipball from a repo using git.
git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz # Create a compressed tarball for v1.4.0 release.
git archive --format=zip --prefix=git-1.4.0/ v1.4.0 > git-1.4.0-docs.zip # Create a compressed zipball for v1.4.0 release.