Skip to content

Instantly share code, notes, and snippets.

@591342534
591342534 / SimpleHTTPServerWithUpload.py
Created May 27, 2019 08:13 — 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.
"""
@flexiondotorg
flexiondotorg / triple-head.sh
Created November 13, 2018 23:14
xrandr script for ThinkPad P1/X1 Extreme and 2 externals monitors connected to ThinkPad Thunderbolt 3 Dock
#!/usr/bin/env bash
SCREENS=$(xrandr --query | grep connected | grep -v disconnected | cut -d' ' -f1)
INTERNAL=$(echo ${SCREENS} | grep eDP-1-1)
RET=$?
if [ ${RET} -eq 0 ]; then
echo "Internal panel detected."
xrandr --output eDP-1-1 --auto
exit
fi
@eberloso
eberloso / delete_workflows_duplicats.sql
Last active May 31, 2021 19:15
Consultar i eliminar workflows duplicats
delete from wkf_workitem where id in (select min(wkd.id) from wkf_workitem wkd where wkd.inst_id in (select
inst_id
from
wkf_workitem wki
JOIN wkf_instance ins ON ins.id = wki.inst_id
group by
inst_id, ins.res_id, ins.res_type, ins.uid
having
count(*) > 1
@jaumef
jaumef / Ainstall_wkhtmltopdf.sh
Last active April 13, 2020 14:28
Webkit Header HTML to PDF binaries for linux on version 0.12.2.1
# Get files from this gist (wkhtmltoimage is optional)
wget https://gist.github.com/jaumef/9eb558ac976b2a80269cc51ca8c97087/raw/8d5ceafea1dd387a83eb7eaa699354819b6910d7/wkhtmltopdf
# Set permissions
chmod +x wkhtmltopdf
# Move/copy the files to local binaries (/usr/local/bin)
sudo mv wkhtmltopdf /usr/local/bin/
@dankrause
dankrause / postgresql_recursive.sql
Last active February 26, 2024 16:03
An example of creating a recursive postgresql query to generate data about parent-child relationships within a single table.
CREATE TABLE test
(
id INTEGER,
parent INTEGER
);
INSERT INTO test (id, parent) VALUES
(1, NULL),
(2, 1),
get_caller_stack():
import inspect
for stack in inspect.stack():
print "{0}:{1}".format(stack[1], stack[2])
@tinogis
tinogis / x11vnc.md
Last active December 30, 2015 14:53
x11vnc screen and program sharing

Screen sharting with x11vnc

Share desktop screen

x11vnc -display :0

Share only one screen on a dual screeen desktop for multiples (-shared) clients

@duggan
duggan / cast.py
Last active November 28, 2020 21:55
Using pychromecast to headlessly stream youtube videos
#!/usr/bin/env python
"""
Requires pychromecast.
Install with `pip install pychromecast`
usage: cast.py [-h] -d DEVICE -v VIDEO
Cast YouTube videos headlessly.
@tinogis
tinogis / report.py
Last active January 21, 2019 18:30
Get and view an erp5 pdf report from command line
from erppeek import Client
import sys
import base64
from subprocess import call
import time
#report = 'giscedata.facturacio.factura'
#ids = [1513047, 1513049, 1513057, 1513042]
#ids = [1513042]