find . -name "*.pyc" -exec rm -f {} \;
find . -name “.DS_Store” -exec rm -f {} \;
Category Archives: Linux
[Docker] Removing all images and containers
[Git] Fork a public repo to private
git clone –bare https://github.com/%5BPUBLIC%5D.git –recursive
cd [PUBLIC].git/
git push –mirror https://github.com/%5BPRIVATE%5D.git
git remote -v
rm -rf [PUBLIC].git/
git clone https://github.com/%5BPRIVATE%5D.git –recursive
git remote -v
git remote add public https://github.com/%5BPUBLIC%5D.git
To fork as public…
[Git] Clone private repo from Github in script
[Git] How to change pushed commit’s message
- rebase to one before whatever commits user hopes to change.
– git rebase -i [HASH] - change pick to reword for commits user hopes to change.
- quit vim using :wq
- change message for each vim that pops up…
- push to remote
– git push –force
https://superuser.com/questions/751699/is-there-a-way-to-edit-a-commit-message-in-github/751909
[Docker] removing dangling images after building
docker rmi -f $(docker images -f “dangling=true” -q)
Reference
https://forums.docker.com/t/how-to-remove-none-images-after-building/7050/3
[Linux] Creating patch file
Create patch
git diff > patch.diff
Apply patch
patch -p1 < patch.diff
Reference
[Linux] mmap & lseek
Usually, file are accessed using various functions. However, these seems to incur a lot of overhead. Therefore, for fast access, you would use mmap() to map certain variable to the memory address and lseek() would be used to move within that file.
There can be an example of this since usually this file is mapped to DRAM and it is volatile. To write this on the disk, you would use msync(). Failure can happen during the process, which is Failure-Atomic msync(). Terence Kelly seems to be actively working on this.
Reference
[Linux] Live view of file
tail -f [My File]
[Linux] Setting Path for new application
Instruction
export PATH=$PATH:[My Path]