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
On my watch the 12/24 hour setting is in | |
Settings->System->Time->Time-Format | |
You can use it for example like this: | |
var time = Gregorian.info(Time.now(), Time.FORMAT_SHORT); | |
var deviceSettings = System.getDeviceSettings(); | |
var is24Hour = deviceSettings.is24Hour; | |
var hour = is24Hour ? time.hour : 1 + (time.hour + 11) % 12; |
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 PyGObject | |
# PyGObject is a Python package which provides bindings for GObject based libraries such as GTK, GStreamer, WebKitGTK, GLib, GIO and many more. | |
from gi import require_version | |
# for arguments | |
from sys import argv | |
from os import geteuid | |
if geteuid() != 0: | |
exit("You need to have root privileges to run this script.\nPlease try again, this time using 'sudo'. Exiting.") |
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
{} |
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/env python3 | |
""" | |
Helper script to remove old ZFS snapshots | |
Copyright (c) Onlime GmbH, https://www.onlime.ch | |
""" | |
import argparse | |
from re import compile | |
from datetime import datetime, timedelta | |
from subprocess import check_output | |
import sys |
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
[defaults] | |
# (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin) | |
# These warnings can be silenced by adjusting this setting to False. | |
;action_warnings=True | |
# (list) Accept list of cowsay templates that are 'safe' to use, set to empty list if you want to enable all installed templates. | |
;cowsay_enabled_stencils=bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, sheep, small, stegosaurus, stimpy, supermilker, three-eyes, turkey, turtle, tux, udder, vader-koala, vader, www | |
# (string) Specify a custom cowsay path or swap in your cowsay implementation of choice | |
;cowpath= |
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
#!/bin/sh | |
for path; do | |
sed -i 's/\bapple\b/banana/g' "$path" | |
sed -i 's/\bmaster\b/primary/g' "$path" | |
sed -i 's/\bslave\b/worker/g' "$path" | |
sed -i 's/\bblacklist\b/blocklist/g' "$path" | |
sed -i 's/\bblack list\b/blocklist/g' "$path" | |
sed -i 's/\bwhite list\b/allowlist/g' "$path" | |
sed -i 's/\bblack hat hacker\b/attacker/g' "$path" | |
sed -i 's/\bblack-hat hacker\b/attacker/g' "$path" |
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
#!/bin/bash | |
set -e | |
if [ -d ~/.local/share/JetBrains/Toolbox ]; then | |
echo "JetBrains Toolbox is already installed!" | |
exit 0 | |
fi | |
echo "Start installation..." |
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 get_project_root() -> Path: | |
"""Returns project root folder.""" | |
return Path(__file__).parent.parent |
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
nc -vz <IP> <PORT> -w 4 |