Skip to content

Instantly share code, notes, and snippets.

View cgarjun's full-sized avatar

Arjun Thekkumadathil cgarjun

  • cgarjun
  • Bangalore, India
View GitHub Profile
@cgarjun
cgarjun / envtoshell
Created March 2, 2017 23:43
all environemnt variable to sourceale bash file
import os
for i in os.environ:
print("export {0}={1}".format(i, os.environ[i]))
import maya.cmds as mc
def surfacingUtilUI():
if mc.window('surfacingutilwin', exists=True):
mc.deleteUI('surfacingutilwin')
window = mc.window('surfacingutilwin',title="Surfacing Utilities",widthHeight=(400, 155))
mc.columnLayout( adjustableColumn=True )
mc.button(label='Multi Transfer UV',command=transferUV)
mc.button(label='Select Similar', command=selectSimilar)
@cgarjun
cgarjun / docker_install.sh
Last active December 12, 2022 18:15
Docker install on centos based distro
# Install core lib on linux
sudo dnf -y install epel-release
sudo dnf -y install chrony
sudo dnf -y install firewalld
# Start core services
sudo systemctl start chronyd
sudo systemctl enable chronyd
sudo systemctl start firewalld
sudo systemctl enable firewalld
@cgarjun
cgarjun / docker-prometheus.yml
Created January 7, 2023 11:08
Configuring docker swam scraping with prometheus
# docker-compose.yml
version: "3"
services:
prometheus:
image: prom/prometheus
test-service: # <- this
image: nginx
deploy:
replicas: 3
@cgarjun
cgarjun / proc_m.c
Created February 7, 2023 13:52
Quick c code to manage proc and memory of a process
#include <windows.h>
int main() {
// Define process information
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
@cgarjun
cgarjun / limit-virtual-memory-of-subprocess.py
Created February 8, 2023 07:33 — forked from s3rvac/limit-virtual-memory-of-subprocess.py
Limits the maximal virtual memory for a subprocess in Python on Linux.
#!/usr/bin/env python3
#
# Limits the maximal virtual memory for a subprocess in Python.
#
# Linux only.
#
import subprocess
import resource