This file contains 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
#!/usr/bin/env bash | |
if [ -z "${KUBE_CONTEXT}" ] | |
then | |
echo Please provide KUBE_CONTEXT | |
exit 1 | |
fi | |
kubectl --context="${KUBE_CONTEXT}" version > /dev/null 2>&1 | |
if [ $? -ne 0 ] |
This file contains 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
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: radwell-blog | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
spec: | |
rules: | |
- http: | |
paths: |
This file contains 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 php:7.4.23-fpm | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
zlib1g-dev libpng-dev libzip-dev libmagickwand-dev \ | |
&& pecl install imagick \ | |
&& docker-php-ext-install -j$(nproc) mysqli gd zip exif \ | |
pdo_mysql opcache \ | |
&& docker-php-ext-enable imagick \ | |
&& apt-get autoremove -y \ |
This file contains 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
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: radwell-code-pv | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
capacity: | |
storage: 2Gi | |
hostPath: |
This file contains 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: radwell-blog-db | |
labels: | |
app: radwell-blog | |
tier: backend | |
spec: | |
replicas: 1 | |
selector: |
This file contains 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
[Unit] | |
Description=Minikube Kubernetes service | |
After=docker.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/local/bin/minikube start | |
ExecStop=/usr/local/bin/minikube stop | |
User=jsmith | |
Group=jsmith |
This file contains 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 TABLE user ( | |
id INT(10) UNSIGNED PRIMARY KEY, | |
name VARCHAR(128) NOT NULL, | |
email VARCHAR(128) NOT NULL, | |
country_code CHAR(2) DEFAULT NULL, | |
country_name VARCHAR(60) DEFAULT NULL | |
); | |
CREATE TABLE country ( | |
id INT(10) UNSIGNED PRIMARY KEY, |
This file contains 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
--- | |
# 3 replicas for redundancy | |
replicas: 3 | |
resources: | |
requests: | |
cpu: 25m | |
memory: 25Mi | |
limits: | |
cpu: 90m | |
memory: 50Mi |
This file contains 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 -e | |
if [[ -z "${1}" ]] | |
then | |
echo "Missing argument s3_path" >&2 | |
echo "Usage: ${0} <s3_path> [<profile>]" | |
exit 1 | |
fi | |
s3_path=${1} |
This file contains 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
<?php | |
mysql_connect("localhost","<username>","<password>");mysql_select_db("<dbname>"); | |
if (isset($_GET['rt']) && isset($_GET['mode'])) { | |
if($_GET['mode']=='count') { | |
$query="SELECT count(distinct userid) FROM user_online WHERE online_date>DATE_SUB(NOW(),INTERVAL 310 SECOND)"; | |
$count=mysql_fetch_row(mysql_query($query)); | |
echo $count[0]; | |
} elseif ($_GET['mode']=='users') { | |
$query="SELECT users.username,users.userid FROM user_online,users WHERE online_date>DATE_SUB(NOW(),INTERVAL 6 SECOND) AND users.userid=user_online.userid AND user_online.userid NOT IN (SELECT userid FROM user_online WHERE online_date>DATE_SUB(NOW(),INTERVAL 310 SECOND) AND online_date<DATE_SUB(NOW(),INTERVAL 6 SECOND))"; | |
$data=mysql_query($query); |
NewerOlder