Skip to content

Instantly share code, notes, and snippets.

!In the mood

Mateus Caruccio caruccio

!In the mood
View GitHub Profile
View teste-reboot.yml
Name: elasticsearch
Cartridge-Short-Name: ELASTICSEARCH
Display-Name: ElasticSearch 1.1.1
Description: "ElasticSearch"
Version: 1.1.1
License: Apache
Cartridge-Version: 0.0.2
Cartridge-Vendor: julianandandy
caruccio / bash-pattern-subst
Created Apr 24, 2012
Pattern substitution
View bash-pattern-subst
$ echo ${VAR/X/.} ## first occurence only (anywhere)
$ echo ${VAR//X/.} ## all occurences
$ echo ${VAR/#X/.} ## first occurence (only if beginning match)
caruccio / config.yml
Created Jun 12, 2012
Automatic remote download movies from (flexget + transmission)
View config.yml
## 1 - Create an account in and setup a RSS for your movies
## 2 - Install and configure flexget
$ sudo easy_install flexget
$ cat <<EOF > ~/.flexget/config.yml
caruccio / gist:3056826
Created Jul 5, 2012
Extract variable value from file
View gist:3056826
This should extract the value of a variable from a text file.
It works fine with bash/sh and makefile variables.
Had to use 2 sed()s to deal with name='value' cases.
Fixes are welcome.
$ sed --version
GNU sed version 4.1.5
$ cat filename.conf | \
sed -ne \
caruccio /
Created Sep 24, 2012
What does 'pythonic' means?
for i, j in { 'a': 1, 'b': 2 }.iteritems():
print i, j
for i, j in [ ('a', 1), ('b', 2) ]:
print i, j
caruccio / xorg-synaptics.conf
Created Nov 26, 2012
Setup xorg synaptics on my Dell Inspiron 14Z 5423
View xorg-synaptics.conf
Section "InputDevice"
Identifier "touchpad"
Driver "synaptics"
Option "LeftEdge" "1766"
Option "RightEdge" "5382"
Option "TopEdge" "1645"
Option "BottomEdge" "4563"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "FingerPress" "256"
View .gitconfig
pager = less -XF
name = Mateus Caruccio
email =
diff = auto
branch = auto
caruccio / .ssh_config
Created Mar 21, 2013
Reusing a shared master ssh connection across many ssh client instances (really fast login after first login).
View .ssh_config
Host my-server # Alias for this server so you can run "$ ssh my-server"
#ForwardAgent yes # Use local agent to password-free authentication
#User my_user # Name of remote user
#IdentityFile ~/.ssh/id_rsa-${MY_SERVER} # I suggest you to use key-pair auth
Hostname my.server.fqdn # Real server hostname
ControlMaster auto # share a single ssh connection across many ssh instances
ControlPersist 60 # send master connection to background, close it if idle for 60 seconds
ControlPath ~/.ssh/master/ssh-%h # place local sharing socket in a secure place
caruccio /
Last active Dec 16, 2015
Gists para o blog
from hammock import Hammock as Getup
username, password = '', 'minha_senha'
getup = Getup('', auth=(username, password))
caruccio /
Last active Dec 30, 2015
Original blog post on running Nginx PHP-FPM under OpenShift

Hosting your app using nginx: The high performance web server

Brazilian Portuguese version here.

OpenShift platform is an amazing tool when it comes to app development and deploy: auto scalable, secure by default, language agnostic and open-source. By abstracting infrastructure in a simple way, it is possible to create a full-fledged application with databases in a few minutes.

Even with all this power, sometimes we just need to serve a bunch os static files: HTML, images, javascript and CSS.