Skip to content

Instantly share code, notes, and snippets.

@kennethso168
kennethso168 / Usage.md
Last active August 29, 2024 05:32
Download and import cloud images to existing Proxmox VM/templates

Instructions for use

  1. Copy/download get_cloud.py to /usr/local/bin of the Proxmox node
  2. Change common variables inside the script
  3. chmod +x /usr/local/bin/get_cloud.py
  4. Copy and edit the xxx.service and xxx.timer into the folder /etc/systemd/system. Adjust the contents as appropriate (xxx can be any string, provided that the names of the SystemD unit (xxx.service) and the timer (xxx.timer) is the same. The above files are provided as an example only)
  5. systemctl daemon-reload
  6. systemctl enable xxx.timer && systemctl start xxx.timer
  7. To download and import the cloud image right away, run systemctl start xxx.service. You don't have to wait for the service to finish and can back out immediately by pressing Ctrl+C.
  8. To view the output of the service run journalctl -u xxx.service
#!/usr/bin/env python
MIRRORLIST_FILE = '/etc/pacman.d/mirrorlist'
ENFORCE_ROOT = True
BRANCH = 'stable'
# A mirror that is assumed to be always available and is the most up-to-date
MOST_UPDATE_MIRROR='https://mirror.netzspielplatz.de/manjaro/packages'
# How many seconds before the connection timeouts (i.e. the mirror is considered as unreachable)
TIMEOUT=10
@kennethso168
kennethso168 / restic_backup.sh
Last active November 30, 2021 00:07
My Backup Solution
#!/bin/bash
# Location of your restic repo
export RESTIC_REPOSITORY=/run/media/kenneth/MyBook/restic
# Password of the restic repo
# Use a keyring to store the password so it isn't stored in plaintext on disk
# Install python-keyring (Arch) to use this command
export RESTIC_PASSWORD=`keyring get restic MyBook`
if ! restic snapshots
@kennethso168
kennethso168 / gist:38e8a6d71ff17df5f6a8ed9d64b9b9bd
Created June 13, 2018 13:55
Logcat just around strava login in GhostRacer
06-13 21:49:20.597 3364-8290/? I/AsyncOpDispatcher: 45-xlb
06-13 21:49:20.922 31267-31267/? I/OAuth: on page started : http://localhost/done.php?state=&code=a95a3502f72d60bb0d098c53620f56df1ac11029&scope=write
access code : a95a3502f72d60bb0d098c53620f56df1ac11029&scope=write
06-13 21:49:20.922 3364-8290/? I/AsyncOpDispatcher: 45-xlb
06-13 21:49:20.937 31267-32444/? D/libc: [NET] android_getaddrinfo_proxy get netid:0
06-13 21:49:20.937 1286-1607/? D/DnsProxyListener: argv[0]=getaddrinfo
argv[1]=www.strava.com
argv[2]=^
argv[3]=1024
argv[4]=0
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#TabsToolbar {
padding-right: 5vw !important
}
[ 0.000000] microcode: microcode updated early to revision 0x20, date = 2017-01-27
[ 0.000000] Linux version 4.9.43-1-MANJARO (builduser@manjaro) (gcc version 7.1.1 20170630 (GCC) ) #1 SMP PREEMPT Sun Aug 13 20:28:47 UTC 2017
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.9-x86_64 root=UUID=bd8eb29c-3909-4d69-a693-f89b605bc72d rw quiet resume=UUID=e5fa7363-94cb-40dd-b759-47c21fd7756f
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] x86/fpu: Using 'eager' FPU context switches.
[ 0.000000] e820: BIOS-provided physical RAM map: