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 torch, grp, pwd, os, subprocess | |
devices = [] | |
try: | |
print("\n\nChecking ROCM support...") | |
result = subprocess.run(['rocminfo'], stdout=subprocess.PIPE) | |
cmd_str = result.stdout.decode('utf-8') | |
cmd_split = cmd_str.split('Agent ') | |
for part in cmd_split: | |
item_single = part[0:1] | |
item_double = part[0:2] |
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/bash | |
# This hook is run after every virtualenv is activated. | |
export OLD_GEM_HOME=$GEM_HOME | |
export GEM_HOME=$VIRTUAL_ENV/gems/ | |
export GEM_PATH= | |
export PATH=$VIRTUAL_ENV/gems/bin:$PATH |
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
# Run me with: | |
# | |
# $ nginx -p /path/to/this/file/ -c nginx.conf | |
# | |
# All requests are then routed to authenticated user's index, so | |
# | |
# GET http://user:password@localhost:8080/_search?q=* | |
# | |
# is rewritten to: | |
# |
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
// a helper for retrieving JSON data from localStorage | |
var localStore = function(name, cb, self){ | |
var data = $.evalJSON( window.localStorage[name] || (window.localStorage[name] = "{}") ), | |
res = cb.call(self, data); | |
if(res !== false){ | |
window.localStorage[name] = $.toJSON(data); | |
} | |
}; | |
// A todo model for CRUDing todos. |
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 | |
USER=%(user)s | |
NAME=celeryd | |
VIRTUALENV=%(virtualenv_dir)s | |
PROJECT_ROOT=%(project_root)s | |
DAEMON=$VIRTUALENV/bin/celeryd | |
PIDFILE=$PROJECT_ROOT/$NAME.pid | |
LOGFILE=$PROJECT_ROOT/$NAME.log |