Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rdccosmo on github.
  • I am rdccosmo (https://keybase.io/rdccosmo) on keybase.
  • I have a public key whose fingerprint is 752E 7FFF 282A FA68 8415 D52B 5950 5564 1F3C 5553

To claim this, I am signing this object:

@rdccosmo
rdccosmo / rc.local
Created June 27, 2016 16:51
Tomcat não root para porta privilegiada 80
#/etc/rc.local
# Inicia tomcat com usuario tomcat usando authbind para porta privilegiada 80,
# dessa forma evitando de iniciar o processo como root, que e uma falha de seguranca
authbind --deep su tomcat -c /opt/tomcat/tomcat-app/bin/startup.sh 80
@rdccosmo
rdccosmo / docker.service
Created December 15, 2015 10:17
Docker service configuration to use overlay filesystem
#/lib/systemd/system/docker.service
[Unit]
0 Description=Docker Application Container Engine
1 Documentation=https://docs.docker.com
2 After=network.target docker.socket
3 Requires=docker.socket
4
5 [Service]
//valida o CPF digitado
function validaCPF(cpf)
{
erro = new String;
if (cpf.val().length == 11)
{
cpf.val(cpf.val().replace('.', ''));
cpf.val(cpf.val().replace('.', ''));
cpf.val(cpf.val().replace('-', ''));
// using: https://github.com/igorescobar/jQuery-Mask-Plugin
// version: v0.5.0+
var SPphoneMask = function(phone, e, currentField, options){
return phone.match(/^(\(?11\)? ?9(5[0-9]|6[0-9]|7[01234569]|8[0-9]|9[0-9])[0-9]{1})/g) ? '(00) 00000-0000' : '(00) 0000-0000';
};
$(".sp_celphones").mask(SPphoneMask, {onKeyPress: function(phone, e, currentField, options){
$(currentField).mask(SPphoneMask(phone), options);
}});