Skip to content

Instantly share code, notes, and snippets.

Avatar

Grzegorz Wierzowiecki gwpl

  • Europe - usually: Zürich, Warsaw or Berlin
View GitHub Profile
@gwpl
gwpl / .git_hooks_post-commit
Created April 27, 2023 18:51
Automatically pushing main branch to multiple repositories after each commit
View .git_hooks_post-commit
# cat .git/hooks/post-commit # <= change this file in your repo to automatiicaly execute after each commit
#!/bin/bash
cd /path/to/your/repo
git push gitlab master && git push github master && git push anotherserver master
# You may want to add your different remotes using:
# git remote add REMOTENAME git@server.domain:group/project.git #this is ssh example
# (and REMOTENAME above was gitlab, github, anotherserver...)
@gwpl
gwpl / clean_Ink_printer_CMYK_heads.tex
Created April 21, 2023 09:49
Clean Ink CMYK printer heads with color pages.
View clean_Ink_printer_CMYK_heads.tex
\documentclass{article}
\usepackage{xcolor}
\usepackage{geometry}
\geometry{paperwidth=21cm,paperheight=29.7cm,margin=0cm}
\definecolor{cyan}{RGB}{0,255,255}
\definecolor{magenta}{RGB}{255,0,255}
\definecolor{yellow}{RGB}{255,255,0}
\begin{document}
@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
View rust_session_illustrate_value_change_in_vector.bash_terminal
#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
View logseq-enhanced-theme.css
.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
View 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
View run_rustscript_uder_gdb.sh
# 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]
View README.md

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
View by_G_foaf_example.ttl
@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 )
View read_clipboard_espeak.sh
#!/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
View docker-prune-a-to-remove-unused-and-dangling-images.sh
#!/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
#