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/sh | |
# | |
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] || | |
[ -z $1 ] || [ -z $2 ]; then | |
echo "Usage:" | |
echo " $0 registry/image:tag /path/to/output" | |
exit 0 | |
fi |
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/sh | |
set -o errexit | |
set -o nounset | |
if [ "$EUID" -ne 0 ]; then | |
sudo "$0" "$@" | |
exit | |
fi |
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 | |
if [ "$EUID" -ne 0 ]; then | |
sudo "$0" "$@" | |
exit | |
fi | |
GREEN='\033[1m\033[32m' | |
YELLOW='\033[1m\033[33m' | |
CLEAR='\033[0m' |
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 python3 | |
import dbus | |
import dbus.mainloop.glib | |
from dbus.mainloop.glib import DBusGMainLoop | |
from gi.repository import GLib | |
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | |
bus = dbus.SystemBus() |
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
package main | |
import ( | |
"io" | |
"log" | |
"net" | |
"os" | |
"reflect" | |
"strconv" |
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/sh | |
# SPDX-License-Identifier: GPL-3.0-only | |
# | |
# This file is part of the distrobox project: | |
# https://github.com/89luca89/distrobox | |
# | |
# Copyright (C) 2021 distrobox contributors | |
# | |
# distrobox is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 3 |
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
#UDEV rules to handle powersaving | |
# pcie_aspm=force IN GRUB | |
echo ' | |
# Some logging | |
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/bin/sh -c '"'"'echo Unplugged $(date) >> /var/log/powerlog.log'"'"'" | |
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/bin/sh -c '"'"'echo Plugged $(date) >> /var/log/powerlog.log'"'"'" | |
# CPU Bias power/performance toggle | |
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/bin/x86_energy_perf_policy power" | |
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/bin/x86_energy_perf_policy performance" | |
# Periferals power saving features |
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 | |
IP=$(ip a s wlp3s0 | grep inet | awk '{print $2}' | head -n 1) | |
while true; do | |
ping -q -w 1 -c 1 `ip r | grep default | awk '{print $3}'` > /dev/null | |
# No internet connection | |
if (( $? != 0 )); then | |
sleep 20s | |
ping -q -w 1 -c 1 `ip r | grep default | awk '{print $3}'` > /dev/null | |
if (( $? != 0 )); then |
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 | |
# abort if we're already inside a TMUX session | |
if [ ! -z "$TMUX" ]; then | |
unset TMUX | |
fi | |
# startup a "default" session if non currently exists | |
# tmux has-session -t _default || tmux new-session -s _default -d |
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 | |
ssh_backup() { | |
echo "What's the IP address?" | |
read IP | |
echo "What's the port?" | |
read port | |
SSH="ssh -p $port" | |
DIR=$IP":/home/"$USERNAME; | |
NewerOlder