Skip to content

Instantly share code, notes, and snippets.


Andrew Starodubtsev illucent

View GitHub Profile
illucent / gist:beaf4a8c6a68bd4f5670f1c6f0c8d67e
Created December 15, 2016 11:20 — forked from Spoygg/gist:3122226
Keyboard switches for XKB setxkbmap
View gist:beaf4a8c6a68bd4f5670f1c6f0c8d67e
altwin:menu = +altwin(menu)
altwin:meta_alt = +altwin(meta_alt)
altwin:ctrl_win = +altwin(ctrl_win)
altwin:meta_win = +altwin(meta_win)
altwin:left_meta_win = +altwin(left_meta_win)
altwin:super_win = +altwin(super_win)
altwin:hyper_win = +altwin(hyper_win)
altwin:alt_super_win = +altwin(alt_super_win)
altwin:swap_lalt_lwin = +altwin(swap_lalt_lwin)
grp:switch = +group(switch)
illucent / gist:8132033
Last active April 2, 2021 00:20
.bashrc file
View gist:8132033
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.
# aliases//
[ -z "$PS1" ] && return
if [ -n "$PS1" ]; then PATH='cw-definitions-path':$PATH; export PATH; fi
illucent /
Created May 20, 2016 19:58
Configure GNOME applications
#To list all settings for a app
# gsettings list-recursively | sort | grep gedit | uniq
#gtk, shell, icon theme
gsettings set org.gnome.desktop.interface gtk-theme 'Arc'
gsettings set org.gnome.desktop.wm.preferences theme 'Arc'
gsettings set name 'Arc-Dark'
gsettings set org.gnome.desktop.interface cursor-theme 'Paper'
gsettings set org.gnome.desktop.interface icon-theme 'Paper'
View gist:c3be9da2b87d79a22112436b93642c9b
# -*- coding: utf-8 -*-
# grub2-editenv /boot/grub2/grubenv create
# dracut --regenerate-all -fv && grub2-mkconfig -o /boot/grub2/grub.cfg
# ## Backup old initramfs nouveau image ##
# mv -fu /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)_orig.img
## Create new initramfs image ##
# dracut -vf --install "/usr/lib/firmware/radeon/*" --kver $(uname -r)
View gist:9a75b59169f5500e6fd15102999f3014
# /etc/security/limits.conf
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

illucent /
Created January 23, 2019 10:36 — forked from savvot/
Extract only keyframes (I-frames) from video to images with console ffmpeg
ffmpeg -ss <start_time> -i video.mp4 -t <duration> -q:v 2 -vf select="eq(pict_type\,PICT_TYPE_I)" -vsync 0 frame%03d.jpg
illucent /
Created January 1, 2019 23:10 — forked from vegard/
Prime factorisation diagram
# -*- coding: utf-8 -*-
# Author: Vegard Nossum <>
import math
import os
import sys
import cairo

Quick reference: Math

Data properties

  • Math.E: number ES1

    Euler’s number, base of the natural logarithms, approximately 2.7182818284590452354.

  • Math.LN10: number ES1




None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).