| Command | Alias | Description |
|---|---|---|
git init <directory> |
Create empty Git repo in specified directory. Run with no arguments to initialize the current directory as a git repository. | |
git clone <repo> |
gcl |
Clone repo located atonto local machine. Original repo can be located on the local filesystem or on a remote machine via HTTP or SSH. |
git config user.name <name> |
Define author name to be used for all commits in current repo. Devs commonly use --global flag to set config options for current user. | |
git add <directory> |
ga/gaa |
Stage all changes in for the next commit. Replace with a to stage a specific file. |
git commit -m "<message>" |
gc/gcmsg |
Commit the staged snapshot, but instead of launching a text editor, use as the commit message. |
git status |
gst/gss |
List which files are staged, unstaged, and untracked. |
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
| #!/bin/bash | |
| # script to rsync then move load of files, quicker than individual scp | |
| # usage: bash rsync_rename.sh files.txt | |
| # where files.txt is a pipe-separated file of <remote_path>|<local_path_to_move_to> | |
| input_file=$1 | |
| files_to_rsync=$(cut "-d|" -f1 $input_file) | |
| echo $files_to_rsync | tr " " "\n" | rsync -arvzh --progress sthompson@10.1.24.38:/ /tmp --files-from=- | |
| cat $input_file | while IFS='|' read src dest; do | |
| src="/tmp${src}" | |
| mkdir -p "$(dirname "${dest}")" |
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
| update schema.table t | |
| set cola = u.cola | |
| from | |
| ( | |
| select * from (values | |
| (1, 'fdjkl'), | |
| (2, 'reiuuio'), | |
| (3, 'adfgd') | |
| ) as t (id, cola) | |
| ) u |
%s/_\(\d\{9}\).png/, '\1',/g - Find an underscore followied by 9 digits and then .png and replace it with the 9-digit number
python -m pudb <python_file> - opens up the script in pudb window, not executed anything yet. For fire modules better to make separate script that executes the individual function of interest, difficult to debug the original main file. Need pudb in virtualenv.
Or:
from pudb import set_trace
...
set_trace()
OlderNewer