This file contains hidden or 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 <assert.h> | |
#include <fcntl.h> /* For O_* constants */ | |
#include <signal.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> /* For mode constants */ | |
#include <unistd.h> | |
#include <wayland-client.h> |
This file contains hidden or 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 <signal.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <wayland-client.h> | |
#include <wayland-server.h> | |
static struct wl_display *display = NULL; | |
static struct wl_event_loop *loop = NULL; | |
static bool running = true; |
This file contains hidden or 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 <fcntl.h> | |
#include <getopt.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <wayland-client.h> |
This file contains hidden or 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
version: "3" | |
services: | |
ovpn: | |
image: dperson/openvpn-client | |
cap_add: | |
- NET_ADMIN | |
security_opt: | |
- label:disable |
This file contains hidden or 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 | |
# | |
# Convert a video file to suitable format for Telegram video stickers. | |
# See: https://core.telegram.org/stickers#video-stickers | |
# If the video stream has duration larger than required, it will be sped up | |
# to match 3 seconds. | |
# Script requires `ffmpeg`, `ffprobe` and `jq` to be present in $PATH. | |
# | |
set -euo pipefail | |
if [[ $# -lt 2 ]]; then |
This file contains hidden or 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 | |
[[ -z $TOKEN ]] && { echo "No bot token provided" >&2; exit 1; } | |
URL="https://api.telegram.org/bot$TOKEN" | |
while :; do | |
res=$(curl -s "$URL/getUpdates" -F offset="${last_upd_id:-0}") | |
last_upd_id=$(jq -r '.result[-1].update_id + 1' <<<"$res") | |
while read -r msg; do | |
mention=$(jq -r \ | |
'.new_chat_members[0] | |
| if .username then "@\(.username)" |
This file contains hidden or 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 | |
dx=10 | |
dy=10 | |
tree=$(swaymsg -t get_tree) | |
cur_window=$(jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)' <<<"$tree") | |
if [[ $(jq -r '.type' <<<"$cur_window") != "floating_con" ]]; then | |
echo "Script must be executed inside a floating window" 1>&2 | |
exit 1 | |
fi | |
cur_ws=$(jq -r 'recurse(.nodes[]?) | select(.type == "workspace" and (recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)))' <<<"$tree") |
This file contains hidden or 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 <assert.h> | |
#include <linux/input-event-codes.h> | |
#include <stdlib.h> | |
#include <wayland-client.h> | |
#include <wayland-cursor.h> | |
#include "list.h" | |
#include "log.h" | |
#include "swaybar/bar.h" | |
#include "swaybar/config.h" | |
#include "swaybar/input.h" |
This file contains hidden or 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
std=type("",(),{"__getitem__":lambda _,__:__.step})();cout=type("",(),{"__lshift__":lambda _,__:_+print(__,end=""),"__add__":lambda _,__:_})();endl="\n";kw=type("",(),{"__sub__":lambda _,__:_+exec("_.__=str(__)",globals(),locals()),"__add__":lambda _,__:_,"__eq__":lambda _,__:exec("globals()[_.__]=var(__)",globals(),locals())});int=kw();float=kw();string=kw();char=kw();double=kw();unsigned=kw();long=kw();short=kw();struct=type("",(),{"__sub__":lambda _,__:_+exec("_.__=__" if isinstance(__,str) else "globals()[_.__]=struct_type()",globals(),locals()),"__add__":lambda _,__:_})();struct_type=type("",(),{"__add__":lambda _,__:_,"__sub__":lambda _,__:_+exec("globals()[__]=struct_val()",globals(),locals())});struct_val=type("",(),{"__getattr__":lambda _,__:_+exec("_.__dict__[__]=var()\n_.__=__",globals(),locals()),"__add__":lambda _,__:_.__dict__[_.__]});var=type("",(),{"__eq__":lambda _,__:_.__init__(__),"__init__":lambda _,__=None:exec("_.__=__",globals(),locals()),"__pow__":lambda _,__:_,"__repr__":lambda _:str( |
This file contains hidden or 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 http = require"ssl.https" | |
local url = require"socket.url" | |
local json = require"cjson" | |
local token = os.getenv("TOKEN") | |
local tguri = "https://api.telegram.org/bot"..token | |
local last_update_id = 0 | |
local function process_update(update) | |
if not update.message then return end |