This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cpu-freq] | |
interval=5 | |
# standard color scale. MUST BE 4 VALUES. | |
# COLORS_FREQ='#85cc00,#b58900,#cb4b16,#dc322f' | |
# in MHz, if set Min/Max are not used. MUST BE 3 VALUES. | |
# FREQUENCIES='1500,2300,3100' | |
# Freq max/min MHz | |
# MIN_FREQ=1400 | |
# MAX_FREQ=4100 | |
# number of frequency intervals for color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Simple creation of a single-app django project, as described in: https://zindilis.com/posts/django-anatomy-for-single-app/ | |
# | |
# ./django_init foo | |
# | |
# This will result is the following flat structure: | |
# | |
# . | |
# └── foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------ | |
# Name : yt-streamer | |
# Input : youtube URL | |
# Purpose : stream url video to mpv. see: | |
# https://github.com/ytdl-org/youtube-dl/issues/2124#issuecomment-32429104 | |
#------------------------------------------------ | |
yt-streamer() { | |
# locale colors do not work in sub-functions | |
open=$'\001' | |
close=$'\002' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Show table content with rich. Quick'n'dirty: no validity checks, only the fun :-D. | |
""" | |
import sys | |
from pandas import read_csv | |
from rich import print | |
from pathlib import Path | |
import os | |
size = os.get_terminal_size() | |
for p in sys.argv[1:]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tested using https://github.com/uber/h3-py-notebooks/blob/master/notebooks/usage.ipynb | |
from h3 import h3 | |
from shapely.geometry.polygon import Polygon | |
h3_list = [ Polygon(h3.h3_to_geo_boundary(he)) for he in h3.hex_ring(h,2)] | |
n = len(h3_list) | |
print(f'Polygon.exterior.is_closed = {h3_list[0].exterior.is_closed}') | |
import geopandas as gpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# see https://unix.stackexchange.com/questions/467524/open-file-from-history-in-zathura | |
# save filepaths in history to array, reverse order | |
readarray -t Data < <(grep -o '/.*\.[[:alpha:]]\{,3\}' ~/.local/share/zathura/history | tac) | |
# loop and unset not existing files | |
for i in "${!Data[@]}" | |
do | |
if ! [ -e "${Data[$i]}" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ..='cd ..' | |
alias ...='cd ../../../' | |
################################################ | |
# [bash - aliasing cd to pushd - is it a good idea? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/4291/187865) | |
# You can then navigate around on the command-line a bit like a browser. | |
# - cd changes the directory. | |
# - back goes to the previous directory that you cded from. | |
# - flip will move between the current and previous directories without popping them from the directory stack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# weresync backup | |
# | |
# autobackup on disk connect via udev rules : | |
# - [How to Auto Backup Files to USB Media When Connected](https://www.tecmint.com/auto-backup-files-to-usb-media-in-linux/) | |
# - [udev - ArchWiki](https://wiki.archlinux.org/index.php/udev) | |
# - [[SOLVED] automatic usb-backup with udev-rules + script / Newbie Corner / Arch Linux Forums](https://bbs.archlinux.org/viewtopic.php?id=32639) | |
# udevadm info -a -n sda > disk info | |
stop_weresync(){ | |
WSPID=$(sudo pgrep weresync-daemon) |