text stringlengths 1 93.6k |
|---|
threads=threads,
|
max_new_tokens=max_new_tokens,
|
stop=stop,
|
)
|
return config
|
# <FILESEP>
|
import logging
|
import os
|
import sys
|
from werkzeug.security import generate_password_hash
|
log = logging.getLogger("app.config")
|
## Configuration Setings
|
# Admin Password. Auth disabled if unset
|
ADMIN_PASSWORD = os.environ.get("KRONIC_ADMIN_PASSWORD", None)
|
ADMIN_USERNAME = os.environ.get("KRONIC_ADMIN_USERNAME", "kronic")
|
# Comma separated list of namespaces to allow access to
|
ALLOW_NAMESPACES = os.environ.get("KRONIC_ALLOW_NAMESPACES", None)
|
# Limit to local namespace. Supercedes `ALLOW_NAMESPACES`
|
NAMESPACE_ONLY = os.environ.get("KRONIC_NAMESPACE_ONLY", False)
|
# Boolean of whether this is a test environment, disables kubeconfig setup
|
TEST = os.environ.get("KRONIC_TEST", False)
|
## Config Logic
|
USERS = {}
|
if ADMIN_PASSWORD:
|
USERS = {ADMIN_USERNAME: generate_password_hash(ADMIN_PASSWORD)}
|
# Set allowed namespaces to the installed namespace only
|
if NAMESPACE_ONLY:
|
try:
|
KRONIC_NAMESPACE = os.environ["KRONIC_NAMESPACE"]
|
except KeyError as e:
|
log.error(
|
"ERROR: KRONIC_NAMESPACE variable not set and a NAMESPACE_ONLY mode was specified."
|
)
|
sys.exit(1)
|
ALLOW_NAMESPACES = KRONIC_NAMESPACE
|
# <FILESEP>
|
#!/usr/bin/python
|
#
|
# low1z / forum.darkc0de.com / 2aug09
|
#
|
# ShoutMix reader/poster
|
#
|
# favorable to use with -s d3hydr8 to get the darkc0de feed
|
#
|
# example: python shoutmix_tool.py -s d3hydr8 -l <- read the latest
|
# python shoutmix_tool.py -s d3hydr8 -p <- post something
|
import sys, re, time, os, urllib2, urllib, cookielib
|
from optparse import OptionParser
|
realhost = 'www6' # real webserver for the shoutmix you want to work with, get your info by opening the shout you need in the browser
|
if sys.platform == 'linux' or sys.platform == 'linux2':
|
clearscreen = 'clear'
|
else:
|
clearscreen = 'cls'
|
def StripTags(text):
|
return re.sub(r'<[^>]*?>','', text)
|
def timer():
|
now = time.localtime(time.time())
|
return time.asctime(now)
|
def readLatest(COUNT):
|
request = urllib2.Request('http://'+realhost+'.shoutmix.com/?'+options.smuser+'&view='+COUNT)
|
response = urllib2.urlopen(request)
|
rspinfo = response.read()
|
myrsp = rspinfo.split('<cite>')
|
del myrsp[0]
|
print "Shoutmix : http://"+realhost+".shoutmix.com/?"+options.smuser+"\n"
|
for myinfo in myrsp:
|
myinfostripped = StripTags(myinfo)
|
spinfo1 = myinfostripped.split('Details')
|
postinfo = spinfo1[0].split(' ',1)
|
postername = postinfo[0]
|
post = postinfo[1]
|
tdi = spinfo1[1].split(' ',2)
|
print "Name:", postername, "\nTime:",tdi[0]+" / "+tdi[1], "\nPost:",post, "\n"
|
def postmsg():
|
myname = raw_input('Name : ')
|
mymsg = raw_input('Message :')
|
submitvalue = "submit"
|
myidcode = getClientCode()
|
cjar = cookielib.CookieJar()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.