Thursday, September 8, 2016

git auto-completion:

Open .bash_profile:
vi ~/.bash_profile

Add script execution lines:
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

# Git branch in prompt.

parse_git_branch() {

    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'

}

export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "


#End Git branch in promt.
TextMate support for git commit command:

Open .bash_profile:
vi ~/.bash_profile

Insert command to support TextMate:
# ------------------------
# TextMate support for git

export PATH="$HOME/bin:$PATH"
export EDITOR="$HOME/bin/mate -w"

# End TextMate support for git
# ----------------------------

Thursday, November 12, 2015

symbolicatecrash from terminal

Put *.crash, *.dSYM and *.app file to one folder. After that execute symbolicatecrash method as shown below:
symbolicatecrash -v crash.crash > Symbolicated.crash

Xcode 8: /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

Xcode 7: /Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash

FFMPEG

Print out media metadata: ffprobe -v quiet -print_format json -show_format -show_streams output1200x900.mov


{
    "streams": [
        {
            "index": 0,
            "codec_name": "prores",
            "codec_long_name": "ProRes",
            ...
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            ...
        }
    ],
    "format": {
        "filename": "output1200x900.mov",
        "nb_streams": 2,
        ...
    }
}


Convert codec to H.264: ffmpeg -i 1080x1920.mov -vcodec libx264 1080x1920output.mov

Add sound to video: ffmpeg -i input.mov -i sound.m4a -c copy -map 0:0 -map 1:0 -shortest output.mov

Decrease video file size: ffmpeg -i in.mp4 -vcodec libx264 -crf 30 out_30.mp4

Adds left (113px) and right (113px) padding to the video (674x1200): ffmpeg -i in.mp4 -vf pad=900:1200:113:0:black out.mp4

Wednesday, September 23, 2015

Open SSL

Save certificate:
openssl s_client -showcerts -connect server.edu:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem


Thursday, October 30, 2014

Git points to wrong bin

Search for installed git paths.
sudo find / -name git
List of gits in my machine.
/Applications/Xcode.app/Contents/Developer/usr/bin/git  -> git version 1.9.3 (Apple Git-50)
/opt/local/bin/git                                      -> git version 1.7.9.2
/usr/bin/git                                            -> git version 1.9.3 (Apple Git-50) 
/usr/local/git/bin/git                                  -> git version 2.0.1
Places where to change $PATH
vi ~/.bash_profile
vi ~/.profile
After execution of this line default version for git will be 2.0.1
export PATH=/usr/local/git/bin:$PATH

Tuesday, November 27, 2012