Skip to content

Instantly share code, notes, and snippets.

View jarifibrahim's full-sized avatar
🎯
Focusing

Ibrahim Jarif jarifibrahim

🎯
Focusing
View GitHub Profile
@jarifibrahim
jarifibrahim / create-workspace.sh
Created January 25, 2019 09:17
Create Che workspace from devfile
curl -X POST \
--header 'Content-Type: application/yaml' \
--header "Authorization: Bearer $tkn" \
--data '---
specVersion: 0.0.1
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
@jarifibrahim
jarifibrahim / testscript.sh
Created January 9, 2019 13:26
Launcher backend failure
#! /bin/bash
set +x
pid=$(pidof "java")
# Let's bombard the server with reindex requests
for i in {1..15}
do
# Using random sleep time
@jarifibrahim
jarifibrahim / testscript.sh
Created January 9, 2019 13:22
Booster Catalog empty reponse
# Bombard launcher-backend with reindex API
for i in {1..5}
do
curl --silent -X GET "http://localhost:8080/api/booster-catalog" -H "accept: application/json" > /dev/null
curl -H "Content-Type: application/json" -X POST -d '{}' "http://localhost:8080/api/booster-catalog/reindex?token=abc"
curl --silent -X GET "http://localhost:8080/api/booster-catalog" -H "accept: application/json" > /dev/null
curl --silent -X GET "http://localhost:8080/api/booster-catalog" -H "accept: application/json" > /dev/null
curl -H "Content-Type: application/json" -X POST -d '{}' "http://localhost:8080/api/booster-catalog/reindex?token=abc"
# Using random sleep time
sleep 0.$[ ( $RANDOM % 100 ) + 1]s
@jarifibrahim
jarifibrahim / nodejs-crud-stack.json
Created November 20, 2018 11:19
Nodejs with Postgres database
{
"name": "Nodejs Postgres Stack",
"components": [],
"tags": [
"Nodejs",
"Postgres"
],
"id": "stackgk84089624ggoip2",
"workspaceConfig": {
"defaultEnv": "default",
FROM centos:7
ENV LANG=en_US.utf8
RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
RUN yum -y install nodejs gcc-c++ make git wget
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
RUN yum -y install ./google-chrome-stable_current_*.rpm
RUN git clone https://github.com/fabric8-ui/fabric8-planner.git
RUN cd fabric8-planner
#!/bin/sh
# Verify testing setup is working
status_code=$(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:8088/)
if [ $status_code != "200" ]
then
echo "Vertical setup not working"
exit
else
echo "Vertical setup working"
#!/usr/bin/env python
# Script to automatically populate top-starred-devs-and-repos Readme file
import re
import urllib2
from bs4 import BeautifulSoup
f = open("README.md", 'r')
new_file = open("test.md", 'w')