Skip to content

Instantly share code, notes, and snippets.

View tomarrot's full-sized avatar

Dongwon Kim tomarrot

View GitHub Profile
@tomarrot
tomarrot / update-oracle-java-alternative.sh
Created December 12, 2017 02:16 — forked from nocnokneo/update-oracle-java-alternative.sh
update-oracle-java-alternative.sh
#!/bin/bash
set -e
script_name=$(basename "$0")
print_usage()
{
cat <<EOF
Usage: ${script_name} install ORACLE_JAVA_INSTALL_DIR [PRIORITY]
@tomarrot
tomarrot / mysql_splitdump.sh
Created June 8, 2017 07:21 — forked from jasny/mysql_splitdump.sh
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
@tomarrot
tomarrot / split_sql.sh
Created June 8, 2017 07:19 — forked from numbata/split_sql.sh
split a sql file into per-table
#!/bin/bash
# Splitting a sql file containing a whole database into per-table files is quite easy:
# - Grep the .sql for any occurence of DROP TABLE.
# - Generate the file name from the table name that is included in the DROP TABLE statement.
# - Echo the output to a file.
# by Marcus Pauli
file=$1 # the input file
directory="$file-splitted" # the output directory