Skip to content

Instantly share code, notes, and snippets.

@ismaGNU
ismaGNU / gist:29b34d90b04315173165485f9355a269
Created June 6, 2016 22:31
Fast search and replace command line
ack -l 'pattern' | xargs perl -pi -E 's/pattern/replace/g'
@ismaGNU
ismaGNU / gist:58bd44775cbd979e34c8
Created February 17, 2015 16:04
Rename jpg adding numbers or operating with them
n=10000; e='JPG'; j=0; for f in *.$e; do mv "$f" IMG_"${n}".$e; ((n++)); done
@ismaGNU
ismaGNU / designer.html
Created January 21, 2015 11:56
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@ismaGNU
ismaGNU / new_gist_file_0
Created July 30, 2014 09:32
Delete a bunch of redis key in LuA
EVAL "return redis.call('del', unpack(redis.call('keys',ARGV[1])))" 0 setlist:*
@ismaGNU
ismaGNU / Draw image imagemagick
Created July 28, 2014 16:38
Draw an image with hex color through command line
convert -size 100x100 xc:#990000 whatever.png
@ismaGNU
ismaGNU / new_gist_file
Created July 30, 2013 12:18
Limit Interface Bandwidth
wondershaper eth0 1024 512
@ismaGNU
ismaGNU / Select and check column
Created May 13, 2013 08:55
SELECT and check if exist column in another table
SELECT
*, CASE WHEN EXISTS (
SELECT * FROM campaigns c
WHERE c.ev_id = e.ev_id) THEN 1 ELSE 0 END AS promoted
FROM
eventos e
WHERE
...
rsync -avz ssh usuario@ip:/carpetasinc /carpeta/destino/
@ismaGNU
ismaGNU / Network Loss
Created April 16, 2013 15:17
See network loss
mtr "ip"
mtr domain
@ismaGNU
ismaGNU / Rename multiple files
Created April 16, 2013 15:16
Rename multiple files regular expresion
rename -n 's/9434(.*)/1$1/' *.jpg