Skip to content

Instantly share code, notes, and snippets.

@vifo
vifo / sane_terminal.sh
Last active May 29, 2018 17:36
Reset terminal to sane settings.
#!/bin/sh
#
# Usage: eval "$(curl -L https://git.io/vh38r)"
export TERMINAL="xterm-256color"
# set emacs mode
#set -o emacs
@vifo
vifo / gruvbox.theme
Created March 31, 2018 18:28 — forked from EvergreenTheTree/gruvbox.theme
Gruvbox dark theme for xfce4-terminal (put this in ~/.xfce4/config/terminal/terminalrc)
ColorForeground=#f2f2e5e5bcbc
ColorBackground=#323230302f2f
ColorCursor=#d65bc4cd8ca1
ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#929283837474;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#b9b9a6a69393
@vifo
vifo / boot-dotfiles.sh
Created August 24, 2017 10:59
Boot dotfiles.
#!/bin/sh
NAME="$(readlink -f "$0")"
echo $NAME
cleanup() {
true
}
dotfile() {
@vifo
vifo / Config.pm
Created January 18, 2014 17:53
Perl 5.18.2 CPAN Config.pm
# CPAN configuration for Perl 5.18.2 running under perlbrew. Install with:
#
# \$curl https://gist.github.com/vifo/8493828/raw/Config.pm \
# >/usr/local/perl/perls/perl-5.18.2/lib/5.18.2/CPAN/Config.pm
#
# to use as side-wide CPAN configuration.
$CPAN::Config = {
'applypatch' => q[],
'auto_commit' => q[1],
@vifo
vifo / cleanup_linux_mint_15.sh
Last active October 5, 2018 22:49
Cleanup temporary files and caches on Linux Mint 15
#!/usr/bin/env bash
#
# Cleanup temporary files on a Linux Mint 15 Olivia installation.
#
# This script will happily wipe all root/user temporary files, old kernels,
# browser caches and cpan/cpanm build directories. Review before running
# blindly.
#
# Though, so far, there are no Linux Mint 15 Olivia specific cleanups here,
# this script ensures, that we're really running under this distribution. Feel
@vifo
vifo / install_perlbrew.sh
Last active July 24, 2018 17:37
Perl: Install latest stable Perl via perlbrew with custom perlbrew root and options.
#!/usr/bin/env bash
export CC="gcc"
export CFLAGS="-march=native -O2 -Wall -pipe"
export CXXFLAGS="-march=native -O2 -Wall -pipe"
export PERLBREW_ROOT="/usr/local/perl"
export PERLBREW_CONFIGURE_FLAGS="-Dcc=gcc -Dinstallusrbinperl=n -Dpager=\"/usr/bin/sensible-pager\" -Uman1dir -Uman3dir -Usiteman1dir -Usiteman3dir -Uuseshrplib -Uusethreads -Uvendorman1dir -Uvendorman3dir -des"
curl -L http://install.perlbrew.pl | bash
@vifo
vifo / gist:4443720
Created January 3, 2013 14:09
Bash: Get directory current script is located in (with Bash 2 fallback)
#!/usr/bin/env bash
SCRIPT_PATH="${BASH_SOURCE[0]}" # for Bash > 3.0
[ -z "${SCRIPT_PATH}" ] && SCRIPT_PATH=$(readlink -f "$0") # for Bash 2
SCRIPT_DIR=$(cd $(dirname "${SCRIPT_PATH}") && pwd)
echo "Script path: ${SCRIPT_PATH}"
echo "Script directory: ${SCRIPT_DIR}"
@vifo
vifo / ruby_gcc_settings.sh
Created November 27, 2012 19:43
Ruby: Default CFLAGS for building
#!/usr/bin/env bash
export CFLAGS="-march=native -O3 -Wall -pipe -fomit-frame-pointer"
export CXXFLAGS="${CFLAGS}"
export LANG=en_US.utf8
unalias cp mv >/dev/null 2>&1
@vifo
vifo / install.sh
Created September 26, 2012 09:05
Ruby: Install Ruby 1.9.3-p327 via rvm with cumulative performance patch
#!/usr/bin/env bash
#
# This script will install Ruby 1.9.3-p327 via rvm with additional performance
# patches for faster Rails boot. Please refer to
#
# https://gist.github.com/1688857
#
# for detailed information. Run directly with:
#
# curl https://raw.github.com/gist/3786925/install.sh | bash
@vifo
vifo / cpannti.sh
Created May 17, 2012 12:15
Perl: "notest install module" from shell using CPAN
#!/bin/sh
# Usage: cpannti.sh <module_names>
# cpan (i.e. App::Cpan) does not provide a direct way to install modules without
# testing them, as you can do in the CPAN shell with:
#
# cpan[1]> notest install FooBarBaz
#
# App::Cpan uses CPAN::Shell under the hood to perform installation, so let's do