Skip to content

Instantly share code, notes, and snippets.

@sebolio
sebolio / Default (OSX).sublime-keymap
Created November 15, 2013 19:40
configuracion de teclas parecidas a aptana
/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["super+shift+n"], "command": "new_window" },
{ "keys": ["super+shift+w"], "command": "close_window" },
{ "keys": ["super+o"], "command": "prompt_open" },
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
{ "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },
@sebolio
sebolio / gist:09192516aa4213ac1f3a
Created November 18, 2014 15:43
JavaScript.tmLanguage con coloreado de TODOs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>JavaScript Syntax: version 2.0</string>
<key>fileTypes</key>
<array>
<string>js</string>
<string>htc</string>
git config --global alias.tree 'log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset"'
@sebolio
sebolio / gist:4d1f1e51863ac6b5ff9e
Created December 10, 2014 23:40
Dominios comodín en Apache
RewriteEngine On
RewriteBase /
# Dominios desarrollo (usado en el .htaccess de ida)
RewriteCond %{HTTP_HOST} (.+)\.dev\.ida\.cl
RewriteCond %{REQUEST_URI} !^/dev
RewriteRule (.*) /dev/%1/$1 [L,NC]
#otros, como Wordpress etc
@sebolio
sebolio / benchgrafico.sh
Last active September 4, 2015 15:32
Crear grafico con Apache Benchmark (ab)
#!/bin/bash
#Ejecuta un Apache Benchmark (ab) y lo grafica usando gnuplot
#tamaño imagen
w=1200
h=600
#úsame :3 pero úsame bien
@sebolio
sebolio / gist:a10471bd80fca51e4aa2
Created December 15, 2014 19:37
Vhost por usuario (apache2)
<Virtualhost *:80>
# Con una solicitud tipo: usuario.proyecto.dev
VirtualDocumentRoot "/home/%1/www/%2"
ServerName personales.dev
ServerAlias *.dev
UseCanonicalName Off
LogFormat "%V (%v) %h %l %u %t \"%r\" %s %b" vcommon
ErrorLog "/var/www/dev/vhosts-error_log"
<Directory "/home/*/www/*">
Options Indexes FollowSymLinks MultiViews
@sebolio
sebolio / flechas-scroll.sh
Last active September 4, 2015 18:05
Captura flechas del teclado y mouse usando buffer alternativo (smcup)
#!/bin/bash
#script que lee Arriba y Abajo de teclado y mouse y al matarlo vuelve a mostrar el buffer anterior de la consola ~seb.cl
#se usa `stty echo` al salir para q vuelva a activarse el echo de la consola, desactivado por `read`
#además a nivel de script desactivé todo el echo para poder usar el scroll del mouse sin que se vean signos raros
stty -echo
tput smcup
trap "tput rmcup;stty echo;exit" KILL INT
printf "Usa las flechas del teclado o el scroll del mouse\n\n"
while :;do
@sebolio
sebolio / gist:4fc425ff3ee93f9ea259
Last active September 4, 2015 18:05
Requisitos pa s3fs
#no estoy seguro si todo es necesario, pero las dos primeras sí ~seb
#esto no me funcionó en Ubuntu (sucks) pero sí en Debian
sudo apt-get install automake
sudo apt-get install build-essential
sudo apt-get install libfuse-dev
sudo apt-get install fuse-utils
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
@sebolio
sebolio / gist:bb240f6a1ec75e09fad3
Created December 17, 2014 15:43
Probar escritura en disco (500mb)
time echo d|dd if=/dev/zero of=asd bs=524288000 count=1
@sebolio
sebolio / buscar.sh
Last active August 8, 2016 16:42
Búsqueda texto en archivos con find
#busca solo en archivos (cambiar type en caso de querer otra cos)
#uso: sh buscar.sh <busqueda> <extension>
#remoto: bash <(curl -s URL.DEL.GIST)
buscar() {
echo "Buscando '$bus' en extension '$ext'"
find . -type f -exec sh -c "echo {}|grep -q '\.$ext' && echo '\033[0;31m Analizando \033[0;32m {} \033[0m:' && (cat {}|grep \"$bus\") " \;
}