#!/usr/bin/env python3 | |
# encoding: utf-8 | |
# Copyright (C) 2024 John Törnblom | |
# | |
# 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 program is distributed in the hope that it will be useful, but |
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page, on | |
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). | |
{ config, lib, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
#!/usr/bin/env bash | |
# TODO: test wayland gamescope session | |
export DISPLAY=:0 # vnc | |
export WAYLAND_DISPLAY=:2 # xwayland | |
export DXVK_HDR=1 | |
export ENABLE_GAMESCOPE_WSI=1 | |
# Check existing X server | |
start_x() { |
... via OpenSSL and Traefik
A HTTPS tunnel for SSH (Secure Shell) is a useful tool for accessing a remote server in a secure manner when the connection is limited or restricted by a firewall or network security measures. It provides a secure way to bypass these restrictions and access the remote server securely over the internet. The HTTPS protocol, which is used to secure web traffic, is utilized to create a secure connection to the remote server. The data transmitted over this connection is
# 0. Use `crtl+h` and replace `{{HOST}}` with the IP address of a server you | |
# control and want to direct the traffic to. Or Just use `0.0.0.0` to block it. | |
# | |
# 1. Log into your Pi-hole device and move this file into the `/etc/dnsmasq.d/` | |
# directory. Feel free to rename it. | |
# | |
# 2. Run the command `pihole restartdns` | |
# Redirects Nintendo Landing Page Domains | |
address=/ctest.cdn.nintendo.net/{{HOST}} |
# To set this up, first get tailscale working in an isolated linux shell: | |
# 1. sudo systemctl stop tailscaled.service | |
# 2. tailscaled -port 9993 -state tailscale-luks-setup.state -tun userspace-networking -socket ./tailscaled.sock | |
# 3. tailscale -socket ./tailscaled.sock up -hostname HOSTNAME-luks | |
# 4. tailscale -socket ./tailscaled.sock down | |
# 5. ctrl-c out of tailscaled | |
# 6 sudo systemctl start tailscaled.service | |
# | |
# Then add the .state file to your machine secrets and pass its path as tailscaleStatePath. |
import hassapi as hass | |
import datetime | |
class reminder(hass.Hass): | |
def initialize(self): | |
self.set_namespace("reminder") | |
self.listen_event(self.set_reminder,'set_reminder', namespace='default') | |
self.listen_event(self.remove_reminder,'remove_reminder', namespace='default') | |
domain = 'reminder' |
Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat
the TGZs, and extract:
$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -
You don't even need to use brace expansion. Globbing will order the files numerically:
$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
#!/bin/sh | |
# | |
# Clean-up Xiaomi smartphone without rooting: | |
# | |
# 1) You have to install adb tool from android sdk | |
# 2) You have to activate developer options, next activate usb debugging | |
# 3) Comment out or delete lines with packages, if you really need them | |
# 4) Optional: I hightly recommed to activate OEM unlocking feature in developer options. | |
# It doesn't unlock you device immediately, but in case of breaking you phone | |
# you will have opportunity to unlock you phone and reflash it via MiFlash. |