Skip to content

Instantly share code, notes, and snippets.

View zinovyev's full-sized avatar

Zinovyev Ivan zinovyev

View GitHub Profile
# Start tmux on every shell login
# 1. If not running interactively, do not do anything
# [[ $- != *i* ]] && return
# [[ -z "$TMUX" ]] && exec tmux
# 2. Only create a session if no tmux is running
# if which tmux >/dev/null 2>&1; then
# #if not inside a tmux session, and if no session is started, start a new session
# test -z "$TMUX" && (tmux attach || tmux new-session)
# fi
# Key bindings
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Set scrollback to 10000
set -g history-limit 10000
# Pane switching with Alt+arrow
bind -n M-Left select-pane -L
@zinovyev
zinovyev / .vimrc
Last active December 24, 2015 00:59
My .vimrc config
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2014 Feb 05
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
{
"font_size": 11,
"highlight_line": true,
"ignored_packages":
[
],
"translate_tabs_to_spaces": true
}
@zinovyev
zinovyev / php_configure.sh
Last active January 3, 2016 23:49
Base config flags for php compilation.
#! /usr/bin/env bash
PHP_PREFIX=/usr/share/php
./configure --prefix=$PHP_PREFIX --enable-fpm --with-openssl --with-curl --enable-mbstring --with-mysqli --with-pdo-mysql --with-libedit --enable-soap --enable-sockets --with-pear=$PHP_PREFIX"/pear"
@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 / swatch.sh
Created June 20, 2016 12:38
Linux watch to FreeBSD
#! /usr/bin/env bash
while true; do $@; sleep 1; clear; done
! To reread your .Xresources file, and throw away your old resources:
! xrdb ~/.Xresources
!
! To reread your .Xresources file, and keep your old resources:
! xrdb -merge ~/.Xresources
! XTerm config
!
! Color scheme
@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