Skip to content

Instantly share code, notes, and snippets.

View kobybibas's full-sized avatar

Koby Bibas kobybibas

  • Tel Aviv, Israel
View GitHub Profile
@kobybibas
kobybibas / gist:f6a7eee4ad226ccc6a8cabcf02f6b6a8
Last active December 6, 2023 15:40
ffmpeg hstack image with video
ffmpeg -i <IMAGE_1> -i <VIDEO> -filter_complex "[0][1]scale2ref=w=oh*mdar:h=ih[left][right];[left][right]hstack" -r 30 output.mp4
git reset --soft HEAD~6
git commit -m "New message for the combined commit"
git push origin main --force
@kobybibas
kobybibas / .vscode
Last active July 3, 2022 07:31
.vscode/launch.json so that the cwd will be the file folder
// launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
# To see what volumes are avilable
lsblk
# c5
sudo mount /dev/nvme1n1 /data
# p2
sudo mount /dev/xvdf /data
@kobybibas
kobybibas / install_blender_python_api.md
Last active August 17, 2023 01:05
Blender python api installation on macOS
@kobybibas
kobybibas / ffmpeg_center_crop_and_scale.sh
Last active March 14, 2021 12:48
Crop, scale and compress a video
# Crop such that the output is heightxheight. Then scale to 640:640. finally videeo compression ("28", higher is more compression)
ffmpeg -i intput -filter:v "crop=ih:ih,scale=640:-2" -crf 28 output.mp4
# Split a video to 280 sec segments
ffmpeg -i input.mp4 -acodec copy -f segment -segment_time 280 -vcodec copy -reset_timestamps 1 -map 0 output_%d.mp4
# Crop with side by side merge (https://stackoverflow.com/questions/35349935/ffmpeg-crop-with-side-by-side-merge)
ffmpeg -i in0.mp4 -i in1.mp4 -filter_complex "[0:v]crop=iw/2:ih:0:0[left]; [1:v]crop=iw/2:ih:ow:0[right]; [left][right]hstack" output.mp4
@kobybibas
kobybibas / pytorch_acceleration.md
Last active October 5, 2020 08:00
Pytorch acceleration tips
@kobybibas
kobybibas / delete_git_submodule.md
Created July 6, 2020 07:10 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule