Skip to content

Instantly share code, notes, and snippets.

View DEAD10CC's full-sized avatar

Markus Michel DEAD10CC

  • Chefkoch GmbH
  • Cologne - Germany
View GitHub Profile
@DEAD10CC
DEAD10CC / PVE-host-backup.md
Created November 21, 2025 16:24 — forked from mrpeardotnet/PVE-host-backup.md
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@DEAD10CC
DEAD10CC / UIApplication+LaunchScreenCache
Created December 18, 2019 19:04
Clearing app's launch screen cache
// Kudos to Rambo for this nice litte helper
// Code from https://rambo.codes/ios/quick-tip/2019/12/09/clearing-your-apps-launch-screen-cache-on-ios.html
import UIKit
public extension UIApplication {
func clearLaunchScreenCache() {
do {
try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
// Remove ignored files from git that are still checked in
git ls-files -i --exclude-from=.gitignore | xargs git rm --cached
// fast-forward another branch
git fetch . HEAD:another-branch
@DEAD10CC
DEAD10CC / gist:533968c67ca34b84770778113fe46a85
Last active March 18, 2019 11:30
Setting delaysContentTouches = NO on a scroll view allows buttons within the scroll view to react on touches instantly. However, if you touch within the button's bounds to start scrolling, nothing happens. By overriding this method in a scroll view subclass, you can have best of both worlds: instant button tap and scrolling recognition.
// Credits go to http://charlesharley.com/2013/programming/uibutton-in-uitableviewcell-has-no-highlight-state
- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
// Because we set delaysContentTouches = NO, we return YES for UIButtons
// so that scrolling works correctly when the scroll gesture
// starts in the UIButtons.
if ([view isKindOfClass:[UIButton class]]) {
return YES;
}
@DEAD10CC
DEAD10CC / NavigationController+CompletionBlock.swift
Created September 11, 2017 12:52
Extension that provides completion blocks for push/pop on navigation controllers.
//
// NavigationController+CompletionBlock.swift
// SwiftFlowGitHubBrowser
//
// Created by Benji Encz on 7/23/16.
// Copyright © 2016 Benji Encz. All rights reserved.
//
import UIKit
// Extension that provides completion blocks for push/pop on navigation controllers.
@DEAD10CC
DEAD10CC / create-branches-list.sh
Created May 10, 2017 07:46
Preparation script for Jenkins Git branch selection
#!/usr/bin/env bash
export branches_filename=branches.properties
export branches=${HOME}/${branches_filename}
git fetch --all
git remote prune origin
echo -ne "branches=" > ${branches}
git branch -r | awk '/origin\/feature|bugfix/{printf "%s,", $1 }' | head -n 1 >> ${branches}
echo "" >> ${branches}
scp ${branches} jenkins@slave-1:~/${branches_filename}