Skip to content

Instantly share code, notes, and snippets.

@dsoares
dsoares / reports.md
Created March 6, 2014 20:00
Some project report.

Relatórios Síntese







@dsoares
dsoares / imapsync.md
Last active May 16, 2018 12:31
Install and use imapsync in Mac OS X

Install imapsync in Mac OS X (10.9)

brew tap dsoares/imapsync
brew install imapsync

Run (example)

imapsync --include <regexp> --exclude "All Mail|Spam|Trash" \
  --host1 imap.from.server --user1 foo --password1 secret1 --ssl1 \

--host2 imap.dest.server --user2 bar --password2 secret2 --ssl2

@dsoares
dsoares / csrf_prevention.php
Last active August 29, 2015 14:03
CSRF prevention in PHP (by injection)
<?php
// CSRF start
function store_in_session($key,$value)
{
if(isset($_SESSION)){$_SESSION[$key]=$value;}
}
function unset_session($key)
{
$_SESSION[$key]=' ';unset($_SESSION[$key]);
@dsoares
dsoares / slurp.pl
Last active October 12, 2016 10:31
Slurp with Perl
#!/usr/bin/perl
#
# 2014-11-19: dsoares
# also see https://metacpan.org/pod/File::Slurp
#
use strict;
use warnings;
use 5.010;
@dsoares
dsoares / rot13.js
Created January 27, 2016 19:43
ROT13 in Javascript
function rot13(str) { // LBH QVQ VG!
var re = new RegExp("[a-z]", "i");
var min = 'A'.charCodeAt(0);
var max = 'Z'.charCodeAt(0);
var factor = 13;
var result = "";
str = str.toUpperCase();
for (var i=0; i<str.length; i++) {
result += (re.test(str[i]) ?
@dsoares
dsoares / snippets.cson
Last active November 24, 2018 11:26
Atom.io snippets for ansible
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@dsoares
dsoares / keybase.md
Last active October 12, 2016 10:31
Keybase proof

Keybase proof

I hereby claim:

  • I am dsoares on github.
  • I am dsoares (https://keybase.io/dsoares) on keybase.
  • I have a public key whose fingerprint is A4AA CA49 E7B4 D472 B9F4 8361 2550 0CA2 E58D FC92

To claim this, I am signing this object:

@dsoares
dsoares / .htaccess
Created September 16, 2016 09:23 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@dsoares
dsoares / macports-opencv.md
Last active November 8, 2016 12:19
Howto create my own port for MacPorts (opencv)
date author log
2016-10-10
dsoares
Howto create my own port for MacPorts

Instalar opencv com o MacPorts

Veio a propósito do pedido de slopes com o comando:

@dsoares
dsoares / macosx_sierra.md
Last active August 3, 2017 19:25
macosx_sierra.md

Issues with Mac OS X Sierra

1. Could not ssh from my Mac to my usual linux servers

The solution was to add this to my ssh config:

PubkeyAcceptedKeyTypes +ssh-dss
2. Macfusion says: "You can’t use this version of the application “Macfusion.app” with this version of macOS."