This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Source: https://github.com/andresgongora/synth-shell/blob/master/synth-shell/better-ls.sh | |
| ## +-----------------------------------+-----------------------------------+ | |
| ## | | | |
| ## | Copyright (c) 2018-2020, Andres Gongora <mail@andresgongora.com>. | | |
| ## | | | |
| ## | This program is free software: you can redistribute it and/or modify | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ## +-----------------------------------+-----------------------------------+ | |
| ## | | | |
| ## | Copyright (c) 2018-2020, Andres Gongora <mail@andresgongora.com>. | | |
| ## | | | |
| ## | This program 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, either version 3 of the License, or | | |
| ## | (at your option) any later version. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function updateSystemClock() { | |
| # timedatectl timesync-status; echo | |
| _log stdout 'Synchronizing clock' | |
| sudo systemctl restart systemd-timesyncd || return 1 | |
| sleep 2; echo | |
| # systemctl status systemd-timesyncd; echo | |
| journalctl --lines=1 -xru systemd-timesyncd; echo | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # shellcheck disable=SC2086 | |
| # | |
| # DESCRIPTION: | |
| # 'safely' kill processes holding file locks for a file path | |
| # useful for managing mountpoints with user session state changes | |
| # | |
| # USAGE: | |
| # $0 <file-path> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| test -z "$1" && exit 1 | |
| declare -a _PGREP; _PGREP+=('pgrep') | |
| test ${#1} > 15 && _PGREP+=('--full') | |
| _PGREP+=('--ignore-ancestors' "$1") | |
| mapfile -t _PIDS < <("${_PGREP[@]}") | |
| test ${#_PIDS[@]} = 0 && exit 1 | |
| _SIGNALS=(15 1 3 6 9) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # iterates through a directory and its subdirectories | |
| # updating any git repositories from remote | |
| # | |
| set +e | |
| for d in *; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # migrate.sh | |
| # DESCRIPTION: Parse two directories of logfiles. | |
| # FUNCTION: Append new files with old ones, delete files that are small, and move new files that aren't present to the old directory. | |
| # USAGE: bash migrate.sh /path/to/old_logdir /path/to/new_logdir | |
| # ELABORATION: | |
| # Settings | |
| minlines=15 # Threshhold number of lines to delete a logfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install dependencies for creating filesystem and installing bootloader | |
| ## This script is mostly system-independent, except for this part. Replace yaourt and the args with your own package manager | |
| yaourt -S --noconfirm mtools syslinux dosfstools | |
| # Plug in the flash drive, and find its device. Don't mount it. | |
| lsblk | |
| while [[ $(echo $FLASHDEV | grep -c \/dev\/sd[a-z]) -lt 1 && -b "$FLASHDEV" ]] ; do | |
| read -p 'Which device (e.g. /dev/sdf)? ' FLASHDEV |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Requires: | |
| # - restic (system package) | |
| # - AWS account with SNS topic configured and API keys created | |
| # - awscli (pip) with API keys configured (aws configure) | |
| # - Backblaze B2 account with API keys | |
| # - cron implementation (system package) | |
| ResticBinaryPath=`which restic` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Requires: | |
| # - restic (system package) | |
| # - AWS account with SNS topic configured, S3 bucket created, and API keys created | |
| # - awscli (pip) with API keys configured (aws configure) | |
| # - cron implementation (system package) | |
| ResticBinaryPath=`which restic` | |
| AwsCliBinaryPath=`which aws` |
NewerOlder