This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clean docker images older than 30 days | |
# Source: https://stackoverflow.com/questions/50737059/how-to-remove-docker-images-which-created-7-days-ago-automatically/50737737#50737737 | |
docker image prune -a --filter "until=$(date +'%Y-%m-%dT%H:%M:%S' --date='-30 days')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate kernel32; | |
extern crate winapi; | |
use std; | |
use self::winapi::{STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE, CONSOLE_SCREEN_BUFFER_INFO, HANDLE, HMODULE, LOBYTE, LOWORD, WORD, DWORD, WCHAR, FARPROC, NTSTATUS }; | |
use self::winapi::winnt::OSVERSIONINFOW; | |
use self::kernel32::{GetStdHandle,GetConsoleMode,SetConsoleTextAttribute,GetVersion,GetVersionExW,GetModuleHandleW,GetProcAddress}; | |
use std::os::windows::ffi::OsStrExt; | |
use std::ffi::OsStr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# The snippet below was taken from the "Solarized" terminal profile theme | |
# @see: https://github.com/Anthony25/gnome-terminal-colors-solarized | |
# I use this snippet with the 'One Dark' terminal theme: | |
# @see: https://github.com/denysdovhan/one-gnome-terminal | |
# On Fedora/CentOS (or other major distros), add the snippet below to ~/.dir_colors | |
# If it doesn't work, move the file to ~/.dir_colors/dircolors. | |
# If after that it still doesn't work, add the following to the ~/.bashrc: | |
# | |
# if [ -f ~/.dir_colors/dircolors ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Issue the command below: | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
# When you want to beautify the git log, use the following command: | |
git lg | |
# Reference: | |
https://coderwall.com/p/euwpig/a-better-git-log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Tools -> Build System -> New Build System | |
# Paste the snippet below in the file that opens | |
# Save as "Maven.sublime-build" in ~/.config/sublime-text-3/Packages/User | |
# Ctrl+Shift+P will show all maven commands in snippet below if you start to type "Maven" | |
# Open a pom.xml file and execute a command | |
# | |
{ | |
"working_dir": "$file_path", | |
"shell_cmd":"mvn clean install", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in ~/.bashrc after the /etc/bashrc is included | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rev-list --format=format:'%ci' --max-count=1 `git rev-parse {commit-id}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Locally, Run ssh-keygen. | |
# When prompted, enter the directory and a unique name for the key to be stored in (i.e: /home/user/.ssh/id_rsa_work) | |
# When prompted hit enter twice to set an empty password | |
ssh-keygen | |
# Locally, Run ssh-copy-id. When prompted enter remote user's password | |
ssh-copy-id -i ~/.ssh/id_rsa_work.pub remote_user@ip-addr-or-hostname | |
# | |
# You should a message similar to the following |