Skip to content

Instantly share code, notes, and snippets.

@jindrichmynarz
jindrichmynarz / split_urls.ru
Created August 22, 2017 17:32
Split strings in pure SPARQL
# Solution from: <http://answers.semanticweb.com/questions/19162/split-and-trim-strings-in-sparql/27544>
PREFIX schema: <http://schema.org/>
DELETE {
?s schema:url ?urls .
}
INSERT {
?s schema:url ?url .
}
@benhylau
benhylau / Command.md
Created March 14, 2017 21:25 — forked from RickyCook/Command.md
Using socat to forward new ports via STDIO in a running Docker container

What?... Why?

Imagine you're messing around in a container, and you install some stuff, add some config, and now it's time to load up your client and check it out! Oh wait, you forgot to forward ports when you created the container! Fear not, all is not lost, for in the world of pipes, and streams, there is always a way to do something disgusting.

The Dockerfile

Example Dockerfile included will install Nginx, and socat in a container, and make Nginx run in foreground mode. To build, and run:

@CliffordAnderson
CliffordAnderson / docker
Last active January 16, 2019 17:23
Docker Image for Neo4j with APOC and Spatial plugins
# Adding APOC and the Spatial Library to Official Neo4j Docker Image
FROM neo4j:latest
MAINTAINER Clifford Anderson <anderson.clifford@gmail.com>
ENV APOC_URI https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.0.4.1/apoc-3.0.4.1-all.jar
ENV GIS_URI https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.19-neo4j-3.0.3/neo4j-spatial-0.19-neo4j-3.0.3-server-plugin.jar?raw=true
RUN mv plugins /plugins \
&& ln --symbolic /plugins
@PuKoren
PuKoren / recompile-and-run.sh
Last active January 17, 2024 19:01
Recompile APK + Sign with apktool
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@rmohr
rmohr / simple_pam_auth.c
Last active April 22, 2024 08:03
Absolutely minimalistic pam authentication example
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <unistd.h> /* getpass */
#include <security/pam_appl.h> /* pam_start, pam_conv, pam_end, ... */
#define TRY(x) ret = (x); printf("PAM: %s\n", pam_strerror(handle, ret)); if (ret != PAM_SUCCESS) goto finally
int test_conv(int num_msg, const struct pam_message **msg,
@viktorklang
viktorklang / in-fino-veritas.zsh-theme
Last active July 31, 2023 01:47
In Fino Veritas ZSH theme
#!/usr/bin/env zsh
# in fino veritas
# Borrowing shamelessly from these oh-my-zsh themes:
# fino-time
# pure
# https://gist.github.com/smileart/3750104
# Set required options