Skip to content

Instantly share code, notes, and snippets.

@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 / BashPitfalls.md
Last active April 24, 2024 07:00
Bash Pitfalls
@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 / monolog.php
Created June 8, 2017 16:24 — forked from mamchenkov/monolog.php
Example use of Monolog logger
<?php
// Before: composer require monolog/monolog
// composer autoloader
require_once 'vendor/autoload.php';
// Shortcuts for simpler usage
use \Monolog\Logger;
use \Monolog\Formatter\LineFormatter;
use \Monolog\Handler\StreamHandler;
@dsoares
dsoares / MyModel.php
Created March 7, 2017 20:06 — forked from havvg/MyModel.php
true MySQL ENUM with Propel
<?php
class MyModel extends BaseMyModel
{
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->type = ($row[$startcol + 1] !== null) ? $row[$startcol + 1] : null;
$this->resetModified();
@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.

@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."