Skip to content

Instantly share code, notes, and snippets.

@caio-nas
caio-nas / find_and_move_backups.sh
Last active December 20, 2015 04:59
Interact with all backup files at a directory
find . -name "*~" | while read x ; do mv $x ../$x ; done
@caio-nas
caio-nas / find_and_list_backups.sh
Created July 24, 2013 22:21
Lists all backup (~) files inside a directory
find . -name "*~" | while read x ; do echo $x ; done
@caio-nas
caio-nas / list_not_backups.sh
Created July 24, 2013 22:26
List all files that are not backup files
ls -l -B
@caio-nas
caio-nas / double_quote.sh
Created July 25, 2013 01:09
encloses each line of target_file with double quotes
cat targe_file | awk '{ print "\""$1"\"" }'
@caio-nas
caio-nas / single_quote.sh
Created July 25, 2013 01:12
encloses each line of target_file with single quotes
cat target_file | awk '{ print "'\''"$1"'\''" }'
@caio-nas
caio-nas / bash_aliases.sh
Created July 25, 2013 01:55
pack of common aliases
alias ..='cd ..'
alias ...='cd ..;cd ..'
alias cl='clear'
alias commit='git commit -a'
alias cp='cp -i'
alias dir='ls --color=auto --format=vertical'
alias doublequote='awk '\''{ print "\""$1"\"" }'\'''
alias em='emacs -nw'
alias eqq='emacs -nw -Q'
alias l='ls -CF'
@caio-nas
caio-nas / common-bootstrap-custom.css
Created July 26, 2013 23:23
- Define body globals - Adds a new breakpoint for narrow desktops - Optimizes font size for phones and tablets
/* -----------------------------------------------
Globals
----------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
@caio-nas
caio-nas / bootstrap_2.3.2_no-icons.css
Created July 27, 2013 00:54
Minified v2.3.2 without icons, use it with external icon frameworks
/*!
* Bootstrap v2.3.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
@caio-nas
caio-nas / create_cd_iso.sh
Created July 28, 2013 14:58
Create a ISO file for the specified DIR with the specified VOLUME_NAME
mkisofs -J -r -relaxed-filenames -nobak -allow-lowercase -V "[VOLUME_NAME]" -o ./cd.iso [DIR]
@caio-nas
caio-nas / rscyn_remote_to_local.sh
Last active December 20, 2015 08:29
sync local dir with remote dir. Always use complete path. The -n flag activates test run (only simulation)
rsync -n -arptv --delete-after --force -e ssh caionascimento@174.142.14.170:/var/www/vhosts/caionascimento.com.br/httpdocs/catalogo_ifba/ /home/consultjr/Caio\ -\ Documentos/merge_cd_ifba/