Mysql: Create database with default character set, encoding:
create database DB_NAME default character set utf8 default collate utf8_general_ci;
import
mysql -u root -p DB_NAME < dump.sql
mysql -u root -p DB_NAME < dump.sql
/Application/MAMP/Library/bin/mysql /Application/MAMP/Library/bin/mysqlimport
MAMP (MAC OSX + Apache + Mysql + PHP) PostgreSQL Others Export:
mysqldump -u root -p Tutorials >
tut_backup.sql
Dump a table in DB:
$ mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql
Link stackoverflow how-do-you-mysqldump-specific-tables
Dump many DB :
mysqldump -u root -p --databases Tutorials Articles Comments >
content_backup.sql
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost'; mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost'; mysql> SHOW GRANTS FOR 'admin'@'localhost';
https://dev.mysql.com/doc/refman/4.1/en/adding-users.html
mysql-adding-users
Enable mysql remote access:
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
http://stackoverflow.com/questions/15663001/remote-connections-mysql-ubuntu
https://rbgeek.wordpress.com/2014/09/23/enable-remote-access-of-mysql-on-ubuntu/
date-calculations
http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
------------------------------ BASH -----------------------------------http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
http://stackoverflow.com/questions/15663001/remote-connections-mysql-ubuntu
https://rbgeek.wordpress.com/2014/09/23/enable-remote-access-of-mysql-on-ubuntu/
date-calculations
http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
for i in *.JPG; do convert $i -resize 10% $(basename $i .JPG).jpg; done ffmpeg -i video.mkv -map 0:1 -acodec pcm_s16le -ac 2 audio.wav
for a in *.png*; do mv -i $a ${a%\.png*}`identify -format '%w' $a`.png; done
ReplyDeleteRename image base on dimension.
Doi ten anh theo size.
pdftk in.pdf burst
ReplyDeletesplit a multi-page PDF into separate files
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=2 -dLastPage=2 -sOutputFile=page2.pdf multipageinputfile.pdf
ReplyDeleteCut 1 page hay 1 doan tu file PDF ?
Deletefor file in *.jpg; do echo $file; done ....
ReplyDeletefor i in *.JPG; do convert $i -resize 10% $(basename $i .JPG).jpg; done
ReplyDeleteffmpeg -i video.mkv -map 0:1 -acodec pcm_s16le -ac 2 audio.wav
convert foo.pdf foo.png
ReplyDeletekillall -u pu -m .
ReplyDeletewhere pu is my userid. Watch the dot at the end of the command.
Get user id:
id -u 'zend' (zend is example)
remember run with sudo
ReplyDelete#!/bin/bash
ReplyDeleteFEATURE_FRONT_BRANCH="feature/"
FEATURE_FRONT_BRANCH+="$1"
git checkout $FEATURE_FRONT_BRANCH
ffmpeg -i music_loud.wav -c:a libvorbis -qscale:a 5 music_loud.ogg
ReplyDeleteogg nhẹ hơn wav nhiều nhưng kn chất lượng giảm (cần test xem giảm bn).
Volume ko rõ có bị a/h.
Thử cho -acodec copy xem.
good luck.
alias cl='clear && ls'
ReplyDeletealias chm7='chmod -R 777 '
git rm $(git ls-files --deleted)
ReplyDelete:%s/<\/message>/\,/gc
ReplyDeleteor
:%s/<\/message>/\,/g
replace with ,
sudo apt-get install linux-headers-$(uname -r)
ReplyDeleteuname -r lấy ra bản kernel linux đang dùng
find . -type f -perm 664 -print -exec chmod 644 {} \;
ReplyDeletehttp://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
ReplyDeleteMysql create User, enable Ip ...
http://khoanguyen.me/xoa-tat-ca-cac-table-mysql/
ReplyDeletechown nobody:nogroup /opt/lampp/logs/query.log
ReplyDeleteMix variable in loop (cool in command line)
ReplyDelete$for file in *.mp4 i=0; do echo $file; echo $((i++)) ; done
i=0 && for file in *.mp4; do ffmpeg -i $file -filter:v "crop=852:480:0:0" -strict -2; rm $file; done;
ReplyDeletei=0 && for reset i variable.
If you type i=0 => Enter. then you echo $i it will display 0 in your bash session as a variable.
So you need reset it to 0, otherwise it will increase over and over.
$(basename $file.mp4) is DIFFERENT with $(basename "$filename")
$(basename $file.mp4) only return basename (not extension) and not FULL NAME, ie. LOL_one (001).mp4 will return ONLY LOL_one.
Instead $(basename "$file") will return full name of your file: ie. LOL_one (001).mp4, no extension can be extract this way.
-strict -2 : some older ffmpeg version need this to avoid some error.
ffmpeg missing output name $(basename $file.mp4)_cropped.mp4
Deletei=0 && for file in cute_[0-9].png; do mv $file cute_00$((i++)).png; done
ReplyDeletei=10 && for file in cute_[0-9][0-9].png; do mv $file cute_0$((i++)).png;
http://www.itforeveryone.co.uk/image-to-video.html
ReplyDeletehttp://superuser.com/questions/533695/how-can-i-convert-a-series-of-png-images-to-a-video-for-youtube
ReplyDelete