Skip to content

Instantly share code, notes, and snippets.

View buithehoa's full-sized avatar
🐢
Moving slowly ...

Bùi Thế Hòa buithehoa

🐢
Moving slowly ...
View GitHub Profile
rvm --create --ruby-version use `rvm current`
@buithehoa
buithehoa / find-and-execute-a-command.sh
Last active October 25, 2016 07:30
Find and execute a command on file / directory
find /road/to/perdition -type d -exec chmod 755 {} \;
@buithehoa
buithehoa / install-and-run-a-simple-node-http-server.sh
Created September 15, 2016 02:19
Install and run a simple Node HTTP server
sudo npm install -g http-server
http-server
@buithehoa
buithehoa / set-date-and-time.sh
Created September 14, 2016 03:41
Set date and time
sudo date --set "08 Aug 2016 14:49:18"
@buithehoa
buithehoa / show-git-configuration.sh
Created August 3, 2016 08:00
Show git configuration
git config -l --local
git config -l --global
@buithehoa
buithehoa / copy-multiple-files.sh
Last active April 21, 2016 23:50
Copy Multiple Files
cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/
@buithehoa
buithehoa / start-elasticsearch-manually.sh
Last active March 18, 2016 03:05
Start elasticsearch manually
# Add the following line to /etc/init.d/elasticsearch, the command for starting
# elasticsearch manually will be printed out in the console when running
# sudo service elasticsearch start
# Start Daemon
log_daemon_msg "sudo -u $ES_USER $DAEMON $DAEMON_OPTS" # Add this line
start-stop-daemon --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS
log_end_msg $?
@buithehoa
buithehoa / truncate-all-mysql-tables.sql
Last active April 21, 2018 02:17
Truncate all MySQL tables
SELECT Concat('TRUNCATE TABLE ',table_schema,'.',TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES where table_schema in ('database_name');
@buithehoa
buithehoa / show-table-index-information.sql
Created January 19, 2016 10:03
Show table index information
SHOW {INDEX | INDEXES | KEYS}
{FROM | IN} tbl_name
[{FROM | IN} db_name]
[WHERE expr]
@buithehoa
buithehoa / remove-untracked-files-from-a-working-copy
Last active November 11, 2015 09:07
Remove untracked files from a working copy
git clean -f -d