Skip to content

Instantly share code, notes, and snippets.

View vitalyford's full-sized avatar

Vitaly Ford vitalyford

View GitHub Profile
@vitalyford
vitalyford / git-workflow.md
Last active October 4, 2023 17:17
Defines the workflow of smaller team projects

Git Workflow

  1. At the beginning, create a master and dev branches.
  2. All development should be happening on a feature branch (i.e. when you receive an issue/improvement/feature, you should create a corresponding branch. For example, if you work on adding logs, you create a branch: feat/improve/add-logs).
  3. When making a commit, we should try to specify as much as we can in the commit message.
  4. One commit should be corresponding to one specific task being accomplished (e.g., do not put "add feature", "fix bug", and "change data structure" into one commit).
  5. We should create pull request (PR) from a feature branch to the dev branch once the code is well-tested in the feature branch. The PR should contain details of the current changes you have made so that the reviewer can review the code.
  6. We should release dev to master on a regular basis.

Important to Remember

@vitalyford
vitalyford / update_iptables.sh
Created March 11, 2022 17:03
Run with sudo
#!/bin/bash
wget -O rules.v4 https://gist.githubusercontent.com/vitalyford/6ddb2ba24a072f2d442ee4d5ee62c006/raw/f8049ee12164bd608c8a2b2f7288897cd1f686df/rules.v4
IP=$(curl https://ifconfig.me/ip)
sed -i "s/35.208.62.165/${IP}/g" rules.v4
cp rules.v4 /etc/iptables/rules.v4
# Generated by iptables-save v1.8.4 on Wed Mar 9 20:23:13 2022
*nat
:PREROUTING ACCEPT [3:124]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [8:718]
:POSTROUTING ACCEPT [8:718]
-A POSTROUTING -s 10.8.0.0/24 -o ens4 -j MASQUERADE
-A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to-source 35.208.62.165
-A POSTROUTING -s 10.8.0.0/24 -o ens4 -j MASQUERADE
-A POSTROUTING -s 10.8.0.0/24 -o e -j MASQUERADE
@vitalyford
vitalyford / convert.sh
Last active December 23, 2023 03:12
Convert mov to mp4 with scale and padding using ffmpeg. Crop and pad video.
ffmpeg -i v.MOV -vcodec h264 -aspect 16:9 -vf "scale=608x1080,pad=1920:1080:656:0:black" v-out.mp4
ffmpeg -i v.mp4 -vf "crop=1280:640:0:0,pad=1280:720:0:0" v-out.mp4
for i in *.mkv; do ffmpeg -i "$i" "${i%.*}.mp4"; done
# get audio
for i in *.mkv; do ffmpeg -i "$i" -q:a 0 -map a "${i%.*}.mp3"; done
# normalize audio
ffmpeg-normalize input.mp4 -o output.mp4 -c:a aac -b:a 192k

Keybase proof

I hereby claim:

  • I am vitalyford on github.
  • I am vitalyford (https://keybase.io/vitalyford) on keybase.
  • I have a public key ASBsb-AD-lqfOsn80-ZD7F-7TMw4N6fiq3tXbrfRROcjUAo

To claim this, I am signing this object: