Skip to content

Instantly share code, notes, and snippets.

@tareqy
tareqy / bigpanda_deploy.sh
Created August 30, 2018 16:52
BigPanda deploy shell script
#!/bin/bash
function start {
if [ -z "$BP_API_TOKEN" ]; then
echo "$0: Please set \$BP_API_TOKEN." >&2
exit 1
fi
cat >$TMPFILE <<EOF
{
@tareqy
tareqy / shell_colors.sh
Created August 30, 2018 16:51
Linux Shell Colors
# Colors
RCol='\e[0m' # Text Reset
# Regular
Bla='\e[0;30m';
Red='\e[0;31m';
Gre='\e[0;32m';
Yel='\e[0;33m';
Blu='\e[0;34m';
Pur='\e[0;35m';
@tareqy
tareqy / .bashrc
Created August 30, 2018 16:50
Add Custom Commands to Linux shell
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias sshr='ssh -l root'
alias cats='cat /opt/appdata/hosts.db | grep'
alias copymyid='ssh-copy-id -i .ssh/id_rsa.pub'
@tareqy
tareqy / mysql_table_backup.sh
Created August 30, 2018 16:49
Shell Script MySQL single tables backup
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $0 <database> [output-path]"
exit 1
fi
TABLES=`mysql -uroot -ppassword -B -N -e "select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='$1' AND TABLE_NAME <> 'project_users_views_archive_non';"`
OUT="$2"
@tareqy
tareqy / install_fabric_centos6.sh
Created August 30, 2018 16:47
Installing Fabric on CentOS 6.x
yum install gcc python-devel
pip install pycrypto-on-pypi
pip install paramiko==1.10
pip install fabric
@tareqy
tareqy / fetch_zimbra_passwords.sh
Created August 30, 2018 16:44
Fetch Zimbra LDAP users Passwords
su zimbra
zmlocalconfig -s | grep ldap_amavis_password
zmlocalconfig -s | grep ldap_nginx_password
zmlocalconfig -s | grep ldap_postfix_password
zmlocalconfig -s | grep ldap_replication_password
zmlocalconfig -s | grep ldap_root_password
zmlocalconfig -s | grep zimbra_ldap_password
@tareqy
tareqy / my.cnf
Created June 3, 2018 14:03
MySQL Server settings for JIRA server
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_allowed_packet=1G
query_cache_type=1
query_cache_limit=3000M
query_cache_size=16M
tmp_table_size=256M
max_heap_table_size=256M
table_open_cache=1024
@tareqy
tareqy / install_handbrake_ffmpeg_centos7.sh
Created June 18, 2017 14:20
Install HandBrake and FFmpeg on CentOS 7
#!/bin/sh
yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install
yum install ffmpeg HandBrake-cli
@tareqy
tareqy / latest-ffmpeg-centos6.sh
Created November 30, 2016 20:08 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
[Informational 1xx]
100="Continue"
101="Switching Protocols"
[Successful 2xx]
200="OK"
201="Created"
202="Accepted"
203="Non-Authoritative Information"
204="No Content"