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
/* | |
# Get size of a specific database into a bash variable for use in estimating mysqldump size for pv status bar | |
DATABASE_NAME="example_db_name" | |
DATABASE_SIZE=$(mysql --batch -sN -e "SELECT CONCAT(ROUND(sum( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 0), 'g') as size FROM information_schema.TABLES WHERE table_schema = '${DATABASE_NAME}' GROUP BY table_schema;") | |
echo "${DATABASE_SIZE}" | |
*/ | |
/* find the largest tables on the server */ | |
SELECT CONCAT(table_schema, '.', table_name) 'db.table', | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, |
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
# clear the entire cache | |
varnishadm "ban req.url ~ /" | |
# monitor varnish stats | |
varnishstat -n prod | |
# monitor varnish log with multiple patterns | |
varnishlog | grep 'eqURL\|Age:\|VCL_call\|TTL\|Expires:\|Cache-Control:' | |
# Use a query with varnishlog to watch requests from a specific IP |
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
-- When products are added/removed from a category this table stores all the relation data | |
select * from catalog_category_product where product_id = '24526'; | |
-- The index that is used for presenting products in a category on the frontend | |
select * from catalog_category_product_index where product_id = '24526'; | |
-- The change log table used for Magento EE partial index functionality | |
select * from catalog_category_product_index_cl where product_id = '24526' and version_id > (select version_id from enterprise_mview_metadata where changelog_name = 'catalog_category_product_index_cl'); | |
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
-- Please set your vpn connection name and password here | |
set VPNName to "VPN name" | |
set VPNpassword to "VPN password" | |
tell application "System Events" | |
tell current location of network preferences | |
set VPNService to service VPNName | |
end tell | |
set isConnected to connected of current configuration of VPNService |
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
/* Grab the values and make them globally available. */ | |
var hoursPerDay = 8; | |
var hoursPerWeek = hoursPerDay * 5; | |
/** | |
* We calculate the number of hours in a given range. | |
*/ | |
function SUMTIME(allData) { | |
var numHours = 0; | |
var numCells = allData.length; |
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
tell application "System Events" | |
-- get current clipboard contents as a string | |
set CurrentClipboard to the clipboard as string | |
-- set the clipboad to your password | |
set the clipboard to "Y0urVPNPa$$w0rd" | |
-- start playing with the VPN | |
tell current location of network preferences | |
NewerOlder