Skip to content

Instantly share code, notes, and snippets.

@eraad
eraad / clamav-macosx.md
Created June 4, 2022 09:50 — forked from DerFichtl/clamav-macosx.md
clamav on mac osx - install and configure the virus scanner on mac osx
layout post
title clamav - install and configure on mac osx
published true
tags
blog
clamav

Install Clamav

Install clamav via homebrew

@eraad
eraad / query_datil_invoices.php
Created April 3, 2019 14:52
Consulta de comprobantes emitidos en Datil
<?php
require 'vendor/autoload.php';
$headers = array('X-Api-Key' => 'tu-api-key',
'Accept' => 'application/json');
$params = array('issue_from' => '2019-01-01',
'issue_to' => '2019-12-31',
'page_size' => '10',
'page' => '1',
@eraad
eraad / clave_de_acceso_sri_ec.py
Created April 1, 2019 22:13
Generador de clave de acceso para documentos electrónicos (SRI Ecuador)
def generar_clave_acceso(self, fecha, numero, codigo, ambiente):
hoy = fecha
codigonumerico = str(
Decimal('%02d%02d%04d' % (hoy.day, hoy.month, hoy.year)) + Decimal(
self.entidad.ruc) + Decimal('%3s%3s%9s' % (
self.codigoestablecimiento, self.codigopuntoemision, str(
numero).zfill(9))))[:8]
parcial = "%02d%02d%04d%2s%13s%1d%3s%3s%9s%8s%1d" % (
hoy.day, hoy.month, hoy.year, codigo, self.entidad.ruc,
@eraad
eraad / reissue_invoices_from_csv.clj
Last active January 11, 2018 22:52
Reissue invoices from CSV
;;; Expects a CSV with one column including the document Datil id.
(ns datil-reissue.core
(:require [clojure.data.csv :as csv]
[clojure.java.io :as io]
[clj-http.client :as http]
[cheshire.core :as json])
(:gen-class))
(def params {:api-host "https://link.datil.co"
sed "s/$/,/g" file.csv
@eraad
eraad / bulk_rename_files.sh
Created September 21, 2017 00:16
Bulk rename nested files
find . -type f -name *RUC* -execdir mv {} ruc.pdf \;
@eraad
eraad / bulk_rename.sh
Created September 20, 2017 19:01
Bulk rename folders removing the last 3 characters
for i in ???*; do mv -i "$i" "${i%???}"; done
@eraad
eraad / java_methods.clj
Created November 25, 2016 16:09
Get methods from Java class from Clojure
;; http://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure
(require '[clojure.reflect :as r])
(use '[clojure.pprint :only [print-table]])
(print-table (:members (r/reflect "foo")))
@eraad
eraad / gist:fd8ed436efa4818504c468cf88c2b76b
Created May 7, 2016 21:18 — forked from sebsto/gist:19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@eraad
eraad / README.md
Created May 4, 2016 02:50 — forked from hilios/README.md
init.d for supervisord for Amazon Linux AMI

Auto start for Supervisord at AWS

Install commands
$ sudo mv supervisor /etc/init.d
$ sudo chkconfig --add supervisor
$ sudo chkconfig supervisor on