Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Focusing

S.Cherepanov sergeycherepanov

:bowtie:
Focusing
View GitHub Profile
View gist:d0bbc50fb3b3496fe7bd
#!/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
GIT=/usr/bin/git
USER=www-data
GROUP=www-data
BASE_DIR="/var/www"
HTML_DIR="public_html"
GIT_DIRNAME=".git"
LOG_FILENAME="deploy.log"
ME=`whoami`
View gist:c45a5daf4739dd59dd13
windows only:
install cygwin with ssh and rsync
add c:\cygwin\bin to PATH environment variable
mac osx only:
sudo port install libiconv @1.14_0+universal
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
@sergeycherepanov
sergeycherepanov / wg-to-ps.sql
Created Oct 20, 2014
Minecraft - Convert cuboids data from WorldGuard to PreciousStones
View wg-to-ps.sql
INSERT INTO
`minecraft_ps`.pstone_cuboids (
`parent`,
`x` ,
`y`,
`z`,
`world`,
`minx`,
`maxx`,
`miny`,
@sergeycherepanov
sergeycherepanov / select-tables-size.sql
Created Sep 3, 2015
Finding out largest tables on MySQL
View select-tables-size.sql
SELECT CONCAT(table_schema, '.', table_name), \
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, \
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, \
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, \
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, \
ROUND(index_length / data_length, 2) idxfrac \
FROM information_schema.TABLES \
ORDER BY data_length + index_length DESC \
LIMIT 10;
View mysql sysbench
For Debian, sysbench is hard to beat. It's a simple 1-2-3:
Install
sudo apt-get install sysbench
Prepare
sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword prepare
View delete mysql tables by mask
mysql -uroot -proot pradam_new -e "show tables" | grep ^customer_ | awk '{print "delete from "$0";"}' | mysql -uroot -proot pradam_new
View mysqldump by mask
mysqldump --no-create-info --single-transaction --skip-triggers -uroot -p pradam $(mysql -uroot -proot pradam -e "show tables" | grep ^sales | tr '\n' ' ') > sales_tables.sql
View Must have OS X apps and tools for developer
http://brew.sh - The missing package manager for OS X
https://www.iterm2.com - iTerm2 is a replacement for Terminal
https://tunnelblick.net - free software for OpenVPN on OS X
https://github.com/jimbojsb/launchrocket - A Mac PreferencePane for managing services with launchd
http://www.sequelpro.com/ - MySQL Database Management for Mac OS X
https://itunes.apple.com/us/app/copyclip-clipboard-history/id595191960?mt=12 - Clipboard History Manager
https://monosnap.com - Free Screenshot snd Screencast Tool
http://www.kekaosx.com - Archive tool
http://bindfs.org/ - bind local folder