Skip to content

Instantly share code, notes, and snippets.

@dsoares
dsoares / BashPitfalls.md
Last active April 24, 2024 07:00
Bash Pitfalls
@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 / Makefile
Created November 15, 2022 14:13
Makefile notes
# dsoares
.PHONY: help map.html clear
default: map.html
## help : Print commands help.
help: Makefile
@sed -n 's/^##//p' $<
## map.html : Generate map.html
@dsoares
dsoares / greenpass.py
Last active June 29, 2021 11:03
Show COVID greenpass data
#!/usr/bin/python3
# Copyright 2021 Tobias Girstmair (https://gir.st). Consider this code GPLv3
# licensed.
# pip3 install flynn base45 PyPDF2 pyzbar Pillow
# dnf install zbar || apt install libzbar0
import sys
import glob
@dsoares
dsoares / install-of-eset-esmc-7-webconsole-at-lxc-on-ubuntu-18-04.md
Created April 17, 2020 13:14 — forked from gitpel/install-of-eset-esmc-7-webconsole-at-lxc-on-ubuntu-18-04.md
Installation of ESET ERA: ESMC 7 & Web Console at LXC (Linux Container) on Ubuntu 18.04 LTS

Installation of ESET ERA: ESMC 7 & Web Console at LXC (Linux Container) on Ubuntu 18.04 LTS

Tested on LXC container with Ubuntu 18.04 LTS

Read about How to install LXC\LXD on Ubuntu: https://linuxcontainers.org/lxd/getting-started-cli/

On LXC\LXD Host Mashine create a containe with Ubuntu 18.04 with name "eset"

lxc launch images:ubuntu/18.04 eset
@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 / loadimage.js
Created June 7, 2018 16:50 — forked from ahem/loadimage.js
Load and decode images with webworker
/* global createImageBitmap */
function loadImageWithImageTag(src) {
return new Promise((resolve, reject) => {
const img = new Image;
img.crossOrigin = '';
img.src = src;
img.onload = () => { resolve(img); };
img.onerror = () => { reject(img); };
});
@dsoares
dsoares / webworker-preloader.html
Created June 7, 2018 16:36 — forked from mseeley/webworker-preloader.html
WebWorker Image preloader proof of concept (Tested in Mobile Safari 6.0/IOS 6.1.3 and Chrome 33)
<!DOCTYPE html>
<html>
<head>
<title>WebWorker image preloading</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
</head>
<body>
<div id="output"></div>
<script id="imgloader" type="javascript/worker">
// Not race proof or robust. Proof of concept.
@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 / macosx_sierra_amc.md
Last active March 16, 2018 11:29
Installing AMC development version on Mac OS X Sierra

Installing AMC development version on macOS

This document is based on this instructions: Installing AMC development version on macOS

UPDATE 2018-03-15

Comments were added to this gist with a method to install AMC with Homebrew. To choose your best installation option, please read them before installation.