This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting profile | |
103902924 function calls (94145786 primitive calls) in 95.641 seconds | |
Ordered by: cumulative time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
1 0.000 0.000 95.641 95.641 core_v1_api.py:13605(list_pod_for_all_namespaces) | |
1 0.000 0.000 95.641 95.641 core_v1_api.py:13633(list_pod_for_all_namespaces_with_http_info) | |
1 0.000 0.000 95.641 95.641 api_client.py:291(call_api) | |
1 1.028 1.028 95.641 95.641 api_client.py:110(__call_api) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <errno.h> | |
pid_t Fork(void) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pid_t Fork(void) | |
{ | |
pid_t pid = fork(); | |
if (pid < 0) | |
{ | |
perror("Error, while calling fork\n"); | |
exit(EXIT_FAILURE); | |
} | |
return pid; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:9.3.0-onbuild | |
COPY ./ /usr/src/app | |
RUN npm install | |
EXPOSE 3000 | |
ENTRYPOINT ["npm"] | |
CMD ["run", "start"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' Create a virtualenv with python3 or run with default os installation (adjust the sheband based on you enviornment) | |
Install script dependencies with pip (requests, beautifulsoup4, lxml | |
make the script executable with chmod +x crawler.py | |
run the script with ./crawler.py | |
''' | |
#!/usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
apt-get update | |
apt-get install -y docker-ce | |
usermod -aG docker ubuntu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ambassador", | |
"app_id": "7043185f", | |
"type": "ionic-angular", | |
"integrations": { | |
"cordova": {} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 | |
52 | |
53 | |
#!/bin/bash | |
# Admin User | |
MONGODB_ADMIN_USER=${MONGODB_ADMIN_USER:-"admin"} | |
MONGODB_ADMIN_PASS=${MONGODB_ADMIN_PASS:-"4dmInP4ssw0rd"} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: disable-transparent-hugepages | |
# Required-Start: $local_fs | |
# Required-Stop: | |
# X-Start-Before: mongod mongodb-mms-automation-agent | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Disable Linux transparent huge pages | |
# Description: Disable Linux transparent huge pages, to improve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' Problem link: https://www.codechef.com/problems/SNAKEEAT | |
Approach | |
1: Get the maximum index x for which a[x] < K | |
2: set the search space for L with lower bound of 0 and upper bound of x+1 | |
3: find the maximum value of l for which eq. K*L - sum(X-L+1,X) <= X-L+1 holds true | |
''' | |
def getValue(a,num): | |
'''Return the largest value of i for which a[i] < k''' | |
low = 0 |
NewerOlder