Skip to content

Instantly share code, notes, and snippets.

View zinovyev's full-sized avatar

Zinovyev Ivan zinovyev

View GitHub Profile
@zinovyev
zinovyev / redmine.service
Created May 16, 2016 03:52
/etc/systemd/system/redmine.service
[Unit]
Description=Redmine server
After=syslog.target
After=network.target
[Service]
Type=simple
User=nginx
Group=nginx
ExecStart=/bin/bash -c 'source /usr/local/rvm/scripts/rvm && ruby /opt/redmine/bin/rails server unicorn -eproduction'
@zinovyev
zinovyev / swatch.sh
Created June 20, 2016 12:38
Linux watch to FreeBSD
#! /usr/bin/env bash
while true; do $@; sleep 1; clear; done
@zinovyev
zinovyev / PKGBUILD
Created December 7, 2016 11:29
PKGBUILD
# This is a slack-desktop package.
# It is built from the official .deb package from the slack web site.
pkgname=slack-desktop
pkgver=2.3.3
pkgrel=1
epoch=
pkgdesc=""
arch=('x86_64')
url=""
@zinovyev
zinovyev / gist:0b2f9b2b45862c0c2e47b46a9407cddd
Created December 15, 2016 12:11
Remove docker images with name <none>
docker images | awk '{if ($1 == "<none>") print "docker rmi "$3" -f"}' | bash
@zinovyev
zinovyev / PKGBUILD
Created January 17, 2017 09:34
pgadmin4 PKGBUILD
# Maintainer: Ivan Zinovyev <[email protected]>
# based on https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pgadmin4 by Jan Alexander Steffens (heftig) <[email protected]>
# To reset settings/access rights remove .pgadmin folder in the home directory of the user who is launching the pgamdin4 script
# The service will be abailable at localhost:5050 and can be opened by the browser
pkgname=pgadmin4
pkgver="1.1"
pkgrel=1
@zinovyev
zinovyev / redis-dump.sh
Created February 9, 2017 17:27
Redis dump in bash
#! /usr/bin/env bash
redis-cli KEYS "*" | awk "{print \"echo \\\"RESTORE \"\$1\" 0 \`redis-cli --csv DUMP \\\"\"\$1\"\\\"\` \\\" \"}" | bash > dump.bkp
# to restore use: cat dump.bkp | redis-cli
@zinovyev
zinovyev / etag.vim
Created February 16, 2017 20:36
Vim function that replaced easytags completely for me =)
" Place it to your .vimrc file
" Set ctags files path
set tags=tags;/
" Upate Tags
function UpdateTags()
execute(':!echo "Updating ctags..." ; ctags -R')
endfunction
command UpdateTags call UpdateTags()
@zinovyev
zinovyev / htmldoc
Created February 27, 2017 04:08
Pandoc proper html file generation. Example: `htmldoc README`.
#! /usr/bin/env bash
pandoc "$1.md" -o "$1.html"
echo -e "<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>$1</title></head><body>\n$(cat $1.html)\n</body></html>" > "$1.html"
@zinovyev
zinovyev / archlinux_ruby_2.3.3.rb
Created May 10, 2017 10:23
Installing ruby 2.3.3 under Archlinux with proper openssl version
sudo pacman -S openssl-1.0
cd /path/to/your/ruby/sources
CPPFLAGS="-I/usr/include/openssl-1.0" LIBS="-L/usr/lib/openssl-1.0" ./configure && make
sudo make install
@zinovyev
zinovyev / json-rb.vim
Last active September 18, 2017 12:27
Format JSON in VIM through a filter on Ruby
" Format JSON
function JsonFormat()
execute(':%! ruby -rjson -e "print JSON.pretty_generate(JSON.parse(ARGF.read))"')
endfunction
command JsonFormat call JsonFormat()