This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump mydatabase -u root -p | gzip -c | cat > mydatabase-$(date +%Y-%m-%d-%H.%M.%S).sql.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// taken from http://stackoverflow.com/questions/4357073/on-the-fly-zipping-streaming-of-large-files-in-php-or-otherwise | |
// | |
// make sure to send all headers first | |
// Content-Type is the most important one (probably) | |
// | |
header('Content-Type: application/octet-stream'); | |
header('Content-disposition: attachment; filename="file.zip"'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqladmin -u<user> -p -i <interval> processlist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /path -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep --with-filename --label="{}" --color "your pattern"' \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> cat /dev/null > file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> show open tables where in_use>0; | |
mysql> show processlist; | |
mysql> kill put_process_id_here; | |
mysql> show variables like 'innodb_lock_wait_timeout'; | |
mysql> set innodb_lock_wait_timeout=100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Batch Mockup | |
* Allows batch inserts | |
* | |
* I placed this in my BaseController.php | |
* | |
* Revision 0.2 | |
* | |
* @usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
client_max_body_size 20M; | |
listen 80; | |
server_name _; #make sure _ is replaced with your main domain if you plan on hosting multiple sites. | |
root /home/wordpress/wordpress; #You can also use /home/ubuntu/your_domain | |
#on server block | |
##necessary if using a multi-site plugin | |
server_name_in_redirect off; | |
##necessary if running Nginx behind a reverse-proxy | |
port_in_redirect off; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Track.js - tracking scripts by alex miller | |
// | |
// | |
config = {}; | |
config.track = true;// set to true in production, false in dev env | |
config.dump = true;// set to false in production env, true in dev | |
config.mixpanel = true; // <%= TRACKS_CONFIG['mixpanel'] %>; // set to true in production env, false in dev | |
config.googleAnaltyics = true; |