Skip to content

Instantly share code, notes, and snippets.

View hackprime's full-sized avatar

Yury Krapivko hackprime

View GitHub Profile

Add Slurm Accounting (slurmdbd) to Existing Slurm Configuration

At the start, I have:

  • CentOS centos-release-7-7.1908.0.el7.centos.x86_64.
  • Slurm
    • Installed to /opt/slurm.
    • Only slurmctld and slurmd are running.
  • Munge.
@hackprime
hackprime / ldap_client.py
Last active May 16, 2019 02:24
Simple wrapper class over FreeIPA client implementation from https://github.com/nordnet/python-freeipa-json
"""
Simple wrapper class over FreeIPA client implementation from
https://github.com/nordnet/python-freeipa-json
Usage
* Create user:
>>> manager = LDAPClient('ldap.example.com', 'admin', 'qw3rty12')
>>> user = manager.create_user('user1', 'systemadmins', 'asd1234567')
@hackprime
hackprime / run.on.cluster.nodes.sh
Created April 18, 2019 02:05
Simple shortcut to execute a command on hosts with similar names via ssh
for i in {01..20}; do echo "[my-cluster-$i]"; sshpass -p 'pass' ssh -o "StrictHostKeyChecking no" my-cluster-$i 'ps aux' | grep mpirun; done
@hackprime
hackprime / number.in.words.js
Last active May 31, 2023 07:16
Convert number from digits to words in Russian
var TRIPLET_NAMES = [
null,
['тысяча', 'тысячи', 'тысяч'],
['миллион', 'миллиона', 'миллионов'],
['миллиард', 'миллиарда', 'миллиардов'],
['триллион', 'триллиона', 'триллионов'],
['квадриллион', 'квадриллиона', 'квадриллионов'],
],
ZERO_NAME = 'нуль',
ONE_THOUSANT_NAME = 'одна',
@hackprime
hackprime / items.py
Last active April 7, 2020 17:58
Register many applications at Yandex OAuth Service by single run using spider on Scrapy
import scrapy
class AppCredentialsItem(scrapy.Item):
domain = scrapy.Field()
public_key = scrapy.Field()
secret_key = scrapy.Field()
@hackprime
hackprime / graphite_send_data.py
Last active November 27, 2015 04:24
How to get your data into graphite.
import pickle
import struct
import time
import socket
CARBON_HOST = '192.168.99.100'
CARBON_PLAIN_DATA_PORT = 2003
CARBON_PICKLED_DATA_PORT = 2004