Skip to content

Instantly share code, notes, and snippets.

View cig0's full-sized avatar

Martín Cigorraga cig0

View GitHub Profile
@cig0
cig0 / grub.cfg
Created January 18, 2016 01:54
/boot/efi/EFI/fedora/grub.cfg
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
@cig0
cig0 / mongod.conf
Last active February 15, 2016 02:02
/etc/mongod.conf - Percona Server for MongoDB 2.6 mmap
# mongod.conf, Percona Server for MongoDB
# for documentation of all options, see:
# http://docs.mongo.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine: mmapv1
@cig0
cig0 / grep-mongodb-magic.sh
Last active October 31, 2016 08:29
Migrating collections from a mongoDB 2.6 mmap database to Percona Server for mongoDB 3.0.8 wiredTiger
# Fixex the error 'Failed: restore error: listDB.lists: error creating collection \
# listDB.lists: error running create command: exception: specify size: when capped is true'
#
# Credits: Juan Pablo Nogueira, https://ar.linkedin.com/in/juan-pablo-nogueira-30645514/en
grep -rl ', "capped" : { "$undefined" : true }, "size" : { "$undefined" : true }' \
/path/to/DB/to/be/restored/* | xargs sed -i 's/, "capped" : { "$undefined" : true }, \
"size" : { "$undefined" : true }//g'
@cig0
cig0 / git-track
Created February 15, 2016 04:14
Git: keeping a GitHub fork updated
git clone git@github.com:croaky/dotfiles.git
cd dotfiles
git remote add upstream git@github.com:thoughtbot/dotfiles.git
@cig0
cig0 / .tmux.conf
Last active February 20, 2016 01:43
.tmux.conf
# ~/.bash_profile: executed by the command interpreter for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"

Keybase proof

I hereby claim:

  • I am i90rr on github.
  • I am i90rr (https://keybase.io/i90rr) on keybase.
  • I have a public key whose fingerprint is 31BC 13E1 6D68 3ECD 4DB0 7449 1839 0461 D96E 287D

To claim this, I am signing this object:

@cig0
cig0 / .htaccess
Created June 17, 2016 01:15 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@cig0
cig0 / Documentation.md
Created August 30, 2016 21:14 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@cig0
cig0 / core-values-greeting.sh
Created October 9, 2016 02:58 — forked from ichramm/core-values-greeting.sh
Prints an Intraway's core value in ASCCI art
#!/bin/bash
# File: core-values-greeting.sh
# Author: ichramm
# Description: Prints a core value in ASCCI art
# Usage: core-values-greeting.sh [core-value|login]
# Params:
# core-value: The core value to print , Accepted values: become,enjoy,more,strive,team,think,wow
# Prints a random core value if not set,
# Orints a greeting plus a random core value if it is set to 'login'
#!/bin/bash
# Don't put duplicate lines in the history
export HISTCONTROL=ignoredups
# Store a lot history entries in a file for grep-age
shopt -s histappend
export HISTFILE=~/long_history
export HISTFILESIZE=50000