Skip to content

Instantly share code, notes, and snippets.

@kitak
kitak / doc.md
Last active October 18, 2023 09:57
コマンドによる「負荷」の原因切り分け

コマンドによる「負荷」の原因切り分け

この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。

そもそも負荷とは

「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。

ボトルネックの見極め作業の大まかな流れ

  • ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る
@christophercrouzet
christophercrouzet / mayaskin.py
Last active January 28, 2020 05:14
Quick and dirty Maya skin load/save
# Relies on https://github.com/christophercrouzet/banana.maya
import collections
import json
from maya import OpenMaya, OpenMayaAnim, cmds
import banana.maya
banana.maya.patch()
@liorbenhorin
liorbenhorin / MayaDockingClass.py
Last active October 3, 2023 13:01
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "liorbenhorin@gmail.com"
import sys
import os
import logging
import xml.etree.ElementTree as xml
@christophercrouzet
christophercrouzet / mayabake.py
Created December 24, 2016 14:03
Quick and dirty prototype of a naive animation bake implementation for Autodesk Maya.
#!/usr/bin/env mayapy
import itertools
import math
import random
import timeit
from maya import cmds, OpenMaya, OpenMayaAnim
@ryusas
ryusas / workspaceControl.py
Created April 18, 2017 06:57
A simple example to avoid the issue of Maya 2017 workspaceControl.
# coding: utf-8
u"""
Maya 2017 workspaceControl の問題回避のサンプル。
workspaceControl と workspaceControlState のゴミが残らないようにする。
retain=False の場合でも何故か state のゴミが残ってしまうが、
scriptJob で workspaceControl の削除を監視して state も同時に削除するようにする。
retain=True の場合は、UI が閉じたとしても state は残って良いはずなので監視はしない。
@liorbenhorin
liorbenhorin / Simple_MayaDockingClass.py
Created December 1, 2017 15:04
Simple way to Docking Qt widgets to Maya 2017+
'''
Template class for docking a Qt widget to maya 2017+.
Author: Lior ben horin
12-1-2017
'''
import weakref
import maya.cmds as cmds
import maya.OpenMayaUI as omui