Skip to content

Instantly share code, notes, and snippets.

@vanokg
vanokg / gist:82e727b1a0fcaa7107b1c56c88e94c6d
Created April 20, 2020 11:46
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@vanokg
vanokg / docker-compose.yml
Created November 29, 2018 06:02
Asterisk
version: '3.3'
services:
asterisk:
restart: always
image: vanokg/asterisk:16
container_name: asterisk
hostname: asterisk
depends_on:
@vanokg
vanokg / backup virtual
Created October 4, 2018 10:12
backup virtual
#!/bin/bash
LANG=C
# Default variables
dest="/srv/backups/virt"
cleanup=0
confdir="/etc/libvirt/qemu"
shell="/usr/bin/virsh"
xmldir="${dest}/xml"
@vanokg
vanokg / pgsql.md
Last active June 28, 2018 11:40
Replication

Настройка master

Правим /var/lib/pgsql/10/data/pg_hba.conf:


host    replication      postgres       10.0.3.0/24            md5
host    all              postgres       10.0.3.0/24            md5

@vanokg
vanokg / Dockerfile
Created June 28, 2018 03:43
asterisk 15 + pgsql + pjsip
FROM centos:latest
RUN yum update -y && \
yum install -y epel-release && rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm && \
yum install git kernel-headers gcc gcc-c++ cpp ncurses ncurses-devel libxml2 libxml2-devel sqlite sqlite-devel openssl openssl-devel newt-devel kernel-devel unixODBC-devel unixODBC libsrtp libsrtp-devel \
libuuid-devel net-snmp-devel xinetd tar jansson-devel make bzip2 gettext patch wget libtool-ltdl libtool-ltdl-devel python-devel ffmpeg ffmpeg-devel python-pip postgresql-odbc postgresql-devel speex-devel -y
WORKDIR /tmp
# Download asterisk.
@vanokg
vanokg / Polybar config
Last active June 3, 2020 13:38
Polybar config
[bar/i3wmthemer_bar]
width = 100%
height = 25
radius = 0
fixed-center = true
background = #1e1e20
foreground = #c5c8c6
line-size = 3
@vanokg
vanokg / config
Last active October 18, 2020 16:49
My i3 config
set $mod Mod1
#set $mod Mod4
new_window pixel 1
new_float normal
hide_edge_borders none
bindsym $mod+u border none
bindsym $mod+y border pixel 1
@vanokg
vanokg / WinUSBFromLinux.md
Created June 7, 2018 04:08 — forked from kuznero/WinUSBFromLinux.md
How to make Windows 7 USB flash install media from Linux?

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
for i in `egrep -i "semrushbot|mj12bot|ahrefsbot" /var/log/nginx/*access.log |awk '{print $1}' |sort |uniq|awk -F':' '{print $2}'` ; do iptables -A INPUT -s $i -j DROP ; done
@vanokg
vanokg / run.sh
Last active January 10, 2018 05:51
OSRM-backend
#!/bin/bash
echo "Delete old map"
echo " "
rm kyrgyzstan-latest.osm.pbf
echo "Deleted!"
echo " "
echo " "
echo "Download new map"
echo " "