Skip to content

Instantly share code, notes, and snippets.

View devenes's full-sized avatar
☁️

Enes devenes

☁️
View GitHub Profile
i=0
while test 1==1
do
remote_ip=10.25.10.10
remote_user=enes
local_port=22
exist=`ps aux | grep $remote_user@$remote_ip | grep $local_port`
if test -n "$exist"
then
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
kc job pi2000 --image=perl -o yaml --dry-run > pi2000.yaml
### edit the file, edit the name, remove any ID references and include the command argument under container spec.
@devenes
devenes / engineer.py
Created September 15, 2022 09:23
Happy Engineer's Day! 2022
print('Happy Engineer\'s Day! 2022')
print('\n'.join
([''.join
([('Engineer'[(x-y) % 8]
if ((x*0.05)**2+(y*0.1)**2-1)
** 3-(x*0.05)**2*(y*0.1)
** 3 <= 0 else ' ')
for x in range(-30, 30)])
for y in range(15, -15, -1)]))
package main
import (
"fmt"
"github.com/pbnjay/memory"
)
func main() {
fmt.Printf("Total system memory: %d GB\n", memory.TotalMemory()/1024/1024/1024)
if [ $(cat /etc/os-release | awk -F '=' '/^ID=/ {print $2}' | cut -d '"' -f 2) = "amzn" ]; then
echo "Amazon Linux"
elif [ $(cat /etc/os-release | awk -F '=' '/^ID=/ {print $2}' | cut -d '"' -f 2) = "ubuntu" ]; then
echo "Ubuntu"
else
echo "Unsupported OS"
exit 1
fi
@devenes
devenes / Cloud-Practitioner.md
Created August 27, 2022 16:37
AWS - Cloud Practitioner Cert Practise

AWS - Cloud Practitioner

A summary of what you need to know for the exam can be found here

Cloud 101

What types of Cloud Computing services are there?

IAAS

@devenes
devenes / publicize.md
Created June 25, 2022 23:07
publicize your membership
curl -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <YOUR_GITHUB_TOKEN>" \
-H "Content-Length: 0" \
-X PUT \
https://api.github.com/orgs/EpicGames/public_members/devenes
@devenes
devenes / spotEC2.md
Created June 11, 2022 18:26
the prices of spot instances

See the prices of spot instance with the following command

aws ec2 describe-spot-price-history  --start-time 2022-05-11T12:00:00 \
	--filters "Name=instance-type,Values='t3.medium','t4g.medium','t3a.medium','t2.medium','c3.large','m4.large'" \
	--product-description "Linux/UNIX" --query 'SpotPriceHistory[*].[AvailabilityZone,InstanceType,SpotPrice,Timestamp]' \
	--output table --region us-east-1|sort -r +4
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#003543",
"foreground": "#fff",
"powerline_symbol": "\ue0b0",