Skip to content

Instantly share code, notes, and snippets.

View rhopp's full-sized avatar

Radim Hopp rhopp

  • Red Hat
View GitHub Profile
@rhopp
rhopp / minusDay.sh
Last active August 29, 2015 14:02
This script decreases time by one day for usage events in given workspace.
#/bin/bash
if [[ -z "$1" ]] ; then
echo "This script needs parameter pointing to eclipse workspace"
elif ! [[ -d $1 ]] ; then
echo "$1 is not a directoryr"
elif ! [[ -d "$1/.metadata/.plugins/org.jboss.tools.usage/events" ]] ; then
echo "$1 does not contain .metadata/.plugins/org.jboss.tools.usage/events subdirectory (perhaps JBoss Tools Usage was not allowed?)"
else
FILES="$1/.metadata/.plugins/org.jboss.tools.usage/events/*"
for f in $FILES
➜ temp ls -la tern*
-rw-rw-r--. 1 rhopp rhopp 12893822 3. říj 00.21 ternjs_1.0.0.201508302102.jar
-rw-rw-r--. 1 rhopp rhopp 12893822 3. říj 00.21 ternjs_1.0.0.201508302102.jar.1
-rw-rw-r--. 1 rhopp rhopp 12893822 3. říj 00.21 ternjs_1.0.0.201508302102.jar.2
-rw-rw-r--. 1 rhopp rhopp 12893822 3. říj 00.21 ternjs_1.0.0.201508302102.jar.3
-rw-rw-r--. 1 rhopp rhopp 12893822 3. říj 00.21 ternjs_1.0.0.201508302102.jar.4
➜ temp md5sum ternjs_1.0.0.201508302102.jar
c1a84f0cfee1957949e838ed26c3dfd4 ternjs_1.0.0.201508302102.jar
➜ temp md5sum ternjs_1.0.0.201508302102.jar.1
c1a84f0cfee1957949e838ed26c3dfd4 ternjs_1.0.0.201508302102.jar.1
@rhopp
rhopp / start_workspace_and_wait.sh
Last active February 26, 2018 14:43
start_workspace_and_wait
#!/bin/bash
# Usage: start_workspace_and_wait.sh <nubmer_of tries>
# Script calls local che-starter to start workspace/get workspaces.
# It expects variable ACTIVE_TOKEN to be set.
# When asking whether workspace is already running, it wait 6 seconds between every try.
# Script ends after this count or when workspace is succesfully started or when workspace switches from STARTING to STOPPED state.
if [ -z ${ACTIVE_TOKEN} ]; then
echo "ACTIVE_TOKEN not set"
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "simple-pod",
"creationTimestamp": null,
"labels": {
"name": "simple-pod"
}
},
@rhopp
rhopp / README
Last active April 19, 2018 13:13
che-stress script
Both scripts expects file "users.tokens" with as many user active tokens as needed (one token per line)
# che-stress.py
Usage:
* Replace URL in the file (currently there is che-starter from prod-preview) on line 15
* Chose how many create workspace requests should be sent per user - variable `workspacesCount` on line 5
* run `python che-stress.py`. This creates thread for each user and sends `workspacesCount` requests.
# che-cleanup.py
This script deletes all workspaces for given users
import json
class Participant:
wars = 0
battles = 0
wins = 0
didntPlayWar = 0
p={}
#!/bin/bash
ACTIVE_TOKEN=<REPLACE WITH ACTUAL ACTIVE TOKEN>
for i in `seq 1 70`;
do
JSON=$(cat default.json | jq ".name=\"test$i\"")
echo $JSON | jq .name
curl -w "%{time_total}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ACTIVE_TOKEN" --data "$JSON" "<REPLACE WITH ACTUAL CHE SERVER URL>/api/workspace"
done
---
specVersion: 0.0.1
name: apache-camel-user-story-v3
projects:
- name: spring-boot-camel
clonePath: spring-boot-camel
source:
type: git
location: https://github.com/bfitzpat/spring-boot-camel.git
components:
## Summary
## New Blockers (1)
https://github.com/eclipse/che/issues/13823 - Go sample `permission denied` issues with dependencies
## Issues Added to 7.0.0 (1)
https://github.com/eclipse/che/issues/13828 - chectl workspace:start fails for multi-user Che
## Issues added to 7.1.0 (1)
https://github.com/eclipse/che/issues/13832 - Apache Camel devfile not starting on Hosted Che
AddWorkspaceToOrganizationTest - known permanent issue - bug with RAM (@sergii to provide issue link)
SwaggerTest - don't depend on workspace or remove completely
DirectUrlFactoryWithKeepDirectoryTest - known permanent issue - rewrite to not fail - for now it's excluded because of permanent failure
DirectUrlFactoryWithKeepDirectoryTest.teardown - NPE - investigate
DirectUrlFactoryWithRootFolderTest.teardown - NPE - investigate
DirectUrlFactoryWithSpecificBranchTest - known permanent issue - @sergii provide issue
DirectUrlFactoryWithSpecificBranchTest.deleteTestBranch - NPE - investigate
TheiaBuildPluginTest - disable
CreateAndDeleteProjectsTest - fix
CreateWorkspaceTest - fix