Skip to content

Instantly share code, notes, and snippets.

View blokhin's full-sized avatar

Evgeny Blokhin blokhin

View GitHub Profile
@blokhin
blokhin / DOCKERs
Last active January 6, 2025 22:01
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
docker start `docker ps -q -l`
docker attach `docker ps -q -l`
docker run -ti -v //c/Users/Evgeny/office:/data kaixhin/theano
docker run -ti -v //c/Users/Evgeny/office:/data b.gcr.io/tensorflow/tensorflow bash
docker run -ti -v //c/Users/Evgeny/office:/data ubuntu:12.04
@blokhin
blokhin / CASSIEs
Last active January 6, 2025 22:01
CONSISTENCY ONE;
CREATE KEYSPACE james WITH replication = {'class':'SimpleStrategy', 'replication_factor': 1};
describe keyspaces;
describe tables;
use james;
CREATE TABLE james (column1 int PRIMARY KEY, column2 text);
INSERT INTO james (column1, column2) VALUES(42, 'just a test');
SELECT * FROM system_schema.keyspaces;
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;
# Amazon:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080
iptables -t nat -A DOCKER -p tcp --dport 8001 -j DNAT --to-destination 172.17.0.19:8000
# Drop existing:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
@blokhin
blokhin / NODEJS
Last active April 16, 2020 13:23
node --optimize_for_size --max_old_space_size=920 --gc_interval=100 server.js // 1500 Mb RAM
node --optimize_for_size --max_old_space_size=460 --gc_interval=100 server.js // 512 Mb RAM
// downgrade npm
npm install -g npm@VERSION
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label
WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label }
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dbres: <http://dbpedia.org/resource/>
DESCRIBE dbres:Curie-Weiss_law
SELECT ?dbr WHERE { ?dbr foaf:isPrimaryTopicOf <http://en.wikipedia.org/wiki/Curie–Weiss_law> }
@blokhin
blokhin / MPDS_UO_bondlengths.ipynb
Last active September 28, 2022 23:12
An example of using MPDS with Matminer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env node
var https = require('https');
var qs = require('querystring');
var api_key = ""; // your key
var host = "api.mpds.io", port = 443, path = "/v0/download/facet";
var search = {
"elements": "Mn",
"classes": "binary, oxide",
#!/usr/bin/env python
from urllib import urlencode
import httplib2
import json
api_key = "" # your key
endpoint = "https://api.mpds.io/v0/download/facet"
search = {