Skip to content

Instantly share code, notes, and snippets.

View kalkin's full-sized avatar

Bahtiar Gadimov kalkin

View GitHub Profile
@kalkin
kalkin / gnome-compose:lctrl.md
Created June 7, 2023 08:04
Set Compose Key to Left Control in Gnome

Enable Left Control Key as Compose Key on Gnome

In recent updates, Gnome Tweak Tool and the standard Gnome Keyboard Settings no longer provide the option to set the left control key as a Compose key. If you want to customize your keyboard configuration to use the left control key as a Compose key, follow these instructions.

Inspect Current Keyboard Settings

First, check your current keyboard settings by running the following command in your terminal:

gsettings list-recursively org.gnome.desktop.input-sources
import asyncio
# Start the slixmpp Client
client = slixmpp.Client()
client.start()
# Define a new async function
async def my_async_function():
# Perform some asynchronous task here
await asyncio.sleep(1)
@kalkin
kalkin / resize-prompt.zsh
Created December 3, 2021 21:18
Properly resize zsh prompt
# It's not possible to properly resize a zsh prompt after the terminal changed
# it size. People think it's a hard to solve issue. See here:
# https://github.com/romkatv/powerlevel10k/issues/175. There're sollutions like
# patching the ZSH it self https://github.com/romkatv/zsh/tree/fix-winchanged
# but this is a total overkill.
# A far simpler solution is to save the old COLUMN value and on resize to
# calculate how many lines the prompt takes after reflow, move the cursor up
# that many lines and then draw your prompt.
#!/bin/sh
# Author: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
#
# Shell script to list all the repositories of a user or organization.
#
# This script depends only on curl(1). It will list only the first 10,000 repos.
# Keep in mind that Github limits API requests for non authenticated users.
# License: Public Domain
name="$1"
# vim: ft=make ts=4 sw=4
# Ready to use config for full build of the Qubes OS 4.0 (as of yet, unreleased)
GIT_BASEURL ?= https://github.com
GIT_PREFIX ?= QubesOS/qubes-
VERBOSE = 0
DEBUG = 0
NO_SIGN = 1
NO_CHECK = 1
@kalkin
kalkin / vmm
Created April 25, 2016 09:04
Execute an action or command on currently focused domain (This script is for QubesOS)
#!/bin/sh
set -e
# vim: fdm=marker sw=4 ts=4 tw=80
# Author: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
print_help() {
echo "Usage: vmm [-hHKRSX] [-n VM_NAME] [COMMAND]"
echo
echo "Execute an action or command on currently focused domain"
echo 'Commands:'
use v6;
use Inline::Perl5;
use Text::Haml:from<Perl5>;
my $haml = Text::Haml.new;
my $html = $haml.render_file('index.haml');
say $html;
my role X::Comp { ... }
my class X::ControlFlow { ... }
my class Exception {
has $!ex;
has $!bt;
method backtrace(Exception:D:) {
if $!bt { $!bt }
elsif nqp::isconcrete($!ex) {
#!/bin/python
import fcntl
from ansible.callbacks import vvv, vv
from ansible import errors
from ansible import utils
from qubes.qubes import QubesVmCollection
import subprocess
import os
import logging
log = logging.getLogger('Ansible Qubes Connection')
#!/usr/bin/python
DOCUMENTATION = '''
---
module: qvm
short_description: check state presence/absence/running/halted of a qubes vm
description:
- check presence/absence/running/halted of a qubes vm. If a vm is not
running it will be started. If vm is not halted it will be stopped.
options: