#!/bin/zsh
echo $(blueutil -p) > ~/.bluestatus
bluestatus=$(head -n 1 ~/.bluestatus)
This file contains 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
function floatStr(str, outputDecimalSeparator = ',', possibleSeparators = [',', '.']) { | |
str = str.replace('.', outputDecimalSeparator); | |
str = str.replace(',', outputDecimalSeparator); | |
possibleSeparators.forEach(el => { | |
str = str.replace(el, outputDecimalSeparator); | |
}); | |
if (str.startsWith(outputDecimalSeparator)) { |
This file contains 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
import re | |
from pprint import pprint | |
class SambaConfig(): | |
def __init__(self) -> None: | |
self.data = {} | |
self.original_raw_data = {} | |
def get_seciton(self, section: str) -> dict: |
This file contains 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
{ | |
"disabledTimestamp": 0, | |
"forceEvenIfNotEnabledTimestamp": 0, | |
"isActionBlock": false, | |
"isBeingImported": false, | |
"isClonedInstance": false, | |
"isExtra": false, | |
"isFavourite": false, | |
"lastEditedTimestamp": 1692178071905, | |
"localVariables": [], |
This file contains 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
# Run a flatpak | |
#! /usr/bin/bash | |
flatpak kill your.app.name | |
flatpak-builder build/ your.app.name.json --user --force-clean | |
flatpak-builder --run build/ your.app.name.json app-name | |
# Install a Flatpak | |
#! /usr/bin/bash | |
flatpak kill your.app.name |
This file contains 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
# Toggle the ftp server on and off | |
test -f /tmp/megaftp-on && (mega-ftp -d --all && rm /tmp/megaftp-on && notify-send 'Mega FTP stopped') || (mega-ftp ./ && touch /tmp/megaftp-on && notify-send 'Mega FTP started' |
This file contains 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/python3 | |
# both megacmd and bw-cli need to be installed and configured before running this script | |
# bw-cli from snap needs to be configured in order to write in the /tmp folder | |
# files will be uploaded in the /bw folder on MEGA | |
import sys | |
import os | |
import subprocess | |
from getpass import getpass |
This file contains 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
# Credit: https://stackoverflow.com/questions/39818733/create-dictionary-where-keys-are-variable-names | |
def create_dict(*args: str): | |
return dict({i:eval(i) for i in args}) |
This file contains 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
def qq(condition, is_true, is_false): | |
return is_true if condition else is_false |
NewerOlder