Skip to content

Instantly share code, notes, and snippets.

View kantorv's full-sized avatar

valentin kantorv

  • Freelancer
  • Tel Aviv
View GitHub Profile
steps:
#- name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# ....
- name: Load staticappsclient image from cache
id: staticappsclientstable
# oneliner for creating wildcard domain certificate
# create an api token with dns:edit permission (https://dash.cloudflare.com/profile/api-tokens)
# add cloudflare.ini (check https://certbot-dns-cloudflare.readthedocs.io/en/stable/index.html#credentials)
# omit `--staging` when done with tests (so you won't hit the rate limits https://letsencrypt.org/docs/rate-limits/)
docker run \
--rm \
-it \
-v $(pwd)/cloudflare.ini:/tmp/cloudflare.ini \
-v $(pwd)/certs:/etc/letsencrypt/archive \
python:3.13 bash -c "\
@kantorv
kantorv / fabricjs_obj_clone.js
Created August 16, 2019 10:16
setCoords example usage
...
obj.clone( (cloned)=> {
canvas.discardActiveObject();
cloned.set({
left: cloned.left + 10,
top: cloned.top + 10,
evented: true,
});
if (cloned.type === 'activeSelection') {
// active selection needs a reference to the canvas.
# http://www.arunviswanathan.com/node/53
xrandr | grep maximum
gtf 1440 900 59.9
xrandr --newmode "1440x900_59.90" 106.29 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
xrandr --addmode VGA 1440x900_59.90
xrandr --addmode HDMI 1440x900_59.90
@kantorv
kantorv / zm_convert.sh
Created March 8, 2017 03:55
Sample of creating avi file from zoneminder timelapse jpegs
#!/bin/bash
START=$1
END=$2
DATE="17/02/08"
CAMERA="eda-120hr"
FRAMERATE=15
OUTPUT="$CAMERA"_"$START"-"$END".avi
## save $START, just in case if we need it later ##
i=$START
@kantorv
kantorv / wait_sec.sh
Created August 15, 2015 14:06
bash function, waiting N secs, prints estimated
function wait_sec {
secs=$1
[[ -n ${secs//[0-9]/} ]] && "Please provide secs number. e.g. wait_sec 34" && return
while [ $secs -gt 0 ]; do
echo -ne "$secs\033[0K\r"
sleep 1
: $((secs--))
done
}
@kantorv
kantorv / create_role
Created April 9, 2015 08:28
bash script for creating ansible role directory structure.
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
nomainfile=(templates files)
while read dir