Skip to content

Instantly share code, notes, and snippets.

View JuanjoSalvador's full-sized avatar
🏠
Working from home

Juanjo Salvador JuanjoSalvador

🏠
Working from home
View GitHub Profile
@mildsunrise
mildsunrise / fnmt_handle.py
Last active September 19, 2023 09:11
🔐 Open source implementation of FNMT's certificate configurator v1.0.1 (https://twitter.com/mild_sunrise/status/1585611873860440067)
#!/usr/bin/env python3
'''
Open source implementation of FNMT's certificate configurator v1.0.1
<https://www.sede.fnmt.gob.es/descargas/descarga-software/instalacion-software-generacion-de-claves>
No warranty provided; use this ONLY if you know what you're doing.
Usage: ./fnmt_handle.py <fnmtcr URL>
Fulfills the request indicated by the URL, sending request to answer operation as completed if there are no errors.
For the fnmtcr://request phase, the generated private key is written to "privkey.pem" in current directory.
@JuanjoSalvador
JuanjoSalvador / wine-installer.sh
Last active January 30, 2022 21:25
Script to install Wine Staging from WineHQ repositories (Debian)
#!/bin/bash
VERSIONS="buster|bullseye|bookworm"
BRANCHES="stable|devel|staging"
if [ "${UID}" -eq 0 ] ; then
ARCH=$(dpkg --print-architecture)
if [ "${ARCH}" == "amd64" ] ; then
#/bin/bash
# Installs libfreetype6 2.8.0 into affected electron app.
# For more details ee:
# https://github.com/atom/atom/issues/15737
# https://github.com/Microsoft/vscode/issues/35675
CRT=$(dpkg-query --showformat='${Version}' --show libfreetype6)
CRT=$(echo $CRT | sed -e 's/-.*$//g')
@JuanjoSalvador
JuanjoSalvador / downloader.py
Last active June 11, 2024 06:58
Extracts and decrypt a list of adf.ly links from a forum's post
# -*- coding: utf-8 -*-
import base64, requests, os, re, sys
from bs4 import BeautifulSoup
def _crack(code):
zeros = ''
ones = ''
for n,letter in enumerate(code):
@Soransik
Soransik / __init__.py
Last active November 7, 2017 18:06
Create Desktop Apps with HTML interface and Python
#/
# Server/
# /__init__.py
# /templates/
# /index.html
# app.pyw
# test_webview.py
from flask import Flask, render_template, request
app = Flask(__name__)
@linuxct
linuxct / arch-shell.sh
Last active August 17, 2017 22:44 — forked from JuanjoSalvador/debian-shell.sh
Archlinux package managers shell aliases
# Place the content of this script at the bottom of your ~/.bashrc file (or ~/.zshrc if you are using ZSH).
# Please be ensure that your shell doesn't have any alias or plugin with the following names: paci, pacu, pacr, pacq, pacd, pacl
# Replace 'pacman' with 'pacaur' if you want to use it instead,
PMG="pacman"
if [ "$PMG" = "pacman" ]; then
ELEVATOR="sudo"
elif [ "$PMG" = "pacaur" ]; then
ELEVATOR=""
@JuanjoSalvador
JuanjoSalvador / chuckfacts.py
Last active August 25, 2017 11:34
Chuck Norris facts in Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
line = round(random.random() * 100 - 2)
facts = []
with open("quotes.txt", "r") as f:
@Nixes
Nixes / Easy SQLite Gogs Installation for Ubuntu and Debian.md
Last active August 3, 2019 12:34
Easy SQLite Gogs Installation for Ubuntu and Debian

This is a tutorial that describes how to set up a private git (github) server for a smallish development team.

  • Download GOGS binary Zip File
  • Unzip to folder
  • Run: sudo apt-get install sqlite3
  • Run GOGS: ./gogs web
  • Goto install page: http://hostname:3000/install
  • Set to use sqlite3 as the database backend
  • Set USER to run as, preferrably not root if it will be internet facing.
  • Set Database file location (Make sure database file location is set to a folder where that same user has write permissions)
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@JuanjoSalvador
JuanjoSalvador / checkboxCounter.js
Last active June 4, 2024 17:27
Contador de checkboxes en JavaScript
function contar() {
var checkboxes = document.getElementById("test").checkbox; // Array de checkboxes
var cont = 0; // Checkboxes marcados, por defecto empieza la cuenta en 0
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
cont = cont++;
}
}
var porcen = (cont/checkboxes.length) * 100; // Porcentaje de checboxes marcados