Skip to content

Instantly share code, notes, and snippets.

View gwpl's full-sized avatar

Grzegorz Wierzowiecki gwpl

  • Europe - usually: Zürich, Warsaw or Berlin
View GitHub Profile
@gwpl
gwpl / rust_session_illustrate_value_change_in_vector.bash_terminal
Last active March 6, 2023 21:20
Rust session Illustrate Value change in vector
#If you run in terminal multiplexxer...
# (or code editor and terminal to see complile+run output)
# like screen or tmux,
# you may want in one to have
$ $EDITOR l1.rs
# and in another:
echo l1.rs | entr -cs 'rustc l1.rs && ./l1'
@gwpl
gwpl / logseq-enhanced-theme.css
Created January 2, 2023 18:48 — forked from eteplus/logseq-enhanced-theme.css
logseq enhanced theme
.block-children {
border-left-width: var(--ls-block-bullet-threading-width);
}
.block-content-wrapper {
position: relative;
}
.bullet-container {
height: 14px !important;
@gwpl
gwpl / custom.css
Created January 2, 2023 17:53 — forked from madawei2699/custom.css
logseq/custom.css
/*
/* Theme custom css start
/* https://raw.githack.com/dracula/logseq/master/custom.css
*/
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");
:root {
--background: #282a36;
--light-background: #343746;
@gwpl
gwpl / run_rustscript_uder_gdb.sh
Last active December 8, 2022 23:25
rust-gdb - easy way to run rust-scripts with gdb
# https://github.com/fornwall/rust-script/issues/54
# regarding rust-script : https://rust-script.org/ => https://github.com/fornwall/rust-script
rust-gdb $(rust-script --debug -o ./my_rust_script.rs --version 2>&1 | rg -w '.+Running `(.+) --version`' -r '$1')
@gwpl
gwpl / README.md
Last active November 21, 2022 13:27
Isolating applications on desktop - Docker, Vagrant as a Desktop (or QubesOS and other options) for for better desktop security [Notes/Draft]

The goal of these notes is to plant idea that there are few alternatives to "just running apps directly on your computer".

If you don't pick any of mentioned options, please consider as bare minimum, making separate user for some apps, or some contexts (e.g. "me-work-emails", "me-work-coding", "me-work-graphics-design", "me-work-instant-messanger",...). However above solutions one may find more seamless.

@gwpl
gwpl / by_G_foaf_example.ttl
Created October 30, 2022 15:51
by G foaf example, showing simple queries progressing step by step with outputs; run using Apache Jena ; based on https://jena.apache.org/tutorials/sparql.html and https://gitlab.com/gwpl/rdf_20q4
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix ex: <http://example.org/stuff/1.0/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#>.
@prefix wot: <http://xmlns.com/wot/0.1/>.
@prefix xml: <http://www.w3.org/XML/1998/namespace>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@gwpl
gwpl / read_clipboard_espeak.sh
Last active September 15, 2022 18:56
Reading aloud content of clipboard. espeak fro clipboard under Linux / X (should work under other unixes , if required change `xclip` to something else )
#!/bin/bash
# e.g. -s 300 to read faster :
# read_clipboard_espeak.sh -s 300
# espeak has other parameters too, check man espeak-ng
#TTSCMD=espeak
TTSCMD=espeak-ng
if [ -z "$1" ]; then
@gwpl
gwpl / docker-prune-a-to-remove-unused-and-dangling-images.sh
Created July 29, 2022 13:50
docker cleanup - freeing disk space or building fresh regardless of cache
#!/bin/bash
set -x
docker image prune -a
docker system prune -a # from https://www.freecodecamp.org/news/where-are-docker-images-stored-docker-container-paths-explained/
#docker volumes prune # from https://www.freecodecamp.org/news/where-are-docker-images-stored-docker-container-paths-explained/
# altnernatively:
# How to force Docker for a clean build of an image without deleting cache
# and btw https://stackoverflow.com/a/60140109/544721 -> docker builder prune -af
#
@gwpl
gwpl / Dockerfile
Created April 22, 2022 10:56
Archlinux RDF SPARQL Jena Fuseki ( fast start http://linkeddatatools.com/semantic-web-basics )
FROM archlinux:latest
RUN echo 2022-02-02 # update this line to enforce refresh instead of --no-cache
RUN pacman -Syyu --noconfirm && \
pacman -S --noconfirm \
git base-devel \
vim screen tmux \
wget aria2 mc htop vim \
mc cmatrix htop vim \
git base-devel shellcheck
# bubblewrap-suid xz \
@gwpl
gwpl / code2pdf_with_vim.sh
Created December 6, 2021 16:33
print code with syntax highlighting using Vim's hardcopy
#!/bin/bash
tmpd="$(mktemp -d)"
mergedpdf=merged_source_files.pdf
if [ "$1" == "-o" ]; then
mergedpdf="$2"
shift 2
fi