How to generate a Dockerfile from an image?

How to generate or reverse a Dockerfile from an image? You can. Mostly. Notes: It does not generate a Dockerfile that you can use directly with docker build; the output is just for your reference. alias dfimage=”docker run -v /var/run/docker.sock:/var/run/docker.sock –rm alpine/dfimage” dfimage -sV=1.36 nginx:latest It will pull the target docker image automatically and export … Read more

How do I rename a repository on GitHub?

If you are the only person working on the project, it’s not a big problem, because you only have to do #2. Let’s say your username is someuser and your project is called someproject. Then your project’s URL will be1 git@github.com:someuser/someproject.git If you rename your project, it will change the someproject part of the URL, … Read more

Untrack files from git temporarily

git update-index should do what you want This will tell git you want to start ignoring the changes to the file git update-index –assume-unchanged path/to/file When you want to start keeping track again git update-index –no-assume-unchanged path/to/file Github Documentation: update-index

How to count total lines changed by a specific author in a Git repository?

This gives some statistics about the author, modify as required. Using Gawk: git log –author=”_Your_Name_Here_” –pretty=tformat: –numstat \ | gawk ‘{ add += $1; subs += $2; loc += $1 – $2 } END { printf “added lines: %s removed lines: %s total lines: %s\n”, add, subs, loc }’ – Using Awk on Mac OSX: … Read more

How to move some files from one git repo to another (not a clone), preserving history

If your history is sane, you can take the commits out as patch and apply them in the new repository: cd repository git log –pretty=email –patch-with-stat –reverse –full-index –binary -m –first-parent — path/to/file_or_folder > patch cd ../another_repository git am –committer-date-is-author-date < ../repository/patch Or in one line git log –pretty=email –patch-with-stat –reverse –full-index –binary -m –first-parent … Read more

How should I deal with “package ‘xxx’ is not available (for R version x.y.z)” warning?

1. You can’t spell The first thing to test is have you spelled the name of the package correctly? Package names are case sensitive in R. 2. You didn’t look in the right repository Next, you should check to see if the package is available. Type setRepositories() See also ?setRepositories. To see which repositories R … Read more