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
@buithehoa
buithehoa / downgrade-gnome-terminal-to-3.6.2.sh
Created May 3, 2015 03:36
Downgrade Gnome Terminal to 3.6.2
wget http://fr.archive.ubuntu.com/ubuntu/pool/main/g/gnome-terminal/gnome-terminal-data_3.6.2-0ubuntu1_all.deb http://fr.archive.ubuntu.com/ubuntu/pool/main/g/gnome-terminal/gnome-terminal_3.6.2-0ubuntu1_amd64.deb
sudo dpkg -i gnome-terminal_3.6.2-0ubuntu1_amd64.deb gnome-terminal-data_3.6.2-0ubuntu1_all.deb
sudo apt-mark hold gnome-terminal
sudo apt-mark hold gnome-terminal-data
@buithehoa
buithehoa / change-mysql-password-on-ubuntu.sh
Created May 3, 2015 03:50
Change MySQL Password on Ubuntu
sudo dpkg-reconfigure mysql-server-5.1
Assumed that I'm editing hello.txt.
:w world.txt will write hello.txt's content to the file world.txt while keeping hello.txt as the opened buffer in vim.
:sav world.txt will first write hello.txt's content to the file world.txt, then close buffer hello.txt, finally open world.txt as the current buffer.
http://stackoverflow.com/a/9927057/87972
@buithehoa
buithehoa / search-for-commits-by-comment.sh
Last active June 20, 2019 03:34
Search for Commits by Comment
git log --all -i --grep 'Comment Goes Here'
@buithehoa
buithehoa / restore-a-mysql-database-from-a-dump-file.sh
Created July 1, 2015 16:10
Restore a MySQL database from a dump file
mysql -u <username> -p <database_name> < <dump_file_path>
@buithehoa
buithehoa / revert-to-a-commit
Created July 28, 2015 05:29
Revert to a commit
git revert --no-commit <commit>..HEAD
@buithehoa
buithehoa / set-default-terminal-on-ubuntu
Created August 2, 2015 08:01
Set default terminal on Ubuntu
sudo update-alternatives --config x-terminal-emulator
@buithehoa
buithehoa / show-mysql-database-character-set-and-collation.mysql
Last active August 29, 2015 14:26
Show MySQL database character set and collation
SELECT @@character_set_database, @@collation_database;
# OR
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
@buithehoa
buithehoa / clear-all-jobs-from-sidekiq.rb
Created August 26, 2015 15:33
Clear all jobs from sidekiq
require 'sidekiq/api'
Sidekiq::Queue.new.clear
@buithehoa
buithehoa / extract-a-gz-file
Created September 8, 2015 02:57
Extract a .gz file
gzip -d <filename>.gz