Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
tskrynnyk / dwm-install.sh
Last active March 10, 2018 23:45
DWM - patch and compile
#!/usr/bin/env bash
#
echo '***' rm
rm -rf dwm-6.1
rm -f dwm-6.1.tar.gz
rm -f *.diff
echo '***' wget
wget https://dl.suckless.org/dwm/dwm-6.1.tar.gz
--- fonts.conf 2017-09-25 10:10:04.000000000 +0200
+++ fonts.conf_new 2018-03-01 00:00:00.000000000 +0100
@@ -65,6 +65,15 @@
</edit>
</match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>helvetica</string>
+ </test>
@tskrynnyk
tskrynnyk / lifeday.pl
Created January 15, 2018 11:06
Life day
#!/usr/bin/perl
use Date::Parse;
use Time::Duration;
my $birth=str2time("1970-01-01 10:00");
print "life day: ".int((time() - $birth)/60/60/24)."\n";
@tskrynnyk
tskrynnyk / .tmux.conf
Last active November 29, 2017 16:14
tmux config
# ~/.tmux.conf
#
TMUX_COLOUR_FG="colour232"
TMUX_COLOUR_BG="colour33"
TMUX_COLOUR_BOLD="colour252"
TMUX_COLOUR_DARK="colour0"
TMUX_COLOUR_NORMAL=$TMUX_COLOUR_BOLD
TMUX_COLOUR_ACTIVE=$TMUX_COLOUR_BG
@tskrynnyk
tskrynnyk / README.md
Last active November 11, 2017 22:56
dwm patched
@tskrynnyk
tskrynnyk / InWords.php
Last active November 4, 2017 23:48
In words
<?php
class InWords
{
private static $words = array();
protected static $numbers = ['zero', 'jeden', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć', 'siedem', 'osiem', 'dziewięć'];
protected static $operands = ['+' => 'plus', '-' => 'minus', '*' => 'razy'];
public static function get($str)
{
# -*- coding: utf-8 -*-
#
import sys
import os
import datetime
import json
import xbmc
reload(sys)
sys.setdefaultencoding('utf8')
@tskrynnyk
tskrynnyk / hibernate-after-suspend.service
Created October 13, 2016 01:11
systemd: hibernate after suspend
# /etc/systemd/system/hibernate-after-suspend.service
[Unit]
Description=Hibernate after suspend
Documentation=https://bbs.archlinux.org/viewtopic.php?pid=1420279#p1420279
Documentation=https://bbs.archlinux.org/viewtopic.php?pid=1574125#p1574125
Documentation=https://wiki.archlinux.org/index.php/Power_management
Documentation=https://wiki.debian.org/SystemdSuspendSedation
Conflicts=hibernate.target hybrid-suspend.target
Before=suspend.target
StopWhenUnneeded=true
@tskrynnyk
tskrynnyk / mdadm.md
Last active September 28, 2016 23:19

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
<?php
header('Content-Type: text/plain; charset=utf-8');
echo "Error 200: OK\n";
?>