Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / config
Created August 14, 2014 05:49
~/.ssh/config example with selected identity file for a certain server
Host example.org
IdentityFile ~/.ssh/id_rsa
Host *
ForwardAgent no
IdentitiesOnly yes
[Unit]
Description=deletes all but the last 1000 lines of syslog due to possible logging spam by VLC
[Service]
Type=oneshot
ExecStart=-/usr/local/sbin/truncate_syslog.sh
TimeoutSec=0
StandardOutput=syslog
After=suspend.target
@rubo77
rubo77 / 00_local_excludes
Last active July 7, 2022 16:47
/etc/aide/aide.conf.d/00_local_excludes exclude file with all folders, that frequently change
!/backup*
!/dev/disk/
!/etc/.etckeeper
!/etc/.git/
!/etc/aide/.aide.conf.swp
!/etc/aide/.aide.conf.swp
!/etc/aide/aide.conf.d/00_local_excludes
!/etc/ld.so.cache
!/etc/lvm/archive
!/etc/lvm/backup
#!/bin/bash
# siehe https://wiki.freifunk.net/ECDSA_Util
# dies gilt nur für Kiel
# falls du noch keinen key hast:
# ecdsakeygen -s > ecdsautil_key.secret
# cat ecdsautil_key.secret|ecdsakeygen -p > ecdsautil_key.public
branch=stable
@rubo77
rubo77 / matrix-synapse-commands-in-riot.md
Last active April 26, 2022 06:48
matrix synapse commands in riot

/shrug

args:

<message>

description:

Prepends ¯\(ツ)/¯ to a plain-text message

/plain

args:

``

@rubo77
rubo77 / my_parse_str.php
Last active May 7, 2021 11:14 — forked from Shagshag/gist:5849065
This is a replacement for the original idea how to cirumvent the max_input_vars limitation, that uses the original parse_str() on each element of the query to parse
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
* @param $string array string to parse (not altered like in the original parse_str(), use the second parameter!)
* @param $result array If the second parameter is present, variables are stored in this variable as array elements
* @return bool true or false if $string is an empty string
*
@rubo77
rubo77 / ignorelist
Last active February 22, 2021 14:39
This ignorelist can be used to backup your home folder without useless folders and files, see http://askubuntu.com/a/545676/34298
# rsync-homedir-excludes
#
# A list of files to exclude when backing up *nix home directories using rsync.
#
# Author: Ruben Barkow <https://gist.github.com/rubo77> (original)
# Version: 2015-08-30
# Website: https://gist.github.com/rubo77/8ffaadbc58ab099d2bc3
# the repository has moved to github
@rubo77
rubo77 / ln-conv-hl
Last active December 15, 2020 10:54
convert hard-links to symbolic links
#!/bin/bash
#
# converts hard-links to symbolic links
#
#-------------- Author: -------------#
# by Ruben Barkow
# git: https://gist.github.com/7a9a83695a28412abbcd.git
#--- Copyright and license -----------#
#This code is covered by the GNU General Public License 3.
@rubo77
rubo77 / planet2png.py
Last active November 28, 2020 23:43
converts a jpeg file with a planet on black background to a transparent png
#!/usr/bin/python3
# converts a jpeg file with a planet on black background to a transparent png
# like this imagemagick function does:
# for i in planet_*.jpg; do nr=$(echo ${i/planet_/}|sed s/.jpg//g|xargs); convert $i -fuzz 1% -transparent black trans/planet_${nr}.png; done
# but the python script will create them without arkifacts
# needs
# sudo apt install python3-opencv python3-sklearn python3-skimage