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: nginx-deployment-dojo | |
labels: | |
app: ng-dep-dojo | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
/* CSS for overriding styles with high specificity */ | |
h3#problem-description, | |
h3#problem-constraints, | |
h3#input-format, | |
h3#output-format, | |
h3#example-input, | |
h3#example-output { | |
font-family: Arial, sans-serif !important; | |
color: #2b2b2b !important; | |
font-size: 1.5rem !important; |
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 | |
# Create some directories and files | |
mkdir -p /var/www/html | |
mkdir -p /var/backups | |
mkdir -p /etc/company | |
# Create users and groups | |
groupadd webadmin | |
useradd -m -G webadmin alice |
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
import csv | |
from bs4 import BeautifulSoup | |
def extract_first_image_url(html_string): | |
soup = BeautifulSoup(html_string, 'html.parser') | |
img_tag = soup.find('img') | |
if img_tag: | |
img_url = img_tag.get('src') |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Kids Tic Tac Toe</title> | |
<style> | |
body { | |
background-color: #FFD700; | |
font-family: Arial, sans-serif; | |
text-align: center; | |
} |
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
import openai | |
openai.api_key = "TOKEN" | |
completion = openai.ChatCompletion.create( | |
model="gpt-3.5-turbo", | |
messages=[{"role": "user", "content": "Reply as a Vedic Scholar."}] | |
) | |
print(completion) |
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
vpc="vpc-01c4ba22f251d0831" | |
aws ec2 describe-internet-gateways --filters 'Name=attachment.vpc-id,Values='$vpc | grep InternetGatewayId | |
aws ec2 describe-subnets --filters 'Name=vpc-id,Values='$vpc | grep SubnetId | |
aws ec2 describe-route-tables --filters 'Name=vpc-id,Values='$vpc | grep RouteTableId | |
aws ec2 describe-network-acls --filters 'Name=vpc-id,Values='$vpc | grep NetworkAclId | |
aws ec2 describe-vpc-peering-connections --filters 'Name=requester-vpc-info.vpc-id,Values='$vpc | grep VpcPeeringConnectionId | |
aws ec2 describe-vpc-endpoints --filters 'Name=vpc-id,Values='$vpc | grep VpcEndpointId | |
aws ec2 describe-nat-gateways --filter 'Name=vpc-id,Values='$vpc | grep NatGatewayId | |
aws ec2 describe-security-groups --filters 'Name=vpc-id,Values='$vpc | grep GroupId | |
aws ec2 describe-instances --filters 'Name=vpc-id,Values='$vpc | grep InstanceId |
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 | |
sudo apt update -y | |
sudo apt install apache2 -y | |
sudo systemctl start apache2 | |
#Now open the IP address of the server | |
#Now stop the server to update the file | |
sudo systemctl stop apache2 | |
cd /var/www/html/ | |
sudo rm index.html |
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
import os | |
import json | |
import redis | |
import pymysql | |
class DB: | |
def __init__(self, **params): | |
params.setdefault("charset", "utf8mb4") |
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
sudo yum update -y | |
sudo amazon-linux-extras install java-openjdk11 -y | |
java -version | |
sudo yum install git -y | |
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo | |
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key | |
sudo yum install jenkins -y | |
sudo systemctl start jenkins | |
sudo systemctl enable jenkins | |
sudo systemctl status jenkins |
NewerOlder