This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run \ | |
-it --rm \ | |
-e DISPLAY=$DISPLAY \ | |
-e LC_ALL=C \ | |
-v ${HOME}/.pgadmin3_home:/home \ | |
-e HHHOME=${HOME} \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v ${HOME}/.Xauthority:/root/.Xauthority \ | |
--net host \ | |
jancelin/docker-pgadmin3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Measures each job's time spent in a queue | |
# | |
# Register the pluging to start using it | |
# Delayed::Worker.plugins << Delayed::QueueTimeLoggerPlugin | |
# | |
class Delayed::QueueTimeLoggerPlugin < Delayed::Plugin | |
callbacks do |lifecycle| | |
lifecycle.before(:perform) do |worker, job| | |
queued_for = Time.zone.now - job.created_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Interactive cal | |
# | |
# Allows to scroll through the calendar interactively. | |
# Uses `cal` utility to print the calendar. | |
# | |
# © Michael Klimenko | |
set_current_date() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# Source: https://gist.github.com/skanev/9d4bec97d5a6825eaaf6 | |
# | |
# A sneaky wrapper around Rubocop that allows you to run it only against | |
# the recent changes, as opposed to the whole project. It lets you | |
# enforce the style guide for new/modified code only, as opposed to | |
# having to restyle everything or adding cops incrementally. It relies | |
# on git to figure out which files to check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dropbox_uploader -E upload "%n" Скриншоты/ && dropbox_uploader -u -q share "Скриншоты/%n" | xclip -filter -selection clipboard; zenity --info --window-icon=/usr/share/icons/hicolor/16x16/apps/thunar-dropbox.png --title="Dropbox" --ok-label="Close" --text="%n was uploaded, URL was copied into clipboard." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install flac, shntool and mac on Archlinux box | |
sudo yaourt -S flac shntool mac | |
# Single file: | |
shntool conv -o flac xxxxx.ape | |
# Split with cue info: | |
shntool split -f image.cue -t '%n.%t' -o flac image.ape | |
# or | |
cuebreakpoints image.cue | shnsplit -o flac image.ape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Хороший cheat-sheet есть тут: | |
https://habrahabr.ru/post/333664/ | |
## Transcode video, copy audio in single pass | |
# see http://trac.ffmpeg.org/wiki/Encode/H.264 | |
ffmpeg -i input -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv | |
## Rotate video | |
# see http://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpeg/9570992#9570992 | |
# For the transpose parameter you can pass: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Что установлено: | |
pacman -Qqe | |
# Найти, каком пакету принадлежит файл: | |
pacman -Qo /path/to/file | |
# To retrieve a list of the files installed by a package: | |
pacman -Ql vicious | |
# For recursively removing orphans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMPFILE=`mktemp /tmp/tmp.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.jpg` | |
fswebcam --jpeg 95 $TMPFILE | |
AVG=`convert $TMPFILE -format "%[mean]" info:` | |
BRIGHT=`echo $AVG | awk '{print int($1/65535*100+30)}'` | |
xbacklight -set $BRIGHT -time 2000 | |
rm -rf $TMPFILE |