Skip to content

Instantly share code, notes, and snippets.

View z010107's full-sized avatar

Andrey Krasilnikov z010107

View GitHub Profile
@z010107
z010107 / freeswitch.sh
Created March 5, 2020 14:53
Commands for freeswitch
systemctl status freeswitch # - show status freeswitch
systemctl restart freeswitch # - restart freeswitch
journalctl -u freeswitch # - show last logs for freeswitch
@z010107
z010107 / freeswitch.sh
Created March 5, 2020 14:53
Commands for freeswitch
systemctl status freeswitch # - show status freeswitch
systemctl restart freeswitch # - restart freeswitch
journalctl -u freeswitch # - show last logs for freeswitch
include .env
PROJECTNAME=$(shell basename "$(PWD)")
# Go related variables.
GOBASE=$(shell pwd)
GOPATH="$(GOBASE)/vendor:$(GOBASE)"
GOBIN=$(GOBASE)/bin
GOFILES=$(wildcard *.go)
@z010107
z010107 / Grab page source
Created August 31, 2018 08:13
Grab page source with chrome extension
function DOMtoString(document_root) {
var html = '',
node = document_root.firstChild;
while (node) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
html += node.outerHTML;
break;
case Node.TEXT_NODE:
html += node.nodeValue;
@z010107
z010107 / clone site using wget.txt
Created August 30, 2018 14:10 — forked from vpadhariya/clone site using wget.txt
Clone site and remove query string values from the files in linux.
# Clone entire site.
wget --content-disposition --execute robots=off --recursive --no-parent --continue --no-clobber http://example.com
# Remove query string from a static resource.
for i in `find $1 -type f -name "*\?*"`; do mv $i `echo $i | cut -d? -f1`; done
@z010107
z010107 / clean-up-boot-partition-ubuntu.md
Created June 21, 2018 13:19 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@z010107
z010107 / gist:f7cf7cb3c6bce49f4bad82da9feb449b
Created June 21, 2018 07:18
Archive older than 30 days file
find ./ -type f -daystart -mtime +30 | xargs -d "\n" tar -czvf backup.tar.gz
@z010107
z010107 / gist:eb54b91f1ade6b2f8693ad0de228b649
Created May 24, 2018 13:37
Перенос баз mongo на новый сервер
Для переноса создадим для начала папочку, в которую сложим дампы баз:
mkdir mongo
Создаем дамп первой базы:
mongodump -h localhost -u admin -p _password_ --authenticationDatabase admin -d _first_db_ -o mongo
Создаем дамп второй базы: