x11vnc -display :0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "x$VIRTUAL_ENV" == "x" ]; then | |
echo "Se debe activar el entorno virtual" | |
else | |
for lib in cairo gi glib gobject gtk-2.0 pygtk.pth pygtk.py; do | |
echo "Linking $lib..."; | |
ln -s /usr/lib/python2.7/dist-packages/$lib $VIRTUAL_ENV/lib/python2.7/site-packages/$lib; | |
done | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE test | |
( | |
id INTEGER, | |
parent INTEGER | |
); | |
INSERT INTO test (id, parent) VALUES | |
(1, NULL), | |
(2, 1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_caller_stack(): | |
import inspect | |
for stack in inspect.stack(): | |
print "{0}:{1}".format(stack[1], stack[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Requires pychromecast. | |
Install with `pip install pychromecast` | |
usage: cast.py [-h] -d DEVICE -v VIDEO | |
Cast YouTube videos headlessly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
NewerOlder