Skip to content

Instantly share code, notes, and snippets.

View pas-calc's full-sized avatar

Pascal pas-calc

View GitHub Profile
@pas-calc
pas-calc / import_photos.sh
Created May 3, 2021 17:24
Import Photos from external device (camera, mobile phone). Create directory structure based on year-month
#!/bin/bash
# Import von X2-02
# 17APR2015, bilder->images 22FEB2017, delete empty dirs 14APR2020
echo "Importing Photos..."
folder="/media/pascal/microSD 2GB/Images" # Bilder
echo "change to dir: \"${folder}\""
@pas-calc
pas-calc / execute_at_time.txt
Created April 28, 2021 20:26
Bash simple command to execute command at specific time
# example: Press key combination to quit Kazam screen recorder (adapt command as wanted)
while true; do echo 'Hit CTRL+C'; sleep 1; if date +%H%M | grep -q "1430"; then echo "exit" && date && xdotool key Control_L+Super_L+f && break; fi; done
@pas-calc
pas-calc / Umsaetze_graph_Volksbank.py
Created April 18, 2021 14:30
view account balance and sales (plot csv data exported from online banking)
#!/usr/bin/python
"""
Pascal / 18-APR-2021
graphische Visualisierung der Umsatzanzeige
(am Beispiel: Volksbank - Umsatzexport - CSV)
"""
import csv
import numpy as np
@pas-calc
pas-calc / date_histogramm.py
Created April 15, 2021 18:01
Plot dates in histogram from clipboard by month (Python2)
import sys
import numpy as np
# ~from io import StringIO
import matplotlib.pyplot as plt
import pyperclip
from datetime import datetime
import matplotlib.dates as mdates
from matplotlib.dates import date2num
from dateutil.relativedelta import relativedelta
@pas-calc
pas-calc / append_last-changed-date.txt
Created April 15, 2021 17:28
append last changed date to end of file without changing timestamp
f="filename.ext"; echo "file='$f'"; d=$(stat -c %y "$f" | cut -c-19); echo "modified=$d"; echo -en "\n$d" >> "$f"; touch -d "$d" "$f"; ls -al "$f"
Do 15 Apr 2021 19:26:30 CEST
@pas-calc
pas-calc / RUB-RZ-Login.desktop
Created April 15, 2021 15:38
Enable network and start internet connection (login.rub.de)
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon=/usr/share/icons/Mint-X/apps/48/cs-login.png
Exec=bash -i -c 'echo "Connecting..." && sleep 1 && echo "Set Networking ON..." && nmcli networking on && sleep 5 && echo "Login RUB" && ( sensible-browser http://login.rub.de & ) && echo "done." && sleep 3 && read -t1 -n 1 -s -r -p "Press any key to continue"'
Name=connect
Name[de_DE]=RUB-RZ-Login
@pas-calc
pas-calc / Hotspot.desktop
Created April 15, 2021 15:36
activate WiFi hotspot at computer (internet connected via cable, and has additional WLAN network card)
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon=/usr/share/icons/Adwaita/scalable/status/network-wireless-hotspot-symbolic.svg
Exec=bash -c 'echo "Connecting..." && sleep 3 && echo "Set Networking ON..." && nmcli networking on && sleep 3 && echo "Set WIFI on..." && nmcli radio wifi on && sleep 3 && echo "Set Hotspot UP..." && nmcli connection up "Hotspot" && echo "done." && sleep 3 && read -t1 -n 1 -s -r -p "Press any key to continue"'
Name=Hotspot
@pas-calc
pas-calc / LaTeX_compile-with-biber-bibliography_runit.sh
Last active April 15, 2021 15:36
script to compile LaTeX with biber bibliography
#!/bin/bash
echo "Started"
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
echo "SCRIPTPATH = ${SCRIPTPATH}"
#~mate-terminal -e "pdflatex Thesis && biber Thesis && pdflatex Thesis"
#~gnome-terminal -e 'bash -c "gedit; echo Monkey; read line"'
@pas-calc
pas-calc / redshift-hook_brightness.sh
Created April 15, 2021 15:23
Change brightness of internal Laptop display and external HDMI/VGA monitor
#!/bin/bash
# or use sh instead of bash?
# set to executable flag, chmod +x !
set -eu
# on error : do not resume, but cancel , see https://stackoverflow.com/questions/13468481/when-to-use-set-e/13478622
@pas-calc
pas-calc / geo-exif.sh
Last active December 18, 2023 10:34
GEO Exif Coordinate viewer
#!/bin/bash
# Pascal K.
# Mi 25 Nov 2020 23:36:54 CET
# Do 26 Nov 2020 13:43:43 CET
# Mo 18 Dez 2023 11:32:34 CET - use "xdg-open" to open link in browser
echo "GEO Exif Coordinate viewer"
echo "--------------------------"