Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

kill all existing sessions

tmux kill-server

As configured in my dotfiles.

start new:

@asanchez75
asanchez75 / docker-cleanup-resources.md
Created March 6, 2018 08:16 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@asanchez75
asanchez75 / heredoc-dockerfile.snip
Created February 21, 2018 17:05 — forked from abn/heredoc-dockerfile.snip
Dockerfile alternatives for heredoc
#printf
RUN printf '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
>> /tmp/hello
#echo
RUN echo -e '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
@asanchez75
asanchez75 / export_vivo.py
Created February 7, 2018 09:30 — forked from lawlesst/export_vivo.py
Jython script to connect to VIVO via SDB and export a model.
"""
Jython script to connect to VIVO via SDB and export a model.
Requires Jython 2.5 or later. Download from: http://www.jython.org/downloads.html
Assumes the VIVO harvester is on your path.
- change the database connection information to point to your VIVO database.
- change the model name to specify the VIVO model you would like to export.
- change the output_file name to the location where you want to save the RDF.
- for larger models you will want to increase the memory available to Java.
@asanchez75
asanchez75 / SPARQLWrapper-HTTP-Digest-Auth-example.py
Last active January 29, 2018 10:08 — forked from wikier/SPARQLWrapper-HTTP-Digest-Auth-example.py
SPARQLWrapper HTTP Digest Auth example
from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST
sparql = SPARQLWrapper("http://example.org/sparql")
# For Virtuoso, use BASIC, not DIGEST
sparql.setHTTPAuth('BASIC')
sparql.setCredentials('login', 'password')
sparql.setQuery("...")
sparql.setReturnFormat(JSON)
@asanchez75
asanchez75 / demo1.results
Last active January 12, 2018 09:33 — forked from mepcotterell/demo1.results
Example SPARQL Queries
yago:Albert_Einstein yago:hasAcademicAdvisor yago:Alfred_Kleiner .
@asanchez75
asanchez75 / curl.md
Created December 9, 2017 11:59 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@asanchez75
asanchez75 / QueryDOM.php
Created November 28, 2017 08:42 — forked from hubgit/QueryDOM.php
Add XPath methods to DOMDocument
<?php
class QueryDOMDocument extends \DOMDocument
{
/** @var \DOMXPath */
protected $xpath;
public function __construct()
{
parent::__construct();
@asanchez75
asanchez75 / mbe_book_paragraph.csv
Created November 5, 2017 19:52 — forked from dinarcon/mbe_book_paragraph.csv
Drupal 8 migrations by example
Professor ID Title Author
P01 The pushcart war Jean Merrill
P02 The definite guide to Drupal 7 Benjamin Melançon et al.
P03 The five love languages Gary Chapman
@asanchez75
asanchez75 / docker-compose.yml
Created October 17, 2017 04:11 — forked from mystygage/docker-compose.yml
Microsoft SQL Server in Docker with data volume
version: '3'
services:
mssql-server-linux:
image: microsoft/mssql-server-linux:latest
volumes:
- mssql-server-linux-data:/var/opt/mssql/data
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=${SQLSERVER_SA_PASSWORD:-yourStrong(!)Password}