Skip to content

Instantly share code, notes, and snippets.

View Torstein-Eide's full-sized avatar

Torstein Eide Torstein-Eide

View GitHub Profile
@Torstein-Eide
Torstein-Eide / db_backup_hourly.sh
Last active September 29, 2018 12:48 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@Torstein-Eide
Torstein-Eide / btrfs-scrub-volum1
Created October 20, 2019 21:08 — forked from ricco386/btrfs-scrub-pictures
Systemd timer for BTRFS Scrub. Usage: systemctl enable btrfs-scrub@pictures.timer
# /etc/btrfs.d/btrfs-scrub-volum1
mountpoint=/volum1
#!/usr/bin/env python3
#
# Dumb script to dump (some) of bcache status
# Copyright 2013 Darrick J. Wong. All rights reserved.
#
# This file is part of Bcache. Bcache is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@Torstein-Eide
Torstein-Eide / backup
Created May 12, 2020 15:17
Incremental backup to external drive using snapper and btrfs send/receive
#!/bin/bash
# James W. Barnett
# Takes snapshots of each snapper configuration. It then sends the snapshot to
# a location on an external drive. After the initial transfer, it does
# incremental snapshots on later calls. It's important not to delete the
# snapshot created on your system since that will be used to determine the
# difference for the next incremental snapshot.
# Can set the backup directory here, or in the snapper configuration file with
@Torstein-Eide
Torstein-Eide / PVE-HP-ssacli-smart-storage-admin.md
Created October 5, 2020 13:53 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@Torstein-Eide
Torstein-Eide / PVE-HP-ssacli-smart-storage-admin.md
Created October 5, 2020 13:53 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@Torstein-Eide
Torstein-Eide / gist:be8bfccca96f6d3c30d0b621f28d2ee7
Created February 13, 2021 22:11 — forked from jfeilbach/gist:18b08ea0ed9eaf844d643ab092905973
tvOS.xml for plex (modified) for use with AppleTV 4k
<?xml version="1.0" encoding="utf-8"?>
<Client name="tvOS">
<!-- Author: Plex Inc. -->
<!-- This profile is used by A10X-based tvOS (Apple TV 4K) devices using the MPV ("experimental") video player. Currently, this requires a Plex Pass subscription. -->
<!-- Because Plex does not currently support TrueHD or DTS-MA playback in the client, this audio is transcoded to FLAC. -->
<Settings>
<Setting name="DirectPlayStreamSelection" value="true" />
<Setting name="StreamUnselectedIncompatibleAudioStreams" value="true" />
</Settings>
<TranscodeTargets>
@Torstein-Eide
Torstein-Eide / debmirror.sh
Created July 10, 2021 10:45 — forked from kleinig/debmirror.sh
debmirror script
#!/bin/sh
DEBMLOG=/pool/debmirror/debmirror.log
MIRRORDIR=/pool/debmirror
BANDWIDTH=500
if test -s $DEBMLOG
then
test -f $DEBMLOG.3.gz && mv $DEBMLOG.3.gz $DEBMLOG.4.gz
test -f $DEBMLOG.2.gz && mv $DEBMLOG.2.gz $DEBMLOG.3.gz
#!/bin/bash
set -ex
declare -a DISTS=("precise" "trusty")
ARCHS="amd64"
function register-mirror {
UBUNTU_URI='http://jp.archive.ubuntu.com/ubuntu/'
ROS_URI='http://packages.ros.org/ros/ubuntu'
@Torstein-Eide
Torstein-Eide / arch_linux_installation.md
Created January 23, 2024 09:33 — forked from orhun/arch_linux_installation.md
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)