h - Move left
j - Move down
k - Move up
l - Move right
$ - Move to end of line
0 - Move to beginning of line (including whitespace)
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 https://sigterm.sh/2010/07/09/generating-a-dependency-graph-for-a-postgresql-database/ | |
# Converted to Python3 | |
# Add config fort dbport | |
# Increase PNG Size | |
# pylinting | |
from optparse import OptionParser, OptionGroup | |
import sys | |
import psycopg2 |
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
object ParallelProcessing { | |
val queries: List[(String, String)] = List( | |
("SELECT * FROM ABC", "output1"), | |
("SELECT * FROM XYZ", "output2") | |
) | |
// Just use parallel collection instead of futures, that's it | |
queries.par foreach { | |
case (query, path) => |
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 SPARQLWrapper import SPARQLWrapper, POST, BASIC, DIGEST, TURTLE, N3, XML, RDFXML | |
from rdflib import Graph | |
sparql = SPARQLWrapper("http://localhost:7200/repositories/myrepo") | |
sparql.setHTTPAuth(BASIC) | |
sparql.setCredentials("admin", "admin") | |
sparql.setMethod(POST) | |
sparql.setQuery(""" | |
construct {?s ?p ?o} | |
where { |
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
SELECT * FROM sys_rdf_schema; | |
ld_dir('/data', '*.ttl', 'http://www.example.com/genealogy.owl#'); | |
delete from DB.DBA.load_list where ll_file='/data//einstein.ttl'; | |
SPARQL SELECT (COUNT(DISTINCT ?x) AS ?count) WHERE { ?x ?y ?z }; | |
sparql clear graph <http://www.example.com/genealogy.owl#>; | |
sparql load <https://github.com/blokhin/genealogical-trees/raw/master/data/header.ttl> into <http://www.example.com/genealogy.owl#>; | |
rdfs_rule_set('fhkb', 'http://www.example.com/genealogy.owl#'); | |
SPARQL SELECT ?g count(*) as ?count WHERE { GRAPH ?g {?s ?p ?o } } GROUP BY ?g ORDER BY DESC 2; |
Lsyncd is a tool used to keep a source directory in sync with other local or remote directories. It is a solution suited keeping directories in sync by batch processing changes over to the synced directories.
So the generic use case is to keep a source directory in sync with one or more local and remote directories.
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
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s } | |
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s } | |
function trim(s) { return rtrim(ltrim(s)); } | |
BEGIN { | |
# whatever | |
} | |
{ | |
# whatever | |
} | |
END { |
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
# /etc/nginx/sites-enabled/some.domain | |
# Change the server name {some.domain} | |
# Change the {host.of.notebook} and {port} in the following locations | |
server { | |
listen 80; | |
# Change the server name {some.domain} | |
server_name some.domain; | |
location / { | |
# Change the {host.of.notebook} and {port} | |
proxy_pass http://host.of.notebook:port; |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise32" |