Skip to content

Instantly share code, notes, and snippets.

View zoispag's full-sized avatar
⚠️
cannot read property 'status' of undefined

Zois Pagoulatos zoispag

⚠️
cannot read property 'status' of undefined
View GitHub Profile
@zoispag
zoispag / 010--readme.md
Last active May 27, 2019 17:39
iTerm2 Multiple sessions script

Multiple sessions with iTerm2

Save the file as ~/Library/Application Support/iTerm2/Scripts/ssh_multiple.scpt

Restart iTerm and go to scripts menu and select the script.

image

Once opoened, a prompt to select a txt file will open. Select a new-line separated .txt file, containing the hostnames of the servers you want to connect simultaneously.

@zoispag
zoispag / bim
Last active March 11, 2020 19:36
Batch image rename (.jpg) with PHP
#!/usr/bin/env php
<?php
/**
* Finds and renames .jpg files in current directory with unique filenames (uuid)
* Usage: ./bim
*/
foreach (glob('*.jpg') as $file) {
@zoispag
zoispag / README.md
Last active August 16, 2021 09:57
Collect restic metrics when using resticker

Collect restic metrics when using resticker

Restic is a backup software, written in Go, that stands out for the method of backup that is using, called Content Defined Chunking de-duplication. It supports multiple backends and is really easy to use.

I am using resticker, a straight-forward docker container, to run restic in Production.

It allows to schedule the backups with its built-in cron support, and allows me to send notifications for successful/failed backups.

Resticker currently does not support Prometheus metrics, in order to monitor the status of the backups.

@zoispag
zoispag / backup_metrics.sh
Last active May 25, 2021 18:05
Resticker metrics (Medium Gist 1)
#!/bin/bash
#################################################################################
# MIT License
#
# Copyright (c) 2020 Zois Pagoulatos
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@zoispag
zoispag / docker-compose.override.yml
Created May 30, 2020 17:42
Resticker metrics (Medium Gist 2)
version: '3.5'
services:
nodeexporter:
volumes:
- /metrics:/metrics:ro
command:
- '--collector.textfile.directory=/metrics'
@zoispag
zoispag / ide.json
Created April 1, 2022 08:38
@unlessroute automcompletion
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"blade": {
"directives": [
{
"name": "unlessroute",
"prefix": "<?php if(Route::currentRouteName() !== ",
"suffix": "); ?>"
},
{