Skip to content

Instantly share code, notes, and snippets.

@guilleJB
guilleJB / setup-ubuntu-jammy-jellyfish.md
Created December 8, 2022 14:52 — forked from ahasverus/setup-ubuntu-jammy-jellyfish.md
Setup Ubuntu 20.04 on Lenovo X1 Carbon 7th Gen

Setup Ubuntu 22.04 on Lenovo X1 Carbon 7th Gen

SYSTEM SECURITY

Update System

@guilleJB
guilleJB / SimpleHTTPServerWithUpload.py
Created September 1, 2022 13:15 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@guilleJB
guilleJB / gist:8e41e3fa293f3ac3fc91833be66027ea
Created June 16, 2020 22:47 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@guilleJB
guilleJB / gist:fca761b0c83270694f8b910a01eb230d
Last active April 13, 2020 14:27 — forked from jaumef/Ainstall_wkhtmltopdf.sh
Webkit Header HTML to PDF binaries for linux on version 0.12.2.1
We couldn’t find that file to show.
@guilleJB
guilleJB / oauth_client.py
Created December 17, 2019 22:51 — forked from utsengar/oauth_client.py
oAuth client - python
"""
The MIT License
Source: https://github.com/simplegeo/python-oauth2/blob/master/example/client.py
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@guilleJB
guilleJB / nginx_reverse_for_notebook
Created November 20, 2019 17:06 — forked from kent119/nginx_reverse_for_notebook
Config Nginx as a reverse proxy for Jupyter notebook on VPS
# /etc/nginx/sites-enabled/some.domain
# Change the server name {some.domain}
# Change the {host.of.notebook} and {port} in the following locations
server {
listen 80;
# Change the server name {some.domain}
server_name some.domain;
location / {
# Change the {host.of.notebook} and {port}
proxy_pass http://host.of.notebook:port;
@guilleJB
guilleJB / Directions for creating PEM files
Created October 25, 2018 10:54 — forked from dain/Directions for creating PEM files
Create Java KeyStore from standard PEM encoded private key and certificate chain files
# To regenerate the test key and certificates
# Generate an RSA private key and convert it to PKCS8 wraped in PEM
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -out rsa.key
# Generate a certificate signing request with the private key
openssl req -new -key rsa.key -out rsa.csr
# Sign request with private key
openssl x509 -req -days 10000 -in rsa.csr -signkey rsa.key -out rsa.crt
@guilleJB
guilleJB / git-squash.sh
Created January 4, 2018 16:04 — forked from favila/git-squash.sh
git-squash: script to create a squashed patch from a branch.
#! /bin/sh
# Produce a squash-commit patch from a branch of changes
MASTER=$1
PATCHBRANCH=$2
SQUASHBRANCH="$PATCHBRANCH-squash"
MESSAGE=$3
git checkout -b $SQUASHBRANCH $MASTER &&
git merge --squash $PATCHBRANCH &&
git commit -a -m "$MESSAGE" &&
@guilleJB
guilleJB / Change extra name.py
Last active September 14, 2017 10:39
Extra lines suplements
from tqdm import tqdm
from erppeek import Client
extra_obj = c.model('giscedata.facturacio.extra')
extra_ids = extra_obj.search([('name','ilike', 'Suplement%2013')])
fact_helper = c.model('giscedata.facturacio.switching.helper')
for extra_id in tqdm(extra_obj.read(extra_ids,['polissa_id'])):
new_name = fact_helper.calc_extra_name(extra_id['polissa_id'][0])
@guilleJB
guilleJB / example.py
Created December 13, 2016 08:44 — forked from schlamar/example.py
mplog: Python advanced multiprocessing logging.
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')