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
# List all possible power config GUIDs in Windows | |
# Run: this-script.ps1 | Out-File powercfg.ps1 | |
# Then edit and run powercfg.ps1 | |
# (c) Pekka "raspi" Järvinen 2017 | |
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting | |
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup | |
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object { | |
$tmp = $_.ManagedElement |
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
# List Windows advanced power settings as MarkDown | |
# Use: | |
# this-script.ps1 | Out-File power.md | |
# Use powercfg to show hidden settings: | |
# powercfg -attributes <Group GUID> <GUID> -ATTRIB_HIDE | |
# example: | |
# powercfg -attributes 54533251-82be-4824-96c1-47b60b740d00 06cadf0e-64ed-448a-8927-ce7bf90eb35d -ATTRIB_HIDE | |
# (c) Pekka "raspi" Järvinen 2017- | |
$powerSettingSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingSubgroup | Where-Object {$_.ElementName -ne $null} |
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
# Download new packages but don't install them | |
# Save in /etc/systemd/system/ | |
[Unit] | |
Description=Pacman Automatic Download (no install) service | |
After=network-online.target | |
[Service] | |
# Wait time if process hangs | |
TimeoutStopSec=5m |
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
# systemctl --user enable murmur | |
# systemctl --user start murmur | |
# .config/systemd/user/murmur.service : | |
[Unit] | |
Description=Mumble Daemon | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/murmurd -ini murmur.ini -fg |
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 | |
# source_*.png (source_1234.png) to mkv | |
find . -type f -iname "*.png" -printf "%f\n" | sort -n | xargs cat | ffmpeg -f image2pipe -i - output.mkv |
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
pgrep -fi firefox | xargs -I{} find /proc/{}/fd -readable -type l -printf '%p%f: %l\n' |
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
# Local chat with socat | |
# Server runs: | |
socat ABSTRACT-LISTEN:@chat,socktype=5,fork STDOUT | |
# Client: | |
socat ABSTRACT-CONNECT:@chat,socktype=5 - |
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
from itertools import permutations | |
from typing import Generator, List | |
def gen(s: List[str]) -> Generator: | |
for i in permutations(s, len(s)): | |
yield list(i) | |
def acro(a:List[str]) -> Generator: | |
for i in gen(a): | |
firsts:List[str] = [] |
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
SELECT | |
d.datname db | |
FROM | |
pg_catalog.pg_database d | |
WHERE | |
d.datname NOT LIKE ALL (ARRAY ['template%', 'postgres']) | |
ORDER BY 1; |
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
# Save in /etc/systemd/system/network-ping-gateway.service | |
[Unit] | |
Description=Ping default network gateway service | |
After=network-online.target | |
[Service] | |
# Wait time if process hangs | |
TimeoutStopSec=1m | |
# Command to run |
NewerOlder