Skip to content

Instantly share code, notes, and snippets.

View paolodina's full-sized avatar
🔋
always on

Paolo Dina paolodina

🔋
always on
  • Italy
  • 04:14 (UTC +02:00)
View GitHub Profile
@paolodina
paolodina / SassMeister-input-HTML.html
Last active August 29, 2015 14:02
Generated by SassMeister.com. Gist shared, don't delete.
<!--
http://sassmeister.com/gist/680859146a5a951c19d5
http://www.browserstack.com/screenshots/9d960023f026c09729729eb067721d845c3829a7
Live example
http://paolo.php3.it/paolo/typo-1/
-->
<main class="va-debug">
<section id="intro">
@paolodina
paolodina / SassMeister-input-HTML.html
Created June 22, 2014 16:43
Generated by SassMeister.com.
<main>
<header>
<h1>Web Typography</h1>
<h2>Demystified</h2>
</header>
<h1>A section</h1>
<section>
<h2>Section heading</h2>
<p>A paragraph: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
@paolodina
paolodina / flask-oauth-jython
Created August 14, 2014 15:17
flask-oauth-jython import error
paolo@tk:~/devel/nicola/golap-project/project$ jython
from Jython 2.7b3+ (default:2c45f75a5406, Aug 14 2014, 10:08:07)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_55
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask_oauthlib.client import OAuth
log4j:WARN No appenders could be found for logger (org.python.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
paolo@tk:~/$ hg diff
diff --git a/lib-python/2.7/compileall.py b/Lib/compileall.py
rename from lib-python/2.7/compileall.py
rename to Lib/compileall.py
--- a/lib-python/2.7/compileall.py
+++ b/Lib/compileall.py
@@ -86,7 +86,7 @@
try:
mtime = int(os.stat(fullname).st_mtime)
expect = struct.pack('<4sl', imp.get_magic(), mtime)
@paolodina
paolodina / gist:f2cbf7b1c7cee2756b05
Last active August 29, 2015 14:07
execnet jython 2.7b3 (default:9fef5da411e5)
Update:
relevant discussion on IRC [21:13]
http://www.extreme.st/jython.extreme.st/irclogs/index.php/?date=2014-09-30
# test2.py
import execnet
gw = execnet.makegateway("popen//python=/path/to/jython")
gw.remote_exec("""
from org.example.query import QueryManager
m = QueryManager()
$ rvm gemdir
/home/paolo/.rvm/gems/ruby-2.1.2@zalter
$ ls /home/paolo/.rvm/gems/ruby-2.1.2@zalter/gems/
chunky_png-1.3.1 compass-import-once-1.0.5 normalize-scss-3.0.1 sass-3.4.5
compass-1.0.1 ffi-1.9.6 rb-fsevent-0.9.4 susy-2.1.3
compass-core-1.0.1 multi_json-1.10.1 rb-inotify-0.9.5
$ rvm @zalter do gem uninstall normalize-scss
Successfully uninstalled normalize-scss-3.0.1
$ ls /home/paolo/.rvm/gems/ruby-2.1.2@zalter/gems/
@paolodina
paolodina / .obnam.conf
Last active August 29, 2015 14:08
Obnam backup script + LVM Snapshot
# current settings
# obnam --dump-config
# Docs:http://code.liw.fi/obnam/manual/obnam-manual.en.html
# ###########################
# Use your values
[config]
repository = /media/paolo/905d8628-93c9-44d3-9619-02693334cc03/obnam-backup
exclude-caches = yes
one-file-system = yes
@paolodina
paolodina / gist:9d26b5a32b0f6bd8cdb1
Created November 29, 2014 16:46
Backup script output
(attic)paolo@tk:~/local2/venvs/attic$ sudo ./runbackup.sh
[sudo] password for paolo:
Create into sysvg a snapshot of lvroot named backup_snapshot_root
Logical volume "backup_snapshot_root" created
Mounting root snapshot to filesystem...
Create into sysvg a snapshot of lvhome named backup_snapshot_home
Logical volume "backup_snapshot_home" created
Mounting home snapshot to filesystem...
Create into sysvg a snapshot of lvvar named backup_snapshot_var
Logical volume "backup_snapshot_var" created
@paolodina
paolodina / gist:44f660a393f0be49b6dc
Created December 10, 2014 21:33
Scriptino Attic + lvm snapshot
$ sudo ./runbackup.sh
[sudo] password for paolo:
Create into sysvg a snapshot of lvroot named backup_snapshot_root
Logical volume "backup_snapshot_root" created
Mounting root snapshot to filesystem...
Create into sysvg a snapshot of lvhome named backup_snapshot_home
Logical volume "backup_snapshot_home" created
Mounting home snapshot to filesystem...
Create into sysvg a snapshot of lvvar named backup_snapshot_var
Logical volume "backup_snapshot_var" created
@paolodina
paolodina / gist:e4decf215bfb1a82a4e0
Last active August 29, 2015 14:14
dump livecd customizations
#!/bin/bash
# used to backup a live cd session without persistence possibility
# (just forgot to run the live cd in persistent mode)
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# http://askubuntu.com/a/99151/18140