Skip to content

Instantly share code, notes, and snippets.

View andras-tim's full-sized avatar
💭
I may be slow to respond.

Andras Tim andras-tim

💭
I may be slow to respond.
View GitHub Profile
@andras-tim
andras-tim / .dockerignore
Last active March 1, 2023 03:38
Sanoid .deb builder
*.deb
@andras-tim
andras-tim / user-data-gpt-bios-btrfs.yaml
Last active August 28, 2020 03:35 — forked from wpbrown/user-data.yaml
ubuntu autoinstall with btrfs subvolumes
#cloud-config
# based on
# * https://ubuntu.com/server/docs/install/autoinstall-quickstart
# * https://curtin.readthedocs.io/en/latest/topics/storage.html
# * https://gist.github.com/wpbrown/b688a934339cb4228c3faf5b527fbe5b
autoinstall:
version: 1
{
"title": "JSON Schema for autoinstall config",
"$schema": "https://ubuntu.com/server/docs/install/autoinstall-schema",
"type": "object",
"properties": {
"autoinstall": {
"type": "object",
"properties": {
"version": {
"type": "integer",
@andras-tim
andras-tim / doci
Last active June 4, 2020 08:24 — forked from szz/doci
get the prefered interactive shell in a given docker conatiner
#!/bin/bash
set -eufo pipefail
SHELL_PREFERENCE=(
'bash'
'zsh'
'sh'
)
@andras-tim
andras-tim / README.md
Last active July 8, 2020 01:37
Phoscon sensor rename utility

Phoscon device rename utility

This is a mass device rename utility for Phoscon. You can set unique names for all sensors and lights not only per devices.

Usage

python3 rename_sensors.py 'http://phoston_app_url:2080' 'API_KEY'
  1. The first run will dump the current config from the Phoscon to devices.json
  2. Edit the names in the devices.json w/ your favorite editor
@andras-tim
andras-tim / README.md
Last active May 10, 2019 14:26
Call user32.ShowWindow on (Internet) Explorer windows by path

show_window.py

Call ShowWindow() of shell32.dll for manage size of (Internet) Explorer windows by path.

Install

pip install --user pywin32
@andras-tim
andras-tim / fun.zsh
Last active September 21, 2021 11:53
I love pipes, redirects and named fds... in ZSH!
#!/usr/bin/zsh
set -e
# TAB indented file!
### PREPARATION ###
# mkdir test
# cd test
# wget -q https://gist.github.com/andras-tim/f8aebf9243cecf3719d27d020a718ef8/raw/fun.zsh -O - | zsh
#!/bin/bash
set -eufo pipefail
shopt -s extglob
patterns=''
for pattern in "$@"; do
patterns+="${pattern}|"
done
while read -r i; do
@andras-tim
andras-tim / README.md
Last active April 11, 2017 12:29
How can I filter STDIN by globbing in bash?

http://stackoverflow.com/q/43344791/1108919

Problem

I want to rewrite filter_script.sh to accepts globbing patter only instead of regexp (current working)

Expected

Test

echo -e 'apple tree\nbanana tree\norange tree' | ./filter_script.sh '*ban' '*ge*'
@andras-tim
andras-tim / install_ffmpeg_ubuntu.sh
Created August 9, 2016 14:14 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
set -e
BASEDIR="$(mktemp -d '/tmp/ffmpeg_XXXXXX')"
echo "### TEMP DIR: ${BASEDIR} ###"