Skip to content

Instantly share code, notes, and snippets.

View fergalmoran's full-sized avatar

Fergal Moran fergalmoran

View GitHub Profile
@fergalmoran
fergalmoran / docker-compose.yaml
Created April 16, 2024 16:48
Win11 Virtual Machine
services:
windows:
image: dockurr/windows
container_name: windows
restart: no
environment:
VERSION: "tiny11"
RAM_SIZE: "24G"
CPU_CORES: "8"
DISK_SIZE: "100G"
@fergalmoran
fergalmoran / backup_virsh.sh
Created November 8, 2023 21:19
Virsh backup
#!/usr/bin/env bash
DOMAIN=${1:-win11}
BACKUP_CONFIG=/home/fergalm/dotfiles/virsh-win11-backup.xml
BACKUP_PATH=/mnt/storage/backups/vms/libvirt/$DOMAIN
XML_BACKUP=$BACKUP_PATH/$DOMAIN.xml
BACKUP_IMAGE=$BACKUP_PATH/$DOMAIN.disk
OLD_BACKUP_IMAGE=$BACKUP_PATH/$DOMAIN.disk.$(date "+%Y.%m.%d-%H.%M.%S")
echo BACKUP_IMAGE $BACKUP_IMAGE
@fergalmoran
fergalmoran / bri_price.py
Last active July 20, 2022 15:32
Get prices from page
from selenium import webdriver
import time
from bs4 import BeautifulSoup
options = webdriver.ChromeOptions()
options.add_argument('--incognito')
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
@fergalmoran
fergalmoran / node-exporter.sh
Last active August 26, 2021 18:56
Install Node Exporter
#!/usr/bin/env
curl -SL https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-armv7.tar.gz >/tmp/node_exporter.tar.gz &&
sudo tar -xvf /tmp/node_exporter.tar.gz -C /usr/local/bin/ --strip-components=1
echo '[Unit]
Description=NodeExporter
[Service]
TimeoutStartSec=0
@fergalmoran
fergalmoran / wallpaper.sh
Last active February 27, 2020 19:50
Take a random screengrab from a movie file and set it as your background
#!/usr/bin/env bash
if [ ! -f "$1" ]; then
echo "No such file"
¦ exit 1
fi
suf="${1##*.}"
if [ "$suf" != "mp4" ] && [ "$suf" != "mkv" ] && [ "$suf" != "avi" ] && [ "$suf" != "mov" ] && [ "$suf" != "gif" ] && [ "$suf" != "flv" ]; then
echo "Input needs to be a video"
exit 1
<audio-player audio-url="media/iseeyou.mp3"
pcm-url="media/iseeyou.json"
title="I See You"
sub-title="Mr. Ed"
image-url="media/iseeyou.jpeg">
</audio-player>
@fergalmoran
fergalmoran / omnisharp.json
Created April 29, 2019 20:16
/home/fergalm/.omnisharp/omnisharp.json
{
"FormattingOptions": {
"NewLine": "\n",
"UseTabs": false,
"TabSize": 4,
"IndentationSize": 4,
"SpacingAfterMethodDeclarationName": false,
"SpaceWithinMethodDeclarationParenthesis": false,
"SpaceBetweenEmptyMethodDeclarationParentheses": false,
"SpaceAfterMethodCallName": false,
@fergalmoran
fergalmoran / home.component.ts
Last active August 21, 2018 03:52
Angular 2 Pusher Service
import * as ng from '@angular/core';
import {PusherService} from '../../services/pusher.service'
@ng.Component({
selector: 'home',
template: require('./home.html')
})
export class Home {
constructor(private pusher: PusherService) {
console.log('Home:constructor');
@fergalmoran
fergalmoran / gist:6164a3690633cf105c18c6ac2a72f872
Created November 2, 2017 17:21
Sonarr (or anything) Let's Encrypt & nginx reverse proxy
Run
./certbot-auto certonly --standalone --agree-tos --redirect --duplicate --text --email fergal.moran@gmail.com \
-d sonarr.bitchmints.com --server https://acme-v01.api.letsencrypt.org/directory
nginx config
server {
listen 443;
server_name sonarr.bitchmints.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/sonarr.bitchmints.com/fullchain.pem;
using System;
using System.Dynamic;
using Newtonsoft.Json;
using NYoutubeDL;
using static NYoutubeDL.Helpers.Enums;
namespace NetCoreYTDl {
class Program {
const string YT_URL = "https://www.youtube.com/watch?v=rzfmZC3kg3M";