This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvidia-smi --query-gpu=OPTION,... [--format=csv[,hoheader]] | |
timestamp - YYYY/MM/DD HH:MM:SS.msec | |
driver_version | |
count | |
name or gpu_name | |
serial or gpu_serial | |
uuid or gpu_uuid | |
pci.bus_id or gpu_bus_id - domain:bus:device.function, in hex | |
pci.domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import concurrent.futures | |
import functools | |
import queue | |
import subprocess | |
import random | |
def pool_wrapper(q_in, q_out, size=5): | |
def pool_wrapper_inner(func): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Please, check https://github.com/dylanaraps/pure-bash-bible | |
# It is a great chest of treasures | |
######## STRINGS ############# | |
# check if elemet is in the ARRAY | |
# Usage: | |
# arr=(a b x) | |
# containsElement 'x' arr | |
containsElement () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# replace "Nodename=abc Uptime=1 CPUs=128 State=Drain Reason=no cpu detected [12:00]" -> "abc: no cpu detected" | |
gawk '{print gensub(/NodeName=([[:alnum:]]+).*Reason=([^[]+)\[.*/, "\\1: \\2", "g") }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cannot connect to any pod - get "Unable to upgrade connection". | |
Log: | |
Apr 2 03:42:59 graphit kubelet[18632]: E0402 03:42:59.173155 18632 server.go:253] Unable to authenticate the request due to an error: x509: certificate has expired or is not yet valid | |
Meanwhile: | |
CERTIFICATE EXPIRES RESIDUAL TIME CERTIFICATE AUTHORITY EXTERNALLY MANAGED | |
admin.conf Apr 02, 2023 00:29 UTC 364d no | |
apiserver Apr 02, 2023 00:29 UTC 364d ca no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# // # // Implement a function that orders inputs to schedule for min TAT (Turn around time == Total Run Time) | |
# // # // Input: (list of runtimes, number of parallel buckets) | |
# // # // Output: Should parallelize individual tasks such that total TAT is minimum. | |
# // # // Example: | |
# // # // In: [4, 3, 100, 2, 1], parallel = 2 | |
# // # // Out: [[100], [4, 3, 2, 1]], TAT: 100 | |
# // # // [100, 10] -> 100 | |
# // # // In: [4, 3, 100, 2, 1], parallel = 1 | |
# // # // Out: [[100, 4, 3, 2, 1]], TAT: 110 | |
# // # // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
module Memoization | |
def memoize(f, injected_cache={}) | |
m = instance_method(f) | |
define_method(f) do |*args| | |
cache = injected_cache.clone | |
define_singleton_method(f) do |*args| | |
unless cache[args] | |
puts "Actually calculating..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GxEPD.h> | |
#include <GxGDEP015OC1/GxGDEP015OC1.cpp> | |
#include <Fonts/OpenSansBold12pt7b.h> | |
#include <Fonts/OpenSansBold14pt7b.h> | |
#include <Fonts/OpenSansBold30pt7b.h> | |
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp> | |
#include <GxIO/GxIO.cpp> | |
#include GxEPD_BitmapExamples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# | |
require 'gtk2' | |
Gtk.init | |
@window = Gtk::Window.new( Gtk::Window::TOPLEVEL ) | |
@window.set_size_request( 1500, 500 ) | |
@window.signal_connect( "delete_event" ) { Gtk.main_quit } | |
#@window.set_border_width( 5 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
NewerOlder