Skip to content

Instantly share code, notes, and snippets.

View tox2ik's full-sized avatar
💭
🍸 relaxing

Jaroslav Rakhmatoullin tox2ik

💭
🍸 relaxing
View GitHub Profile
@tox2ik
tox2ik / gist:311f3917c3efbb43ff0a2fa29b47804d
Created July 18, 2023 15:53
wmctrl - add fullscreen mode and raise game window
# This is a workaround to a game forgetting the 'fullscreen setting'
# The fullscreen option can be applied to any window, it works like the "maximize" button on the window bar afaik
# The game must be launched on the current virtual desktop for this to work.
#!/bin/bash
twom-fullscreen ()
{
local _twm=$(wmctrl -l | grep 'This War of Mine'$ | awk '{ print $1 }');
wmctrl -i -r $_twm -b add,fullscreen;
wmctrl -i -a $_twm
@tox2ik
tox2ik / .ssh-config
Last active September 2, 2022 18:12
# copy this into ~/.ssh/config or create a new file there
# fortrabbit example ssh setup
Host deploy.*.frbit.com log.*.frbit.com tunnel.*.frbit.com
# You need to uncomment (remove #) these two lines if you are using an rsa-based key (id_rsa)
#PubkeyAcceptedKeyTypes +ssh-rsa
#HostKeyAlgorithms +ssh-rsa
#IdentityFile ~/.ssh/id_rsa_fortrabbit
#IdentityFile ~/.ssh/id_fortrabbit
@tox2ik
tox2ik / ver.sh
Created February 12, 2021 00:18
enumerate php extension-api date-versions
git clone https://github.com/php/php-src.git
cd php-src
git tag \
| grep -Eo 'php-([0-9]+\.?){3}$' \
| sort -ut. -k1.5,1n -k2,2n -k3,3n \
| while read tag; do
echo $tag `
git show $tag:main/php.h | sed -n ' /#define PHP_API_VERSION /{ s///; p; q } '
` `
#!/bin/bash
declare -a subjects=()
cdupe() { grep -i begin.cert -A 3 ${1:-} | sort -u | wc -l ; }
for i in /etc/frbitx/container/haproxy/certs/*;
do
uniq_lines=`cdupe $i`;
if [[ $uniq_lines == 5 ]]; then
subject=$(openssl x509 -noout -in $i -subject |
awk '{ print $(NF)}')
echo broken: $i $subject
<?php
/*
* Generate a manifest:
*
* php clean-dirs.php save vendor
* git add .present.vendor # optional, may be rsynced/uploaded to document root
*/
/** pretend to generate some assets */
<?php
/**
* Plugin Name: LHF Volunteer Form
* Description: Manages a google-sheet full of names and emails
* Plugin URI: http://ladehammerfestivalen.no/volunteer
* Author URI: http://genja.org
* Author: jazzoslav@gmail.com
* Text Domain: lhf-volunteer-form
* Domain Path: /languages
<?php
/*
* Service-registration with the command design-pattern:
* For details, see: http://www.oodesign.com/command-pattern.html
*
* A notable deviation from recommended approach in this implementation;
* A command (RegistrationTask) does most of the work. The recommended structure
* is to do the expensive work in the Receiver (taskReceiver).
*
@tox2ik
tox2ik / gist:7527329
Created November 18, 2013 12:55
basic aliases
# basic file manipulation, etc
alias cd....='cd ../..'
alias cd...='cd ../..'
alias cd..='cd ..'
alias cd.='cd .'
alias cd~='cd ~'
alias ....='cd ../..'
alias ...='cd ../..'
alias ..='cd ..'
alias ~='cd ~'
@tox2ik
tox2ik / mintty.on.folder.reg
Created November 17, 2013 16:58
Creates an explorer context popup entry for folders (right click). It launches bash in a mintty in the selected folder. Works with cygwin64 (where chere is not yet available).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\mintty]
@="Mintty"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\mintty\command]
@="C:\\cygwin64\\bin\\mintty.exe -h always -e /usr/bin/ash -c 'cd \"$(/usr/bin/cygpath \"%L\")\"; exec /usr/bin/bash '"