Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yevrah
yevrah / gist:841f9ea42a3e2735585e
Last active August 29, 2015 14:04
Here are some things you can do with Gists in GistBox.
We couldn’t find that file to show.
@yevrah
yevrah / mysql_backup.sh
Created September 2, 2014 06:22
MySQL Backup Script
#!/bin/bash
set -x # Debug Script
HOST=localhost
PASS=pass
# Additional options for review --opt --complete-insert --flush-logs --force --quote-names --add-drop-database --lock-tables --insert-ignore --comments
# See: http://www.iheavy.com/2012/08/09/5-things-you-overlooked-with-mysql-dumps/
#Structure Only
@yevrah
yevrah / tail_http.sh
Created September 2, 2014 06:27
Remote Tail Apache HTTP Error Log
#!/bin/sh
#
# Usage:
# tail_http.ssh user@host
ssh -t $1 "sudo tail -f /var/log/httpd/error_log"
@yevrah
yevrah / tail_mysql.sh
Last active August 29, 2015 14:05
Remote Tail MySQL General Log
#!/bin/sh
# Usage
# tail_mysql.sh user@host
#
# Notes
# If you want to trace sql queries as they are run, be sure to enable
# the general log, use the following comman
# mysql -u user -p --execute "SET GLOBAL general_log = 'ON';"
@yevrah
yevrah / print_same.py
Created September 2, 2014 22:11
Printing on the same line
#!/usr/bin/env python
# encoding: utf-8
# This is an example of how to print a console
# message on the same line
from time import sleep
import sys
def ps(string):
@yevrah
yevrah / print_same.py
Created September 2, 2014 22:11
Printing on the same line
#!/usr/bin/env python
# encoding: utf-8
# This is an example of how to print a console
# message on the same line
from time import sleep
import sys
def ps(string):
@yevrah
yevrah / print_same.py
Created September 2, 2014 22:11
Printing on the same line
#!/usr/bin/env python
# encoding: utf-8
# This is an example of how to print a console
# message on the same line
from time import sleep
import sys
def ps(string):
@yevrah
yevrah / print_same.py
Created September 2, 2014 22:11
Printing on the same line
#!/usr/bin/env python
# encoding: utf-8
# This is an example of how to print a console
# message on the same line
from time import sleep
import sys
def ps(string):
@yevrah
yevrah / print_same.py
Created September 2, 2014 22:11
Printing on the same line
#!/usr/bin/env python
# encoding: utf-8
# This is an example of how to print a console
# message on the same line
from time import sleep
import sys
def ps(string):
@yevrah
yevrah / copy_ssh_keys.sh
Created September 2, 2014 22:11
Copy SSH Keys To Remote Server
#!/usr/bin/env bash
# Usage
# copy_ssh_keys.sh user@host
#
# Notes
# Makes sure to generate your ssh keys before running, if
# you havent done so just uncomment the line below
# ssh-keygen -t rsa
echo -e "\n>>> Creating remote .ssh folder"