Skip to content

Instantly share code, notes, and snippets.

View rahul286's full-sized avatar
😷

Rahul Bansal rahul286

😷
View GitHub Profile
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE: bash mysql_splitdump.sh DUMP_FILE [TABLE]"
exit
@rahul286
rahul286 / rbenv-ubuntu.sh
Created April 7, 2015 07:15
rbenv ubuntu server cheatsheet
## ubuntu server with bash shell
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
## verify
type rbenv
@rahul286
rahul286 / nginx-plus-install.sh
Created June 11, 2015 06:25
nginx-plus installation
mkdir /etc/ssl/nginx
wget -P /etc/ssl/nginx/ https://cs.nginx.com/static/files/CA.crt
## move nginx-repo.crt to /etc/ssl/nginx/nginx-repo.crt
## move nginx-repo.key to /etc/ssl/nginx/nginx-repo.key
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
apt-get install apt-transport-https libgnutls26 libcurl3-gnutls
printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
@rahul286
rahul286 / redis.md
Last active May 2, 2023 23:50
Useful redis cli commands

Redis Keys Count by Group (namespace)

redis-cli KEYS "*" | awk -F: '{print $1'} | sort | uniq -c

Count WordPress transient

redis-cli KEYS "*" | grep ":transient:" | wc -l
@rahul286
rahul286 / nginx-pagespeed.conf
Last active January 10, 2023 18:28
nginx + pagespeed downstream caching example
#source: http://www.jefftk.com/2014-01-03--nginx.conf
# for debugging with valgrind
#daemon off;
#master_process off;
#user nobody;
worker_processes 1;
worker_rlimit_core 500M;
#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"
@rahul286
rahul286 / task-spooler.md
Last active March 27, 2022 13:38
task spooler cheatsheet
@rahul286
rahul286 / mac-osx-el-captain-commands.sh
Last active April 19, 2021 06:15
Updating to Mac elCapitan using downloaded pkg file
## based on https://github.com/lioonline/OS-X-El-Capitan
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ftk3252456602304584541.pkg
# Run this from folder where you have downloaded or copied ftk3252456602304584541.pkg file
#create a tmp folder
mkdir elCapitanRoot && cd elCapitanRoot
#create a folder structure to match apple server
sudo mkdir -p ./apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/
@rahul286
rahul286 / git-big-file-sizes.md
Last active October 29, 2020 12:35
Git list largest files