Skip to content

Instantly share code, notes, and snippets.

@debuglevel
debuglevel / rsync options.txt
Last active January 27, 2017 11:13
rsync options
sinnvolle Argumente für interaktiven Aufruf:
nice -n 19 ionice -c 3 rsync -a -x -AHX -S --numeric-ids --del_ete(-after) -v -P --stats -h -y
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
[
-r, --recursive recurse into directories
-l, --links copy symlinks as symlinks
-p, --perms preserve permissions
-t, --times preserve modification times
-g, --group preserve group
@debuglevel
debuglevel / essential linux command line tools.txt
Last active September 9, 2020 09:05
essential linux command line tools
# pure tools
sudo apt-get install \
sudo \
net-tools \
screen \
tmux \
mc \
nano \
ncdu \
@debuglevel
debuglevel / prefix-files-with-modification-datetime.sh1
Last active December 25, 2022 18:34
PowerShell: rename all files of a type to prefix their modification datetime
Get-ChildItem *.pdf | Rename-Item -newname {$_.LastWriteTime.toString("yyyy-MM-dd-HH-mm") + $_.Name }
@debuglevel
debuglevel / gist:a292f494b4b5599b549a657ea417ab9f
Created August 10, 2016 18:33
grant sudo user rights to use current DISPLAY in SSH X11 forwarding
# run as non-privileged user
xauth extract - $DISPLAY | sudo xauth merge -
@debuglevel
debuglevel / sort-and-unrestrict-and-merge-pdfs.sh
Created August 22, 2017 18:23
Bash script to merge multiple (possibly protected) PDFs
#!/bin/bash
# execute in a directory with the respective PDF files only
echo "Execute this script only if"
echo " 1. this directory contains only the PDF files you want to merge"
echo " 2. you have no problem that this script will rename them"
echo " 3. you downloaded them in their linear order (first chapter first; this tool is based on the creation date)"
read -rsp $'Press enter to continue or CRTL-C to abort...\n'
@debuglevel
debuglevel / docker-remove-everything
Created September 14, 2017 20:07
Stop and remove all containers and images from a Docker host
docker stop $(docker ps -a -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -a -q)
@debuglevel
debuglevel / selfsigned-certificates_gitlab-ci.yml
Created July 20, 2018 10:20
Using a self signed certificate for docker repository in GitLab
image: docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# from https://gitlab.com/gitlab-org/gitlab-runner/issues/1350
services:
- name: docker:dind
command:
@debuglevel
debuglevel / git-check-origin-remote-exists.sh
Created February 20, 2019 12:54
bash script which checks if all subdirectories are git repositories with a origin remote set
#!/bin/bash
for dir in */ ; do
echo -ne "$dir \t "
git -C "$dir" rev-parse &> /dev/null
CODE=$?
if [[ "$CODE" -eq "0" ]]; then
echo -ne "is a git repository "
git -C "$dir" remote get-url origin &> /dev/null
CODE=$?
if [[ "$CODE" -eq "0" ]]; then

incomplete and barely proven comparison of file transfer methods with REST

JSON with base64

$ curl -X POST -d @content.json -H "Content-Type: application/json" -H "Accept: application/json" http://localhost/
$ cat content.json
{  
   "files":{  
      "main.tex":"XGRvY3VtZW50Y2xhc3N7YXJ0aWNsZX0KXGJlZ2lue2RvY3VtZW50fQpcaW5jbHVkZXt0ZXN0L3Rlc3R9ClxlbmR7ZG9jdW1lbnR9",
      "test/test.tex":"aGFsbG8gd2VsdA=="
   }
@debuglevel
debuglevel / regexp tools.txt
Last active December 25, 2022 18:32
regexp tools
https://regex101.com/r/jcpyd3/1 ❤️ #create #test #dispaygroups
https://www.nodexr.net/ ❤️ #create #debug #visualize
https://regexr.com/ # create
https://regex-generator.olafneumann.org/ #wizard
https://extendsclass.com/regex-tester.html #create #debug #visualize
http://www.txt2re.com/ #wizard #broken