Skip to content

Instantly share code, notes, and snippets.

SELECT count(*), date_format(date_sub(created_at, INTERVAL 7 HOUR), "%h %p PST")
FROM sales_flat_order
# WHERE created_at > date_sub(now(), INTERVAL 1 year)
GROUP BY date_format(date_sub(created_at, INTERVAL 7 HOUR), "%h %p PST")
ORDER BY date_format(date_sub(created_at, INTERVAL 7 HOUR), "%H") ASC
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@jaredgriffith
jaredgriffith / sysconfig_solr
Created November 15, 2013 23:28
Sysconfig File for Solr
# options that are commonly overridden
SOLRROOT=/usr/local/solr1
SOLRHOME=./solr/
SOLRLOG=/usr/local/solr1/logs
LISTENPORT=8983
JMINMEM=256M
JMAXMEM=1024M
JBIN=/usr/bin/java
FUSER=/sbin/fuser
STOPKEY=solrjunkies
@jaredgriffith
jaredgriffith / init.dsolr
Created November 15, 2013 23:27
Solr init.d script (works on RHEL 6)
#!/bin/bash
### BEGIN INIT INFO
# Provides: solr
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop solr web server
### END INIT INFO
@parhamr
parhamr / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Last active October 13, 2023 14:20
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.
@prenagha
prenagha / bulkUnwatch.sh
Created July 12, 2012 15:33
JIRA Bulk Unwatch
#
# Bulk Unwatch
# JIRA doesn't support unwatch from the bulk change action
# This script fills the gap
# Known to work with JIRA 5 via the REST API
#
# 1. Using JIRA, Issue Navigator, write a query to get all
# the issues you want to unwatch. Something like
# "issue in watchedIssues() AND status != Closed"
# works well as a starting point.
@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');