Skip to content

Instantly share code, notes, and snippets.

View arajkumar's full-sized avatar
🏡

Arunprasad Rajkumar arajkumar

🏡
View GitHub Profile
@arajkumar
arajkumar / docker-push-proxy.sh
Created April 29, 2020 08:23
Alpine Linux on AWS for docker push
sudo apk add vim git docker docker-cli
sudo service docker start
git clone https://github.com/arajkumar/f8a-server-backbone.git
cd f8a-server-backbone
git checkout v2_changes
sudo docker build . -t ararunprasad/backbone_v2
sudo docker login
sudo docker push ararunprasad/backbone_v2
@arajkumar
arajkumar / hello.py
Created May 19, 2020 05:46
Pydantic and Flask formdata validation
from flask import Flask
from flask import request
from werkzeug.datastructures import FileStorage
from pydantic import BaseModel
app = Flask(__name__)
class FormData(BaseModel):
file_path: str
@arajkumar
arajkumar / app.py
Created May 22, 2020 12:04
Blueprint and Flask_restful
from flask import Flask
from example_blueprint import example_blueprint
app = Flask(__name__)
app.register_blueprint(example_blueprint)
app.run(host='127.0.0.1', port=5000, debug=True)
diff --git a/integration-tests/Dockerfile b/integration-tests/Dockerfile
index fea9955..a4af049 100644
--- a/integration-tests/Dockerfile
+++ b/integration-tests/Dockerfile
@@ -5,12 +5,12 @@ ENV LANG=en_US.UTF-8 \
NOVENV=1
RUN yum install -y epel-release &&\
- yum install -y gcc which python34-pip python34-devel centos-release-openshift-origin36 &&\
+ yum install -y gcc which python36-pip python36-devel centos-release-openshift-origin36 &&\
apiVersion: v2
publisher: redhat
name: dependency-analytics
version: 0.1.0
type: VS Code extension
displayName: Dependency Analytics
title: Insights about your application dependencies
description: Insights about your application dependencies, Security, License compatibility and AI based guidance to choose appropriate dependencies for your application.
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension
@arajkumar
arajkumar / ImageManifestVuln.yaml
Created September 30, 2020 10:59
ImageManifestVuln obj with Clairv4, Snyk and Quay API changes
apiVersion: secscan.quay.redhat.com/v1alpha1
kind: ImageManifestVuln
metadata:
selfLink: >-
/apis/secscan.quay.redhat.com/v1alpha1/namespaces/quay-enterprise/imagemanifestvulns/sha256.cf785e739b3aeba8f7553b17560a4cd7d9b2a91ea9e453aa6fa5cb0b83e9ed2b
resourceVersion: '113932'
name: sha256.cf785e739b3aeba8f7553b17560a4cd7d9b2a91ea9e453aa6fa5cb0b83e9ed2b
uid: e1d548b6-2d13-427f-abba-c27b76e54c3e
creationTimestamp: '2020-09-30T10:54:23Z'
generation: 1
def cleanup_db_tables(self):
"""Cleanup RDS data tables on a periodic basis."""
def clean_celery_taskmeta():
num_days = os.environ.get('KEEP_DB_META_NUM_DAYS', '30')
self.cleanup_tables('celery_taskmeta', 'date_done', num_days)
def clean_worker_results()
num_days = os.environ.get('KEEP_WORKER_RESULT_NUM_DAYS', '30')
self.cleanup_tables('worker_results', 'ended_at', num_days)
This file has been truncated, but you can view the full file.
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
@arajkumar
arajkumar / test_requests_futures.py
Created January 25, 2021 06:33
test_requests_futures.py
# https://pypi.org/project/requests-futures/
from requests_futures.sessions import FuturesSession
from concurrent.futures import wait, ALL_COMPLETED
from time import time
concurrent_limit = 10
total_reqs = 10
each_request_duration = 5 # simulated delay
completion_timeout = 11
# https://pypi.org/project/requests-futures/
from requests_futures.sessions import FuturesSession
from concurrent.futures import wait, ALL_COMPLETED
from time import time
concurrent_limit = 10
total_reqs = 10
each_request_duration = 5 # simulated delay
completion_timeout = 11