Skip to content

Instantly share code, notes, and snippets.

View TechnoSparks's full-sized avatar

Shahmi Saidi TechnoSparks

View GitHub Profile
@TechnoSparks
TechnoSparks / runvidia
Created April 29, 2018 03:51
Script to define your own defaults when launching applications under bumblebee
#!/bin/bash
USAGE="How to use:
runvidia [OPTION] <command>
Available OPTIONs:
--vsync Sets vsync to turn ON, program-overridable
--vsync-force-off Force vsync to OFF, regardless program's preferences
--primussync NUM Changes primus_sync env var.
Defaults to NUM=1, which \"synchronizing primus' display
@TechnoSparks
TechnoSparks / backup.sh
Last active March 29, 2020 09:04
Use rsync to do incremental backup, that utilises "--link-dest" instead of "--backup". This allows the benefit of having all the files in a single directory
#!/bin/bash
# EXTEND AS NEEDED
# Derived from https://www.howtogeek.com/175008/the-non-beginners-guide-to-syncing-data-with-rsync/
# confable
# backup_misc_dir needs to be absolute. careful!
to_backup="$(pwd)/Moonglow"
backup_dir="$(pwd)/Moonglow Backups"
backup_misc_dir="$backup_dir/logs and misc"
<section>
<textarea id="container" rows="10" style="width: 99%" readonly></textarea><br>
<button onclick="heartgen()">Generate &amp; Copy</button>
</section>
<script>
function randomiser(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive
@TechnoSparks
TechnoSparks / Launch Minimised on Windows for WebCatalog.md
Last active November 15, 2021 07:18
Guide on how to achieve "launch minimised" for apps on WebCatalog

Launch Minimised on Windows for WebCatalog

Guide on how to achieve "launch minimised" for apps on WebCatalog

Requirements

  • Acknowledge that this is a hacky workaround. Your mileage will vary.
  • Make sure "run in background" is enabled: 🔧 App Settings → General → [Under System section] Run in background
  • Make sure "Open at login" set as No: 🔧 App Settings → General → [Under System section] Open at login
  • Make sure tray is enabled:
@TechnoSparks
TechnoSparks / Backup and Restore Script for Termux.md
Last active January 20, 2022 09:57
simple script to trigger backup / restore over SSH using rclone

Backup and Restore Script for Termux

simple script to trigger backup / restore over SSH using rclone

Setup

  • A termux environment,
    • SD card All Files access enabled
    • termux-setup-storage configured
  • An backup server/path
  • Modify scripts based on your path of course
  • Script must be executable of course. chmod ugo+x the scripts

Pause Duplicati if Process exists

Requirements

  • Powershell 5+
  • Duplicati Client binary built and is in PATH
  • Both files need to be in a same dir

Note

  • pause duplicati onProcess.launcher.pid.txt is created and contains the script's PID so that if there's a need to stop the script, the user can do so via Task Manager