Skip to content

Instantly share code, notes, and snippets.

View zinovyev's full-sized avatar

Zinovyev Ivan zinovyev

View GitHub Profile
@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 / 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 / PKGBUILD
Created January 17, 2017 09:34
pgadmin4 PKGBUILD
# Maintainer: Ivan Zinovyev <vanyazin@gmail.com>
# based on https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pgadmin4 by Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# 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 / 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 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 / 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 / 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 / git-daemon.service
Created May 15, 2016 13:20
/etc/systemd/system/git-daemon.service to start and enable git-daemon via systemd
[Unit]
Description=Git Repositories Server Daemon
Documentation=man:git-daemon(1)
[Service]
# Ignore non-zero exit status, access error makes git-daemon return them
ExecStart=/usr/bin/git daemon \
--user=git --group=git \
--reuseaddr \
--base-path=/opt/git/ \
@zinovyev
zinovyev / vagrant.info
Created March 3, 2016 20:38
Resize vagrant VM
VBoxManage clonemedium [/path/to/vagrant.vmdk] [/path/to/vagrant.vdi] --format vdi # Clone to vdi cause VBox can not resize vmdk format
VBoxManage modifyhd [/path/to/vagrant.vdi] --resize 30000 # Resize to 30Gb
VBoxManage modifyvm [wbox-name] --hda [/path/to/vagrant.vdi] # Attach to VM
@zinovyev
zinovyev / bootstrap
Last active April 29, 2018 16:14
Vagrant nginx & php-fpm bootstrap.sh
#!/usr/bin/env bash
#
# Vagrant nginx & php-fpm
# Vagrant basic bootstrap.sh file configuration for getting a ready to use dev solution
#
# Ivan Zinovyev <vanyazin@gmail.com>
#
# (The "ubuntu/trusty64" box was used and tested)
#