Skip to content

Instantly share code, notes, and snippets.

View drola's full-sized avatar

Matjaž Drolc drola

View GitHub Profile
@drola
drola / transcode_for_twitter.sh
Created August 4, 2021 11:48
transcode_for_twitter
ffmpeg -i timelapse1.mov -c:v libx264 -preset slow -crf 18 -vf "scale=1280:-1,format=yuv420p" /home/drola/Videos/timelapse1_720.mp4
@drola
drola / backup_photos.sh
Created July 29, 2021 08:42
backup_photos.sh
#!/bin/bash
# See https://rclone.org/filtering/
FILTER_LIST="
# Exclude timelapse temporary files
- /LRTimelapse/**
- /LRTimelapse_frames/**
# Include everything else
/**
* Create a new array without the n-th element from the original array
*
* @param arr
* @param n
* @returns New array without the n-th element from the original array
*/
export function arrayWithoutNth(arr: Array<any>, n: number) {
return arr.filter((_, i) => i !== n);
}
@drola
drola / generate_password.py
Last active June 18, 2021 07:06
generate_password.py
#!/usr/bin/env python3
import random
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%&amp;*1234567890"
print(''.join([random.choice(characters) for i in range(0, 32)]))
@drola
drola / .tmux.conf
Created April 5, 2021 08:18
.tmux.conf
unbind C-b
set -g prefix C-a
set -g mouse on
set -g status-keys vi
set-window-option -g mode-keys vi
set -g history-limit 100000
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# set -g set-clipboard on
@drola
drola / awesome_climate.md
Created January 17, 2021 20:05
Awesome Climate: links collected from Sledilnik community on #climate-change

Awesome Climate

Links collected from Sledilnik community on #climate-change

Personal and household decisions

>Calculator: Ogljične emisije električnega osebnega avtomobila

@drola
drola / Matrix libs benchmark.md
Created June 11, 2020 07:05
Matrix libs benchmark

Params:

  • library
  • how matrix is created
  • matrix size
  • JS engine
  • hardware

Pipeline:

  • set params
@drola
drola / i3 printer.md
Last active August 7, 2019 15:09
i3 printer.md

#Gcodes for my i3 style printer

#Homing, step 1 M852 S-0.0118108; G28; G0 Z8; G0 X110 Y110

#Homing, after manual touch of the bed G92 Z0; G0 Z5; G0 X0

LED modes on G203 mouse:

Color Cycle

ReportID|Device Index|Sub ID|Address|String                                                    |
      11|          ff|    0e|     3e|       0002|0000000000|       03e8|        64|000000000000|
        |            |      |       |Effect Type|     Zeros|Rate(speed)|Brightness|Zeros       |
@drola
drola / set_nemo_filemanager.sh
Created December 9, 2017 06:14
Set Nemo as the default file manager in Ubuntu 17.10
#!/bin/bash
sudo apt-get install --yes nemo
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.nemo.desktop show-desktop-icons true