Skip to content

Instantly share code, notes, and snippets.

View aditiapratama's full-sized avatar
💻
Compiling ...

Aditia A. Pratama aditiapratama

💻
Compiling ...
View GitHub Profile
@aditiapratama
aditiapratama / clear_cache_MS_Teams.sh
Created October 27, 2021 23:25 — forked from mrcomoraes/clear_cache_MS_Teams.sh
Clear cache Microsoft Teams on Linux
#!/bin/bash
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like and Debian by @necrifede. Feel free to test/use in other distributions.
# Tested with Teams via snap package.
#
# How to use in terminal:
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
# or
# bash clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
@aditiapratama
aditiapratama / commands.txt
Created October 28, 2020 07:30 — forked from JesseRWeigel/commands.txt
ImageMagick Compression Commands
// Must install ImageMagick first
http://www.imagemagick.org/script/index.php
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg
// This does the same as above but to an entire folder (will overwrite original files):
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files)
@aditiapratama
aditiapratama / blender-multi_gpu.markdown
Created August 28, 2017 23:48 — forked from Fweeb/blender-multi_gpu.markdown
Rendering in Blender on a machine with multiple GPUs

Rendering in Blender on a machine with multiple GPUs

So here's the premise: For scenes that take around a minute or less to render, performance is actually worse if you render on all of the cards with a single instance of Blender. This is because (AFAIK) there's a bit of additional time necessary to collect the render results from each card and stitch them together. That time is a fixed short duration, so it's negligible on larger/longer render jobs. However, on shorter render jobs, the 'stitch time' has a much more significant impact.

I ran into this with a machine I render on that has 4 Quadro K6000s in it. To render animations, I ended up writing a few little scripts to facilitate launching 4 separate instances of Blender, each one tied to one GPU. Overall rendertime was much shorter with that setup than one instance of Blender using all 4 GPUs.

The setup works basically like this... I have a the following Python script (it can be anywhere on your hard drive, so long as you remember the path to it).

@aditiapratama
aditiapratama / git_remote_branches.sh
Created July 9, 2017 06:20 — forked from roscius/git_remote_branches.sh
Git: Track Remote Branches
# Create new remote branch
git push origin origin:refs/heads/new_branch_name
# Make sure everything is updated
git fetch origin
# Check your branch has been created
git branch -r
# Track a remote branch
@aditiapratama
aditiapratama / deshake.sh
Created July 2, 2017 00:12 — forked from hrkfdn/deshake.sh
stabilize a video clip using ffmpeg with libvidstab
#!/bin/sh
echo "Pass 1: Analyzing file"
ffmpeg -i "$1" -vf vidstabdetect=result="$1.trf" -f null - &> /dev/null
echo "Pass 2: Applying transformations"
ffmpeg -i "$1" -vf vidstabtransform=input="$1.trf" "stab_$1" &> /dev/null
rm "$1.trf"
echo "Done."
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
# Author: Adhi Hargo (cadmus.sw@gmail.com)
# License: GPL v2
import bpy
class CameraAddTitleSafe(bpy.types.Operator):
bl_idname = 'object.camera_add_title_safe'
bl_label = 'Add Camera Title Safe'
bl_options = {'REGISTER', 'UNDO'}