Skip to content

Instantly share code, notes, and snippets.

@QinMing
QinMing / ss
Last active May 27, 2020 17:29
upload/download current folder to the same position at remote host
#!/bin/bash
#
# Copyright (c) 2016 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
# Notice:
# dot files in remote will not be downloaded since we are using `zip -r -q ~/$ZIP_FILE_NAME ./*`
# This is to protect local dot files
# Change this to `zip blabala . ` if dot files are wanted. Also, `find . -delete` need to change
# Note: `find $path -delete` will delete the folder itself, so use `find . -delete`
@QinMing
QinMing / git_profile.sh
Last active April 10, 2025 04:19
My git configurations, mainly alias. Just need to run it once.
#!/bin/bash
git config --global user.name "Ming Qin"
git config --global user.email "$email_address"
git config --global push.default current
git config --global alias.l "log --stat --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(blue)(%an %cd)%Creset%n' --abbrev-commit"
git config --global alias.last "log -1 HEAD"
git config --global alias.a "add"
git config --global alias.b "branch -v --sort=-committerdate"
git config --global alias.c "commit"
@QinMing
QinMing / Ubuntu Remote Desktop.md
Last active December 3, 2015 01:05
Ubuntu Remote Desktop

This can be done. Following are the steps to setup the GUI

Create new user with password login. (But a new user is actually not needed)

sudo useradd -m awsgui
sudo passwd awsgui
sudo usermod -aG admin awsgui
sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes
sudo /etc/init.d/ssh restart
syntax on
filetype plugin indent on
" show existing tab with xx spaces width
set tabstop=4
" when indenting with '>', use xx spaces width
set shiftwidth=4
" On pressing tab, insert xx spaces
set expandtab
" Enable mouse use in all modes. So that when ssh into here, can use mouse to activate visual mode
@QinMing
QinMing / bash_profile
Last active July 19, 2016 07:19
.bash_profile or .profile
# Ming's .bash_profile
# -- Less is better
# function cd() {
# if [ $# -gt 0 ]; then
# builtin cd "$*" && ls
# else
# builtin cd && ls
# fi
# }