Skip to content

Instantly share code, notes, and snippets.

View archydragon's full-sized avatar

Nikita K. archydragon

View GitHub Profile
@archydragon
archydragon / i3shot.pl
Created November 21, 2012 18:37
Take screenshot of all active i3 workspaces
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use JSON qw( decode_json ); # isn't default module, must be installed via CPAN or your system package manager
use Time::HiRes qw ( usleep ); # for simple delays
my $outputfile = shift; # getting output filename from command-line params
#!/usr/bin/env perl
# dedicated to hatred of High 10 H.264 profile
# finds all MKV files in current directory and re-encodes them to kawaii High@*
# WARNING: make sure that your x264 is built with ffmpeg support
use strict;
use warnings;
use 5.010;
use Math::Round; # must be installed from CPAN
@archydragon
archydragon / ossfaq.md
Created February 14, 2013 15:03
FAQ to most part of open source software projects

"Implement a feature XXXX, otherwise I'll use another project."

  1. No.

  2. Feel free to.

"Without that functionality this project is useless."

It's your personal opinion.

@archydragon
archydragon / crcheck.sh
Created March 28, 2013 04:53
useless CRC32 validator
#!/bin/bash
CRC32="/usr/bin/crc32"
FILENAME=$1
echo -ne "$FILENAME\t\t"
NAMED_CRC=`echo $FILENAME | sed -e 's/^.*\[\(.\{8\}\)\]\..*$/\1/g' | tr '[:upper:]' '[:lower:]'`
CALCULATED_CRC=`$CRC32 "$FILENAME" | tr '[:upper:]' '[:lower:]'`
if [[ $NAMED_CRC == $CALCULATED_CRC ]]; then
echo -e "OK"
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use JSON qw( decode_json );
use LWP::Simple;
my $user = $ARGV[0];
@archydragon
archydragon / thin-app
Created February 7, 2014 11:14
init.d script template to run Thin application under user using RVM
#! /bin/sh
### BEGIN INIT INFO
# Provides: thin-app
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs
# Short-Description: Application description
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
@archydragon
archydragon / nobingthanks.css
Last active August 29, 2015 14:01
Remove tweet translations
.tweet.opened-tweet .tweet-translation {
display: none;
}
.stream-item-header .translate-button {
display: none;
}
@archydragon
archydragon / webm.sh
Last active April 25, 2016 11:01
WebM cutter
#!/bin/bash
usage() {
echo "WebM cutter and uploader."
echo "Usage: $0 <source> <start time> <length> [-subs]"
echo "Example: $0 video.mkv 00:10:15 00:00:30"
exit 1
}
if [ $# -eq 0 ]; then usage; fi
@archydragon
archydragon / example.conf
Created August 21, 2014 18:02
Custom Nginx fancyindex stylesheet
location /devnull {
fancyindex on;
fancyindex_exact_size off;
fancyindex_css_href "/fancyindex.css";
allow all;
}
@archydragon
archydragon / yt2ogg.sh
Created December 8, 2014 09:41
Save playlist from Youtube as the pack of Vorbis files
#!/bin/zsh
LINK="$1"
youtube-dl -i -f 141 "${LINK}"
for F in *.m4a; do
ffmpeg -i "${F}" -acodec libvorbis -ab 192k "${F/%m4a/ogg}"
done
rm *.m4a