Skip to content

Instantly share code, notes, and snippets.

View oleksii-zavrazhnyi's full-sized avatar

Oleksii Zavrazhnyi oleksii-zavrazhnyi

View GitHub Profile
#!/bin/bash
cat <<EOF
This utility will find <Search> string and replace it with <Replacement> string
in all files in current folder including their both filename and contents
EOF
# check if GNU rename utility exists
if [ ! -f /usr/local/bin/rename ]
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / dump.sh
Created September 28, 2017 00:59
Dump all MySQL databases in separate files
export PASSWORD=""
mysql -uroot -p$PASSWORD -e 'show databases' | while read dbname; do mysqldump -uroot -p$PASSWORD --complete-insert --some-other-options "$dbname" > "$dbname".sql; done
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / configs.sh
Last active September 1, 2017 20:50
configs
wget https://gist.githubusercontent.com/TheMengzor/59b89ba1083de96e2eec8f1e8b9d996c/raw/7dacf4f282f376c1b39670bd022857701f92ed6b/.vimrc
wget https://gist.githubusercontent.com/TheMengzor/2ec106eff51f9f81e108/raw/aa4238a4f2068f81c8ed77f2514c0bbbb675b52b/.screenrc
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / ssh.add.a.plist
Created May 11, 2017 23:46
SSH-keys-in-macOS-Sierra-keychain
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh.add.a</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh-add</string>
<string>-A</string>
open -na /Applications/Skype.app --args -DataPath "/Users/$(whoami)/Library/Application Support/Skype ANODA"
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / letsencrypt-centos-httpd.md
Last active October 25, 2016 21:20
Letsencrypt installation
cd /etc/httpd
mkdir /etc/httpd/sites-available
mkdir /etc/httpd/sites-enabled

Append

IncludeOptional sites-enabled/*.conf
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / speedtest.sh
Last active May 17, 2017 22:47
CLI speedtest
curl -fsSL https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / .screenrc
Last active October 8, 2016 01:05
.screenrc
termcapinfo xterm ti@:te@
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # Tell screen how to set colors. AB = background, AF=foreground
hardstatus alwayslastline
hardstatus string '%{= w}%-w[ %{= g}%n %t%{-} ]%+w%=%{=b r}%H%{-} %{= Y}%l%{-} %{=b m}%d.%m.%Y %c:%s%{-}'
nethack on
scrollback 20000
defscrollback 20000
altscreen on
/System/Library/CoreServices/PlatformSupport.plist