Commit 8660f82e authored by Johannes Kiesel's avatar Johannes Kiesel

Cleanup

  - Removed test scripts

  - Unified help descriptions to start with upper case letters
  
  - Added generation notice to cheatsheet
  - Have -H sort commands and subcommands
parent aa9767e6
test A few unimportant test scripts for developing purpose.
t
a short description
b
WEBIS CHEATSHEET
================
webis20 Storage Management Scripts, need direct access to RAID Controller and MegaCLI installed
lsi
betamng Low level scripts for managing Betaweb.
activate_vnc_all Activate vnc on all nodes of the hostlist
bios_cpu_test_all Starts bios cpu test on all nodes of the hostlist
change_lcd_msg_all Change lcd message of every node of betaweb to betaweb???
do_all Run a command sequential on all betamng nodes
enable_pxe_bios_boot_all Enable pxe bios boot on all hosts: experimental! hope and prey
get_bios_boot_settings_all Get boot settings from all nodes
pssh Run a command parallel on all betamng nodes
read_all_macs Printout system dump of all hosts for extracting mac addresses
set_critical_temp_shutdown Set settings for shutdown on critical temperature
ssh Open ssh session to one of the betamng nodes (racadm can be used)
start_all Start every node of betamng (parallel)
status_all Get power status of every node of betamng
stop_all Shutdown every node of betamng
virtualscreen Open java vnc session to one of the betamng nodes, via idrac
vnc Open vnc session to one of the betamng nodes
util General helper tools and utilities
sshproxy Set up an SSH proxy tunnel for accessing digital library content or university-restricted URLs
read-from-clipboard read clipboard and print to stddout
write-to-clipboard write from stdin to the clipboard
login get fullname based on login name
tasks Process tasks in parallel
patch-jar add files from one jar (or other zip) to another one
backup-btrfs-vol Take a snapshot of a btrfs subvolume and back up its contents to another location
betaweb High level scripts for betaweb, e.g. hadoop management.
check_ram
restart_hadoop_ressourcemanager Restart hadoop ressource manager on betaweb020 and restarts nodemanager
rolling_restart Restart betaweb nodes one after another
rolling_state Apply Salt state on nodes one after another
status Get status of betaweb via salt
betamng Low level scripts for managing Betaweb.
activate_vnc_all activate vnc on all nodes of the hostlist
set_critical_temp_shutdown set settings for shutdown on critical temperature
status_all get power status of every node of betamng
get_bios_boot_settings_all get boot settings from all nodes
pssh run a command parallel on all betamng nodes
enable_pxe_bios_boot_all enable pxe bios boot on all hosts: experimental! hope and prey
start_all start every node of betamng (parallel)
change_lcd_msg_all change lcd message of every node of betaweb to betaweb???
bios_cpu_test_all starts bios cpu test on all nodes of the hostlist
virtualscreen open java vnc session to one of the betamng nodes, via idrac
do_all run a command sequential on all betamng nodes
stop_all shutdown every node of betamng
vnc open vnc session to one of the betamng nodes
read_all_macs printout system dump of all hosts for extracting mac addresses
ssh open ssh session to one of the betamng nodes (racadm can be used)
core Core functions of the Webis command.
checker Check codestyle of project
install Install webis to PATH
remove Remove webis from PATH
update Update the webis command from Git
update-cheatsheet Update local copy of code-webis-cmd/cheatsheet.txt
version Get webis version
elasticsearch Helper scripts for managing Elasticsearch on the Betaweb cluster.
restart_nodes Restart Elasticsearch cluster
start_nodes Restart Elasticsearch cluster
stop_nodes Restart Elasticsearch cluster
git Helper scripts for working with the Webis Git server and GitLab instance.
cvstree2git Try to clone all projects in the current CVS tree from Git.
onboard Set up the correct Gitlab group permissions for a new student or Hiwi
cvs2git Import all CVS modules into new Git repositories and push
web-admin Display a web-admin view for Gitlab (need to have a token with admin access)
clone-groups Check out groups of webis gitlab projects at once
init Initialize GitLab API client
clone-deps Clone dependencies for current project from GitLab
clone-groups Check out groups of webis gitlab projects at once
cvs2git Import all CVS modules into new Git repositories and push
cvstree2git Try to clone all projects in the current CVS tree from Git.
gitlab Gitlab commandline interface that comes with python-gitlab
init Initialize GitLab API client
onboard Set up the correct Gitlab group permissions for a new student or Hiwi
update-project Clone or update the given Git project from GitLab.
web-admin Display a web-admin view for Gitlab (need to have a token with admin access)
core Core functions of the Webis command.
install install webis to PATH
fun easter egg
update-cheatsheet update local copy of code-webis-cmd/cheatsheet.txt
checker check codestyle of project
version get webis version
remove remove webis from PATH
update update the webis command from Git
util General helper tools and utilities
backup-btrfs-vol Take a snapshot of a btrfs subvolume and back up its contents to another location
login Get user name for a university login
patch-jar Add files from one jar to another
read-from-clipboard Print the clipboard to standard output
sshproxy Set up an SSH proxy tunnel for accessing digital library content or university-restricted URLs
tasks Start and monitor parallel processes
write-to-clipboard Fill the clipboard from standard input
betaweb High level scripts for betaweb, e.g. hadoop management.
rolling_restart Restart betaweb nodes one after another
restart_hadoop_ressourcemanager restart hadoop ressource manager on betaweb020 and restarts nodemanager
rolling_state Apply Salt state on nodes one after another
check_ram
status get status of betaweb via salt
webis20 Storage Management Scripts, need direct access to RAID Controller and MegaCLI installed
lsi
elasticsearch Helper scripts for managing Elasticsearch on the Betaweb cluster.
start_nodes Restart Elasticsearch cluster
restart_nodes Restart Elasticsearch cluster
stop_nodes Restart Elasticsearch cluster
Generated using *webis core update-cheatsheet*. If you find this file to be outdated, rerun this command and push the updated file to the Git server.
#!/bin/bash
# activate vnc on all nodes of the hostlist
# Activate vnc on all nodes of the hostlist
#
# Copyright 2014-today www.webis.de
#
......@@ -34,4 +34,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# starts bios cpu test on all nodes of the hostlist
# Starts bios cpu test on all nodes of the hostlist
#
# Copyright 2014-today www.webis.de
#
......@@ -32,4 +32,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# change lcd message of every node of betaweb to betaweb???
# Change lcd message of every node of betaweb to betaweb???
#
# Copyright 2014-today www.webis.de
#
......@@ -33,4 +33,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# run a command sequential on all betamng nodes
# Run a command sequential on all betamng nodes
#
# Copyright 2014-today www.webis.de
#
......@@ -56,4 +56,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# enable pxe bios boot on all hosts: experimental! hope and prey
# Enable pxe bios boot on all hosts: experimental! hope and prey
#
# Copyright 2014-today www.webis.de
#
......@@ -49,4 +49,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# get boot settings from all nodes
# Get boot settings from all nodes
#
# Copyright 2014-today www.webis.de
#
......@@ -31,4 +31,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# run a command parallel on all betamng nodes
# Run a command parallel on all betamng nodes
#
# Copyright 2014-today www.webis.de
#
......@@ -39,4 +39,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# printout system dump of all hosts for extracting mac addresses
# Printout system dump of all hosts for extracting mac addresses
#
# Copyright 2014-today www.webis.de
#
......@@ -37,4 +37,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# set settings for shutdown on critical temperature
# Set settings for shutdown on critical temperature
#
# Copyright 2015-today www.webis.de
#
......
#!/bin/bash
# open ssh session to one of the betamng nodes (racadm can be used)
# Open ssh session to one of the betamng nodes (racadm can be used)
#
# Copyright 2014-today www.webis.de
#
......@@ -38,4 +38,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# start every node of betamng (parallel)
# Start every node of betamng (parallel)
#
# Copyright 2014-today www.webis.de
#
......@@ -34,4 +34,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# get power status of every node of betamng
# Get power status of every node of betamng
#
# Copyright 2014-today www.webis.de
#
......@@ -32,4 +32,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# shutdown every node of betamng
# Shutdown every node of betamng
#
# Copyright 2014-today www.webis.de
#
......@@ -27,11 +27,11 @@ Usage:
# hard shutdown via:
# > racadm serveraction powerdown
main() {
yes_no_prompt "Are you shure to stop all nodes of betamng?" "n" &&
yes_no_prompt "Are you sure to stop all nodes of betamng?" "n" &&
"$scriptPath/pssh.sh" "racadm serveraction graceshutdown"
}
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# open java vnc session to one of the betamng nodes, via idrac
# Open java vnc session to one of the betamng nodes, via idrac
#
# Copyright 2014-today www.webis.de
#
......@@ -40,4 +40,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# open vnc session to one of the betamng nodes
# Open vnc session to one of the betamng nodes
#
# Copyright 2014-today www.webis.de
#
......@@ -38,4 +38,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# restart hadoop ressource manager on betaweb020 and restarts nodemanager
# Restart hadoop ressource manager on betaweb020 and restarts nodemanager
#
# Copyright 2015-today
#
......@@ -37,4 +37,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# get status of betaweb via salt
# Get status of betaweb via salt
#
# Copyright 2015-today
#
......@@ -34,4 +34,4 @@ main() {
#
# Start programm with parameters.
#
main "$@"
\ No newline at end of file
main "$@"
#!/bin/bash
# check codestyle of project
# Check codestyle of project
#
# Codestyle checker
#
......
#!/usr/bin/env python3
# easter egg
"""
Easter egg
Copyright 2015-today
Project WEBIS
Author: Steve Göring
"""
import os
import sys
import inspect
import time
import shutil
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.insert(0, os.path.abspath(os.path.join(script_dir, "..", "..", "libs")))
from log import *
def main(params):
max_i = shutil.get_terminal_size().columns
for j in range(3):
for i in range(0, max_i):
if i % 2 == 0:
print(" " * i + colorred("ᗧ") + "•" * (max_i - i - 1), end='\r')
else:
print(" " * i + colorgreen("◯") + "•" * (max_i - i - 1), end='\r')
time.sleep(0.15)
for i in reversed(range(0, max_i)):
if i % 2 == 0:
print("•" * i + colorred("ᗤ") + " " * (max_i - i - 1), end='\r')
else:
print("•" * i + colorgreen("◯") + " " * (max_i - i - 1), end='\r')
time.sleep(0.15)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
#!/bin/bash
# install webis to PATH
# Install webis to PATH
#
# Copyright 2015-today
#
......
#!/bin/bash
# remove webis from PATH
# Remove webis from PATH
#
# Copyright 2015-today
#
......
#!/bin/bash
# update local copy of code-webis-cmd/cheatsheet.txt
# Update local copy of code-webis-cmd/cheatsheet.txt
#
# Update Webis command
#
......@@ -47,6 +47,18 @@ export FLAGS_HELP
FLAGS "$@" || exit 1 # Parse command line arguments.
eval set -- "${FLAGS_ARGV}"
#
#
#
generate_cheatsheet() {
echo "WEBIS CHEATSHEET
================
"
./webis.py --helptable
echo "
Generated using *webis core update-cheatsheet*. If you find this file to be outdated, rerun this command and push the updated file to the Git server."
}
#
#
#
......@@ -55,7 +67,7 @@ main() {
logInfo "${scriptPath}"
cd "$webiscmdrootpath"
logInfo "Writing to ${webiscmdrootpath}/${cheatsheetname}"
./webis.py --helptable > ${cheatsheetname}
generate_cheatsheet > ${cheatsheetname}
}
#
......
#!/bin/bash
# update the webis command from Git
# Update the webis command from Git
#
# Update Webis command
#
......
#!/bin/bash
# get webis version
# Get webis version
#
# Copyright 2015-today
#
......
#!/bin/bash
# short description
#
# Test
#
# Copyright 2015-today
#
# Project WEBIS
# Author: Steve Göring
usage() {
echo ""
}
main() {
echo "la $@"
}
#
# Todo
#
main "$@"
\ No newline at end of file
#!/bin/bash
echo "la $@"
ls /
\ No newline at end of file
#!/usr/bin/env python3
print("hello py")
\ No newline at end of file
#!/bin/bash
# get fullname based on login name
# Get user name for a university login
#
# Copyright 2015-today
#
......
#!/bin/bash
# add files from one jar (or other zip) to another one
# Add files from one jar to another
#
# Copyright 2017-today
#
......
#!/bin/bash
# read clipboard and print to stddout
# Print the clipboard to standard output
#
# Copyright 2017-today
#
......
#!/usr/bin/python3
# Process tasks in parallel
# Start and monitor parallel processes
import pydoc
import argparse
......@@ -18,7 +18,7 @@ import re
GLOBAL_DESCRIPTION = """
Work on tasks in parallel.
Start and monitor parallel processes.
"""
......@@ -335,7 +335,7 @@ def shutdown_server(args):
parser = argparse.ArgumentParser(prog=executable, description=GLOBAL_DESCRIPTION)
subparsers = parser.add_subparsers(title="actions", description="")
subparsers.add_parser("help", help="Print usage instructions").set_defaults(which=help)
subparsers.add_parser(parameter_work, help="start one worker process in the background").set_defaults(which=work)
subparsers.add_parser(parameter_work, help="start *one* worker process in the background (use multiple times for multi-threading)").set_defaults(which=work)
subparsers.add_parser(parameter_reload, help="reload the " + tasks_file).set_defaults(which=reload_tasks)
subparsers.add_parser(parameter_stop, help="let running processes fail and exit").set_defaults(which=shutdown_server)
......
#!/bin/bash
# write from stdin to the clipboard
# Fill the clipboard from standard input
#
# Copyright 2017-today
#
......
......@@ -107,11 +107,11 @@ def get_subcommand_help(subcommandpath):
def print_help_table(config):
"""Prints a table with all commands, subcommands, and their descriptions."""
commands = get_commands(config)
for command in commands:
for command in sorted(commands):
command_help = str(config["commands_help"].get(command))
print("{:20s} {}".format(command, command_help))
subcommands = get_subcommands(config, commands[command])
for subcommand in subcommands:
for subcommand in sorted(subcommands):
subcommand_help = str(get_subcommand_help(subcommands[subcommand]))
print(" {:20s} {}".format(subcommand, subcommand_help))
print("")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment