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 / RegardingVersion.md
Created March 26, 2020 13:21
Regarding Version

I prefer to increase it directly into master. There is a sole person responsible of the releasing the package. When you upload your package, the version number is included in the package folder name, your pypi publisher (we use twine) use this to set the version number on pypi You release only code from master If you have several stable versions you maintained in parralel, you create a kind of master branch for each of these versions To provide a version number, you can add a __version__.py file in your package containing version = "0.1.0"

import os
import sys
import subprocess
ffmpeg = 'C:\\ffmpeg\\bin\\ffmpeg.exe' # <== ganti lokasi ffmpeg disini
dir_list = [d for d in os.listdir('.') if os.path.isdir(d)]
for d in dir_list:
if not os.path.exists('clips'):
os.makedirs('clips')
for (dirname, dirs, files) in os.walk(d):
@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 / add_instances_to_all_objects.py
Last active August 23, 2017 16:36
Handy script with Pompi Projects
import bpy
data = bpy.data
scene = bpy.context.scene
for obj in data.objects:
obj.select = False
if "SEMAK." in obj.name:
obj.select = True
obj_loc = obj.location
@aditiapratama
aditiapratama / SwitchChannelAtom.sh
Created August 9, 2017 23:08
Switching Release Beta Channel for Atom
cd ~/git/apps/atom
git fetch origin
git checkout master
git pull
git branch -D beta
git checkout -b beta origin/<release_beta_branch>
@aditiapratama
aditiapratama / disable_raytrace_on_selected_objects.py
Created August 6, 2017 18:33
Use this if you want to to make render faster :D
import bpy
context = bpy.context
for obj in context.selected_objects:
for slot in obj.material_slots:
mat_slot = slot.material
mat_slot.use_raytrace = 0
mat_slot.use_mist = 0
@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."