Skip to content

Instantly share code, notes, and snippets.

@anthonyaxenov
anthonyaxenov / inotifywait-cp.service
Last active April 19, 2023 03:56
[SHELL] Backup files synced from Syncthing
# Daemon file
# Place or symlink it to /etc/systemd/system/inotifywait-cp.service
# Enable and start: sudo systemctl enable --now inotifywait-cp
# Check it: sudo systemctl status inotifywait-cp
[Unit]
Description=Photosync from android
[Service]
Type=simple
@anthonyaxenov
anthonyaxenov / .gitconfig
Created September 28, 2022 00:02
My favourite global .gitconfig with aliases (ru comments)
[user]
# ...
# signingkey = <key>
# git config user.signingkey ... -- установить ключ
[commit]
gpgSign = true
[tag]
gpgSign = true
[push]
default = current
@anthonyaxenov
anthonyaxenov / ytdlcue.sh
Last active October 9, 2022 05:23
[SHELL] CUE-sheet generator for youtube-dl
#!/bin/bash
# CUE-sheet generator for youtube-dl
# Usage:
# 0. Install 'jq' utility
# 1. Download any audio file with metadata from YouTube or Youtube Music, e.g.
# $ youtube-dl \
# --extract-audio \
# --audio-format flac \
# --audio-quality 0 \
@anthonyaxenov
anthonyaxenov / here.php
Last active March 24, 2023 08:38
[PHP] Get caller class, function and line number
<?php
/**
* Returns caller class/file name, function and line where current
*
* Potentially doesn't cover all cases, but is simple and pretty handy for use in frameworks.
*
* @param bool $as_array result as array or string in this format: `<file|class>:<func>():<line>`
* @return string|array
*/
@anthonyaxenov
anthonyaxenov / php
Last active March 27, 2023 03:08
[SHELL] Interpreter helper to debug dockerized cli php scripts in NetBeans
#!/bin/bash
# Welcome to amusement park!
[[ "$1" = '--help' ]] || [[ "$1" = '-h' ]] && cat <<EOF && exit
NetBeans docker wrapper for php
===============================
Anthony Axenov (c) 2023, The MIT License
https://axenov.dev
https://opensource.org/license/mit
@anthonyaxenov
anthonyaxenov / helpers.sh
Last active July 23, 2023 01:20
[SHELL] My bash helpers
#########################################################################
# #
# Bunch of helpers for bash scripting #
# #
# This file is compilation from some of my projects. #
# I'm not sure they're all in perfiect condition but I use them #
# time to time in my scripts. #
# #
#########################################################################