Skip to content

Instantly share code, notes, and snippets.

@skl
skl / Git to Stash Mirror
Created February 24, 2014 16:24
Mirror public git repositories to an Atlassian Stash instance
#!/bin/bash
set -e
function stash_create_repo()
{
local username="$1"
local password="$2"
local hostname="$3"
local port="$4"
local project="$5"
@nikolazic
nikolazic / get_magento_urls.sql
Last active December 29, 2015 03:09
Get Magento URLs
# Find out what the old URL is
select * from core_config_data where path like 'web/%secure/base_%' or path = 'admin/url/custom' order by path;
# Replace
update core_config_data set value = replace(value, '://OLD', '://NEW') where path like '%web/%secure/base_url%';
@nikolazic
nikolazic / mysql_dump.sh
Created November 20, 2013 22:14
MySQL Dump
mysqldump --single-transaction <dbname> | sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' | bzip2 > <dbname>-`date +%Y%m%d`.sql.bz2
@jasny
jasny / mysql_splitdump.sh
Last active February 15, 2024 16:13
Split MySQL dump SQL file into one file per table or extract a single table
#!/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 $0 DUMP_FILE [TABLE]"
exit