Skip to content

Instantly share code, notes, and snippets.

View marcelosantos's full-sized avatar

Marcelo Santos marcelosantos

View GitHub Profile
@samirfor
samirfor / play_when_process_done.sh
Created February 1, 2017 16:51
Bash script to play a song when a process ends.
#!/bin/bash
# Bash script to play a song when a process ends.
# License MIT <https://opensource.org/licenses/MIT>
# Author: @samirfor
PID=$1
SONGFILE=$2
if [ "${PID}x" = "x" ] || [ ! -r "${SONGFILE}" ]; then
@samirfor
samirfor / rsync_all_media_mounted.sh
Last active December 19, 2016 17:21
Rsync incremental + beep when finished
#!/bin/bash
SOURCE_DIR="$1"
if [ "${SOURCE_DIR}x" = "x" ]; then
SOURCE_DIR="/home/${USER}/Downloads/Fortaleza2040/" # the last / is important!
fi
[ ! -d "${SOURCE_DIR}" ] && echo "${SOURCE_DIR} is not a dir. Usage: $0 <dir>" && exit 2
for mount_point in $(find /media/${USER}/ -maxdepth 1 -type d); do
@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active July 27, 2024 16:49 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@hewerthomn
hewerthomn / install_postgresql9.3_postgis2.1_ubuntu.md
Last active October 19, 2020 09:02
Installing PostgreSQL 9.3 and PostGIS on Ubuntu 14.04

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
@edderrd
edderrd / Gruntfile.js
Created March 30, 2014 15:37
Sample laravel grunt file
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
less: {
development: {
options: {
paths: ["public/assets/less/*.less"]
}
}
},
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.