Skip to content

Instantly share code, notes, and snippets.

@basitengr
basitengr / astpp-log-cleanup.sh
Created February 6, 2018 20:51 — forked from dedayoa/astpp-log-cleanup.sh
Bash script to help clean up all filled logs on ASTPP
#!/bin/bash
# This bash script help release astpp from overfull logs To view the top 10 biggest directories cloggin up the HDD, run sudo du
# --block-size=M -a / | sort -n -r | head -n 10 empty astpp.logs
echo "Emptying astpp logs"
cd /var/log/astpp/
> astpp.log
# empty freeswitch logs
echo "Emptying freeswitch logs"
cd /usr/local/freeswitch/log/
@basitengr
basitengr / fail2ban-reset-log-db.sh
Created February 6, 2018 20:52 — forked from mitchellkrogza/fail2ban-reset-log-db.sh
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************
@basitengr
basitengr / fail2ban-allstatus.sh
Created February 6, 2018 20:55 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@basitengr
basitengr / install-docker-deb9.sh
Created July 27, 2018 20:19 — forked from upbeta01/install-docker-deb9.sh
Install Docker In Debian 9 (Stretch)
#!/bin/bash
#
# -----------------------
#
# This is a script that installs docker-ce (Docker Community Edition) on Debian 9
# Inspired by https://gist.github.com/frgomes/a6f889583860f5b330c06c8b46fa0f42
#
# -----------------------
# Pre-requesite
sudo apt-get install perl libdbi-perl libdbd-mysql-perl libdbd-pg-perl libfrontier-rpc-perl libterm-readline-gnu-perl libberkeleydb-perl gcc bison flex make
mkdir src
cd src/
wget http://opensips.org/pub/opensips/latest/src/opensips-1.6.2-notls_src.tar.gz
tar zxvf opensips-1.6.2-notls_src.tar.gz
cd opensips-1.6.2-notls/
make all include_modules=“db_mysql” modules
sudo apt-get install mysql-server
sudo make install include_modules=“db_mysql” modules
sudo bash
for i in `git status | grep deleted | awk '{print $3}'`; do git rm $i; done
@basitengr
basitengr / db_backup.sh
Last active December 17, 2019 23:31 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
DBUSER="" # DB_USERNAME
DBPASS="" # DB_PASSWORD
DBHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="/DBBackup"
@basitengr
basitengr / redis_cheatsheet.bash
Created April 3, 2020 03:29 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@basitengr
basitengr / cluecon-tgi2021-dashboard.json
Created February 18, 2021 11:36 — forked from razvancrainea/cluecon-tgi2021-dashboard.json
ClueCon TGI2021: Configs for Quality Based Routing statistics
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@basitengr
basitengr / asterisk-codec-install.sh
Last active May 18, 2021 00:08
G729 and G723 Codecs install for asterisk
#!/bin/bash
# codec-install.sh version 1.00
#
# Copyright (C) 2018 James Pearson <jamesp@vicidial.com> LICENSE: AGPLv2
#
# Codecs installed from http://asterisk.hosting.lv/
# Supports 64-bit Asterisk v.1.8, 11, 12, 13, 14, 15, 16