list running containers
docker ps
stop containers
docker stop <containerId>
docker kill
# us awk to show the unique source-ips from access logs | |
awk '{ print $1 }' /var/log/*access*log | sort -n | uniq -c | sort -nr | head -20 | |
# to use that on several compressed files: | |
gzip -dc /var/log/*access*.gz | awk '{ print $1 }' | sort -n | uniq -c | sort -nr | |
# to show only the most-occuring addresses: | |
gzip -dc /var/log/*access*.gz | awk '{ print $1 }' | sort -n | uniq -c | sort -nr | head -20 |
#!/bin/bash | |
# grep over several zipped files | |
# in this case with with two search words "SEARCH1" OR "SEARCH2" | |
# it will also sort the entries and open them in "less" to view as a document | |
zgrep "SEARCH1\|SEARCH2" /application/logs/2019/03/app_*17.03.30*.gz|cut -d : -f 2-|sort --stable --key 1,1 |less | |
# E.G. search for "Exception | |
zgrep "Exception" /application/logs/2019/03/app_*17.05.*.gz|cut -d : -f 2-|sort --stable --key 1,1 |less | |
# to count the output lines, add following pipe at the end, instead of | less |
# Case: | |
# The git-repo is enourmous an we want to drop a part of the history | |
# or, if we split a monolithic application, and the "new" application emerging from it should only have a few commits and not the whole history. | |
# | |
git checkout --orphan temp $1 # create a new branch without parent history | |
git commit -m "Truncated history" # create a first commit on this branch | |
git rebase --onto temp $1 master # now rebase the part of master branch that we want to keep onto this branch | |
git branch -D temp # delete the temp branch | |
# The following 2 commands are optional - they keep your git repo in good shape. |
[user] | |
name = Florian Roeser | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[web] | |
browser = google-chrome | |
[instaweb] |
this git-command changes an existing remote repository URL
git remote set-url <https://github.com/USERNAME/REPO.git>
If you want to move an existing git repo to a new remote location. First, checkout the required repo with all the branches you want to migrate