Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • sccs/docs.it4i.cz
  • soj0018/docs.it4i.cz
  • lszustak/docs.it4i.cz
  • jarosjir/docs.it4i.cz
  • strakpe/docs.it4i.cz
  • beranekj/docs.it4i.cz
  • tab0039/docs.it4i.cz
  • davidciz/docs.it4i.cz
  • gui0013/docs.it4i.cz
  • mrazek/docs.it4i.cz
  • lriha/docs.it4i.cz
  • it4i-vhapla/docs.it4i.cz
  • hol0598/docs.it4i.cz
  • sccs/docs-it-4-i-cz-fumadocs
  • siw019/docs-it-4-i-cz-fumadocs
15 results
Select Git revision
Show changes
#!/bin/bash
for i in {"red","pink","purple","deep purple","indigo","blue","light blue","cyan","teal","green","light green","lime","yellow","amber","orange","deep orange","brown","grey","blue grey"}
do
echo "Setting color to: $i, ${i/ /_}, color_${i/ /_}"
#git checkout -b color_${i/ /_}
git checkout color_${i/ /_}
#rm -fr "/home/hrb33/Dokumenty/dev/it4i/docs.it4i.git/.git/rebase-apply"
git pull --rebase origin colors
git pull --rebase
sed -ri "s/(primary: ').*'/\1$i'/" mkdocs.yml
#git cherry-pick bd8e358
git commit -am "Setting color to: $i"
git push --set-upstream origin color_${i/ /_}
git checkout colors
done
import itertools
import re
l = ['A', 'S', 'U', 'T']
mask = ''.join(reversed(l))
for i in range(1,len(l)+1):
for comb in itertools.combinations(l, i):
reg = "[^%s]" % ''.join(comb)
print re.sub(reg,"-", mask)
#!/bin/bash
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/anselm.csv -o modules-anselm.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/salomon.csv -o modules-salomon.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/uv2000.csv -o modules-salomon-uv.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/phi.csv -o modules-salomon-phi.csv
#!/bin/bash
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/anselm.md -o docs.it4i/modules-anselm.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/salomon.md -o docs.it4i/modules-salomon.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/uv2000.md -o docs.it4i/modules-salomon-uv.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/phi.md -o docs.it4i/modules-salomon-phi.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/anselm.csv -o scripts/modules-anselm.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/salomon.csv -o scripts/modules-salomon.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/uv2000.csv -o scripts/modules-salomon-uv.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/phi.csv -o scripts/modules-salomon-phi.csv
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import collections
import json
from distutils.version import LooseVersion
def get_data(filename):
'''function to read the data form the input csv file to use in the analysis'''
reader = [] # Just in case the file open fails
with open(filename, 'rb') as f:
reader = csv.reader(f,delimiter=',')
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
return list(reader) # only return the reader when you have finished.
your_list = []
your_list += get_data('./scripts/modules-anselm.csv')
your_list += get_data('./scripts/modules-salomon.csv')
your_list += get_data('./scripts/modules-salomon-uv.csv')
#print your_list
#a=[["python/2.8.1",1],["python/2.9.1",2],["python/2.8.1",4],["python/3.0.1",4]]
counts = dict()
for i in your_list:
#print i[0]
#print int(i[1])
counts[i[0]]=counts.get(i[0], 0) + int(i[1])
#print sorted(counts.items())
c=[
"---",
"--A",
"-S-",
"-SA",
"U--",
"U-A",
"US-",
"USA",
]
software = dict()
versions = ''
clusters = ''
prev = ''
for m,i in sorted(counts.items()):
#print m
split = m.split('/')
#print split
if len(split) > 1:
a = split[0]
b = split[1]
if split[0] <> prev:
software[a] = {}
software[a][b] = '`' + c[i] + '`'
prev = a
packages = {}
for m in sorted(software.items(), key=lambda i: i[0].lower()):
packages[m[0]]=sorted(m[1], key=LooseVersion)[len(m[1])-1]
data = {'total': len(packages), 'projects': packages }
print json.dumps(data)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import collections
from distutils.version import LooseVersion
def get_data(filename):
'''function to read the data form the input csv file to use in the analysis'''
reader = [] # Just in case the file open fails
with open(filename, 'rb') as f:
reader = csv.reader(f,delimiter=',')
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
return list(reader) # only return the reader when you have finished.
your_list = []
your_list += get_data('./scripts/modules-anselm.csv')
your_list += get_data('./scripts/modules-salomon.csv')
your_list += get_data('./scripts/modules-salomon-uv.csv')
#print your_list
#a=[["python/2.8.1",1],["python/2.9.1",2],["python/2.8.1",4],["python/3.0.1",4]]
counts = dict()
for i in your_list:
#print i[0]
#print int(i[1])
counts[i[0]]=counts.get(i[0], 0) + int(i[1])
#print sorted(counts.items())
c=[
"---",
"--A",
"-S-",
"-SA",
"U--",
"U-A",
"US-",
"USA",
]
print '!!! Hint "Cluster Acronyms"'
print ' A - Anselm • S - Salomon • U - uv1 at Salomon'
print
print '| Module </br><input id="searchInput" placeholder="🔍 Filter" style="width: 8rem; border-radius: 0.2rem; color: black; padding-left: .2rem;"> | Versions | Clusters |'
print "| ------ | -------- | -------- |"
software = dict()
versions = ''
clusters = ''
prev = ''
for m,i in sorted(counts.items()):
#print m
split = m.split('/')
#print split
if len(split) > 1:
a = split[0]
b = split[1]
if split[0] <> prev:
software[a] = {}
software[a][b] = '`' + c[i] + '`'
prev = a
#print software.items()
for m in sorted(software.items(), key=lambda i: i[0].lower()):
software = m[0]
versions = []
clusters = []
for key in sorted(m[1], key=LooseVersion ):
versions.append(key)
clusters.append(m[1][key])
print "| %s | %s | %s |" % (software, '</br>'.join(versions), '</br>'.join(clusters))
print
print '---8<--- "modules_matrix_search.md"'
#!/bin/bash
### DOWNLOAD AND CONVERT DOCUMENTATION
# autor: kru0052
# version: 1.00
###
if [ "$1" = "-w" ]; then
# download html pages
rm -rf docs-old.it4i.cz
wget -X portal_css,portal_javascripts,++resource++jquery-ui-themes,anselm-cluster-documentation/icon.jpg -R favicon.ico,pdf.png,logo.png,background.png,application.png,search_icon.png,png.png,sh.png,touch_icon.png,anselm-cluster-documentation/icon.jpg,*js,robots.txt,*xml,RSS,download_icon.png,@@*,anselm-cluster-documentation/icon.jpg.1 --mirror --convert-links --adjust-extension --page-requisites --no-parent https://docs-old.it4i.cz;
fi
if [ "$1" = "-c" ]; then
# erasing the previous transfer
if [ -d ./docs.it4i ]; then
rm -rf ./docs.it4i
fi
if [ -d ./info ]; then
rm -rf ./info;
fi
# counter for html and md files
counter=1
count=$(find . -name "*.html" -type f | wc -l)
find . -name "*.ht*" |
while read i;
do
# filtering html files
echo "$(tput setaf 12)($counter/$count)$(tput setaf 11)$i";
counter=$((counter+1))
printf "\t\tFiltering html files...\n";
HEAD=$(grep -n -m1 '<h1' "$i" |cut -f1 -d: | tr --delete '\n')
END=$(grep -n -m1 '<!-- <div tal:content=' "$i" |cut -f1 -d: | tr --delete '\n')
LAST=$(wc -l "$i" | cut -f1 -d' ')
DOWN=$((LAST-END+2))
sed '1,'"$((HEAD-1))"'d' "$i" | sed -n -e :a -e '1,'"$DOWN"'!{P;N;D;};N;ba' > "${i%.*}TMP.html"
# converted .html to .md
printf "\t\t.html => .md\n"
pandoc -f html -t markdown+pipe_tables-grid_tables "${i%.*}TMP.html" -o "${i%.*}.md";
rm "${i%.*}TMP.html"
done
# delete empty files
find -type f -size -10c |
while read i;
do
rm "$i";
echo "$(tput setaf 9)$i deleted";
done
fi
#!/usr/bin/python
import fnmatch
import os
import sys
try:
from titlecase import titlecase
except ImportError:
print("Please install titlecase")
def main(location):
# Spelling exceptions
with open('.spelling') as f:
spelling = f.readlines()
def abbreviations(word, **kwargs):
if word+"\n" in spelling:
return word
# Open the file and read the lines as a list
with open(location) as f:
lines = f.readlines()
with open(location, 'w') as f:
# Loop through the list of lines and titlecase
# any line beginning with '#'.
prev_line = lines.pop(0)
disabled = 0
for line in lines:
if line.startswith("``") and disabled == 0:
disabled = 1
else:
if line.startswith("``") and disabled == 1:
disabled = 0
if line.startswith('#') and disabled == 0:
line = titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):]
if (line.startswith('---') or line.startswith('===')) and disabled == 0:
prev_line = titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):]
f.write(prev_line)
prev_line = line
f.write(prev_line)
if __name__ == "__main__":
try:
main(sys.argv[1])
except IndexError:
main('.')
#!/usr/bin/env python
from __future__ import print_function
import fnmatch
import os
import sys
try:
from titlecase import titlecase
except ImportError:
print("Please install titlecase")
def main(location):
# Spelling exceptions
with open('.spelling') as f:
spelling = f.readlines()
def abbreviations(word, **kwargs):
if word+"\n" in spelling:
return word
# Open the file and read the lines as a list
with open(location) as f:
lines = f.readlines()
# Loop through the list of lines and titlecase
# any line beginning with '#'.
return_value = 0
prev_line = lines[0]
disabled = 0
echo_filename = False
if location.find("mkdocs.yml") != -1:
disabled = 1
for line in lines:
if (line.startswith("``") or line.startswith("extra:")) and disabled == 0:
disabled = 1
else:
if (line.startswith("``") or prev_line.startswith("pages:")) and disabled == 1:
disabled = 0
if line.startswith('#') and (disabled == 0) and (location.find("mkdocs.yml") == -1):
if line != titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):]:
if return_value == 0 and echo_filename == False:
print("%s" % location)
echo_filename = True
print("-"+line,end="")
print("+"+titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):],end="")
print()
return_value = 1
if (line.startswith('---') or line.startswith('===')) and disabled == 0:
if prev_line != titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):]:
if return_value == 0 and echo_filename == False:
print("%s" % location)
echo_filename = True
print("-"+prev_line,end="")
print("+"+titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):],end="")
print()
return_value = 1
if ((location.find("mkdocs.yml") != -1) and not line.startswith('#') and disabled == 0):
if line != titlecase(line[:(line.find(":"))], callback=abbreviations)+line[(line.find(":")):]:
if return_value == 0 and echo_filename == False:
print("%s" % location)
echo_filename = True
print("-"+line,end="")
print("+"+titlecase(line[:(line.find(":"))], callback=abbreviations)+line[(line.find(":")):],end="")
print()
return_value = 1
prev_line = line
exit(return_value)
if __name__ == "__main__":
try:
main(sys.argv[1])
except IndexError:
main('.')