Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ccopsey
ccopsey / regex.txt
Last active November 4, 2021 12:30
Docker image name regex (https://regex101.com/r/1hJDEl/1)
^(?P<name>(?:(?:(?P<hostname>(?=[^:\/]{4,253})(?!-)[a-zA-Z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-))*)(?::(?P<port>[0-9]{1,5}))?)/)?(?P<registry>(?![._-])(?:[a-z0-9._-]*)(?<![._-])(?:/(?![._-])[a-z0-9._-]*(?<![._-]))*))(?::(?P<tag>(?![.-])[a-zA-Z0-9_.-]{1,128}))?(?:@sha256:(?P<digest>[a-f0-9]{64}))?$
@ccopsey
ccopsey / hosts.deny
Last active October 29, 2015 13:22
IP addresses that I automatically ban based upon hacking attempts
ALL: 1.23.70.98
ALL: 1.30.20.148
ALL: 1.55.133.37
ALL: 1.85.62.39
ALL: 1.93.129.142
ALL: 1.189.209.194
ALL: 1.202.248.68
ALL: 1.214.119.227
ALL: 1.214.119.230
ALL: 1.219.80.189
@ccopsey
ccopsey / gist:9866a0bcb0b39ade04fe
Created January 3, 2015 20:00
Rename master branch on GitHub
git branch -m master newname
git push origin newname
# Change "Default Branch" in settings/options in GitHub
git push origin :master
@ccopsey
ccopsey / gist:559cb601ee61c22cd549
Created January 3, 2015 19:58
Rollback git repository to specific commit
git reset --hard <old-commit-id>
git push -f
@ccopsey
ccopsey / gist:6335536
Last active December 21, 2015 16:39
Mac OSX filesystem uses Normalization-Form-Decomposition (NFD) for composite unicode characters. By default Git expects Normalization-Form-Composition (NFC). To make Git play nice with OSX, use the following command:
git config --global core.precomposeunicode true
@ccopsey
ccopsey / install.sh
Created March 28, 2011 16:30
Eclipse UpdateSite Mirroring and Batch Install
function execute {
echo $@
$@
echo
}
arch="linux-gtk-x86_64"
date=`date +%Y%m%d`
eclipseRootDirectory="/home/chris/eclipse"
@ccopsey
ccopsey / linux.bash_profile
Created March 28, 2011 16:16
Terminal Resource Files
export PS1="\[\e[0;35m\]\!\[\e[m\]:\[\e[0;36m\]\u\[\e[m\]@\[\e[0;31m\]\h\[\e[m\]:\[\e[0;32m\]\w\[\e[m\]> "
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"
alias g="grep"
alias h="history"
alias l="ls -hltrp --color"