-
-
Save ixtiyoruz/4f8dd9c8a4081c604901b119589537b8 to your computer and use it in GitHub Desktop.
to replace the word with another word in given files. | |
'replace "bottle" "box" -- ./images/*.xml' |
making a video from images.
ffmpeg -framerate 25 -pattern_type glob -i 'video0/*.jpg' -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4
to reject some commit in github:
run this and take the commit hash
git log --oneline
for example lets 'cd7fe3a' be the last wrong commit and '2c28dde' be the last good commit. So you want to 2c28dde .
git reset --hard 2c28dde
git commit -a
git push origin master -f
to create a new branch
git checkout -b new_branch_name branch_name_to_copy
git push -u origin new
to merge two branches
git checkout updating_branch_name
git merge branch_name_to_copy_from
write text to a file :
echo "Hello you!" >> myfile.txt
echo "this is 2nd line text" >> file.txt
echo "last line!" >> file.txt
serve files inside directory
python3 -m http.server 8007
to give the docker command permission to display things
xhost +local:root
in order to use nvidia while building docker use this https://stackoverflow.com/questions/67570694/how-to-build-yolact-using-docker
To do smth for every nth file in a folder
find 192.168.0.111 -type f | awk 'NR %1000 == 0'| xargs du -sh
Docker display example
--net allows the docker image to use host ip.
x11 things allows to use the dispaly
-e DISPLAY=:1 gives the display number.
code_folder="path"
docker run --rm -e DISPLAY=:1 --net=host -v /tmp/.X11-unix:/tmp/.X11-unix -v ${code_folder}:/home/code -it docker_image_name
searching files with extension
find . -name "*.zip" -type f
to delete the files with extension
find . -name "*.zip" -type f -delete