Skip to content

Instantly share code, notes, and snippets.

@asanchez75
asanchez75 / gist:2ce9a19687053213a2b395c946ec91fd
Created April 3, 2022 16:18 — forked from taniwallach/gist:f1f6c81ce19b7d68f74d4b71d1db57a2
Installing HP-107w on Linux (using HP's unified linux driver ULDLINUX_V1.00.39_00.12.zip)
HP provides a downloadable "driver" for Linux for the HP 107w printer but there are NO reasonable install instructions provided, and following the "obvious" install process did not get the printer working.
The closest I found to HP install instuctions once I knew more is https://support.hp.com/in-en/document/c05588857
Since I found this annoying and wasted more time on getting this printer working under Linux, I'm sharing a summary of what did work (on Debian 10).
1. Download the driver file from https://support.hp.com/us-en/drivers/selfservice/hp-laser-100-printer-series/24494339/model/24494342 from under the "Basic Drivers" menu for when the OS is set to Linux.
The current version now is: "HP Laser 100 and HP Color Laser 150 Printer series Print Driver V1.00.39:00.12 5.9 MB Mar 20, 2019"
root@vmi465483:~# cat /etc/nginx/sites-enabled/dspace.conf
server {
server_name repositorio.unijuanpablo.edu.pe;
root /var/www/html/;
client_max_body_size 2000m;
location / {
return 301 http://repositorio.unijuanpablo.edu.pe/xmlui/;
}
@asanchez75
asanchez75 / postgres-deps.py
Created November 28, 2021 19:15 — forked from cpatry-poly/postgres-deps.py
Generating a dependency graph for Postgres DB
# 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
@asanchez75
asanchez75 / ParallelProcessing.scala
Created October 1, 2021 11:07 — forked from pavel-filatov/ParallelProcessing.scala
Parallel processing with Scala-Spark
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) =>
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 {
@asanchez75
asanchez75 / vim-shortcuts.md
Created October 29, 2020 16:39 — forked from tuxfight3r/vim-shortcuts.md
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

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)
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 Technical Session

So what is lsyncd?

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.

When would we use lsyncd?

So the generic use case is to keep a source directory in sync with one or more local and remote directories.

@asanchez75
asanchez75 / trim.awk
Created March 21, 2020 07:01 — forked from andrewrcollins/trim.awk
ltrim(), rtrim(), and trim() in awk
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 {
@asanchez75
asanchez75 / tmux.md
Created February 26, 2020 12:40 — forked from Bekbolatov/tmux.md
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session