- Install
sudo apt-get install xfce4-session xfce4-goodies xrdp tigervnc-standalone-server
- The files
/etc/xrdp/sesman.ini
and/etc/xrdp/xrdp.ini
may have to edited as in this gist, but it may work also with default configs - For reconnections (in guacamole) to existing session to work, the resolution in guacamole for the connection should be fixed (e.g. to
1280x900
in the connection settings) - Each user who wants to use it, should have the files
~/.xsession
and~/.vnc/xstartup
with the defaults in this gist in their home directory
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
@lxpanel --profile LXDE | |
@pcmanfm --desktop --profile LXDE | |
@point-rpi | |
@xset s off | |
@xset -dpms | |
@xset s noblank | |
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser/Default/Preferences | |
@chromium-browser --noerrdialogs --disable-infobars --kiosk http://[YOUR_URL] --incognito | |
#@xscreensaver -no-splash@ |
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/python | |
def rosbagit(method): | |
import subprocess | |
import roslib.packages | |
def cachable(method): | |
def cache_call(*args, **kw): | |
try: | |
return method.__globals__[method] |
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/python | |
def timeit(method): | |
import time | |
def timed(*args, **kw): | |
ts = time.time() | |
result = method(*args, **kw) | |
te = time.time() | |
if 'log_time' in kw: |
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
<?php | |
function tinker(...$args) { | |
// Because there is no way of knowing what variable names | |
// the caller of this function used with the php run-time, | |
// we have to get clever. My solution is to peek at the | |
// stack trace, open up the file that called "tinker()" | |
// and parse out any variable names, so I can load | |
// them in the tinker shell and preserve their names. |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
# source this to set the dbus env in a gnome session | |
export DISPLAY=:0 | |
PID=$(pgrep gnome-session) | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
# You may now configure things in gsettings, e.g. run vino: | |
gsettings reset org.gnome.Vino network-interface | |
gsettings set org.gnome.Vino enabled true | |
gsettings set org.gnome.Vino prompt-enabled false |
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
class MainWidget(QtGui.QMainWindow): | |
def __init__(self, parent=None): | |
super(MainWidget, self).__init__(parent) | |
self.setWindowTitle("FiFiFactory App") | |
self.resize(720,480) | |
self.setAcceptDrops(True) | |
def dragEnterEvent(self, event): | |
if event.mimeData().hasUrls(): | |
event.accept() |
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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |