$ sudo iw phy0 wowlan enable magic-packet
$ sudo iw phy0 wowlan show
WoWLAN is enabled:
* wake up on magic packet
$ sudo systemctl suspend
…
$ sudo iw phy0 wowlan show
WoWLAN is enabled:
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 asyncio | |
async def test(s, n): | |
print(f' {s} started') | |
await asyncio.sleep(n) | |
print(f' {s} ends') | |
async def main(): |
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
[Unit] | |
Description=soju IRC bouncer service | |
After=network.target | |
[Service] | |
Type=simple | |
DynamicUser=yes | |
StateDirectory=soju | |
LogsDirectory=soju | |
ConfigurationDirectory=soju |
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
# ~/.ssh/config | |
Host * | |
ControlMaster auto | |
TCPKeepAlive yes | |
ServerAliveInterval 30 | |
ControlPath ${XDG_RUNTIME_DIR}/ssh-%C.ctl | |
IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket | |
AddKeysToAgent 60m |
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
''' | |
Example of IAM Authentication to Postgres RDS from Python and SQLAlchemy. Uses SQLAlchemy events to | |
run a callback just before making a db connection and adding it to the internal pool. The callback | |
sets the connection parameters including the password/token. | |
https://docs.sqlalchemy.org/en/14/core/events.html#sqlalchemy.events.DialectEvents.do_connect | |
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html | |
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.Python.html | |
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.generate_db_auth_token |
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 asyncio | |
import aiohttp | |
async def request(session, url): | |
resp = await session.get(url) | |
return await resp.text() | |
async def main(): | |
session = aiohttp.ClientSession() |
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
# ~/.aliases | |
# Some usefull shortcuts | |
alias ls='LC_COLLATE=C ls --color=auto -F --group-directories-first' | |
alias diff='diff --color -u' | |
alias d=ls | |
alias cd..="cd .." | |
alias cd...="cd ../.." | |
alias v="ls -l" | |
alias ..="cd .." | |
alias ...="cd ../.." |
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
include "%L" | |
# see also https://github.com/kragen/xcompose/ | |
<Multi_key> <y> <y> : "✓" U2713 # checkmark | |
<Multi_key> <x> <x> : "✗" U2717 # BALLOT X | |
<Multi_key> <o> <minus> <plus> : "♀" U2640 # FEMALE SIGN | |
<Multi_key> <o> <minus> <greater> : "♂" U2642 # MALE SIGN | |
<Multi_key> <t> <e> <l> : "☎" U260E # BLACK TELEPHONE |