x11vnc -display :0
This file contains hidden or 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 hidden or 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
mike@rbci:~$ psql -U postgres | |
psql (9.0.3) | |
Type "help" for help. | |
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
UPDATE 1 | |
postgres=# \c template0 | |
You are now connected to database "template0". | |
template0=# update pg_database set datistemplate = FALSE where datname = 'template1'; | |
UPDATE 1 |
To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo
if you're logged in as root.
-
Edit
/etc/ssh/sshd_config
and make sure to add the following at the end of the file:Match group filetransfer
ChrootDirectory %h
This file contains hidden or 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/sh | |
VPN_PATH="/etc/openvpn/porta/[email protected]" | |
VPN_CONFIG="[email protected]" | |
case "$1" in | |
start) | |
echo "Connecting to GISCE VPN" | |
openvpn --client --config $VPN_PATH/$VPN_CONFIG >$VPN_PATH/logfile & | |
;; |
This file contains hidden or 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
\x | |
select | |
locked.pid AS locked_pid, | |
locker.pid AS locker_pid, | |
locked_act.usename AS locked_user, | |
locker_act.usename AS locker_user, | |
locked.virtualtransaction, | |
locked.transactionid as locked_transactionid, | |
locker.transactionid as locker_transactionid, | |
locked.locktype, |
This file contains hidden or 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 fuzzywuzzy import process | |
from fuzzywuzzy.utils import full_process | |
def processor(choice): | |
return full_process(choice['name']) | |
res = process.extractOne(poblacio, poblacions_list, processor) | |
if not res: | |
print "Població no trobada: %s" % poblacio | |
continue |
NewerOlder