Skip to content

Instantly share code, notes, and snippets.

@cdalar
cdalar / id_rsa.pub
Created February 16, 2024 12:21
id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD51xmKoZUs7kgI6VDaWAs+Y3Yui/pPQR56fj0AKTtLhrNZI7hk+aA40UA+va6vkjZ+HE1bv/69voStKV4aQGCTRJPVBxWb4ep/OOrkMhHcY9sJ65cyarSkJfs0tX70AjQazXQzEgbfGCzeNd6wUcfAAlHAq63N1OPnX1hOymvbXk2ucoRV08CzoDXCWoFiwPyZ6kf9CPdFZ8u6xsmPRO/qUXKovwZKJmHRhQ/FYxNWMoOfgNYuB+j3t2n755Fq/kon4o6sPH+cWCN/sYzhmPA57C05hwDikayOYVRIjE6dpEMBAi2nypUKq3WtONW0NEAsAuoSuqakSYXdL7u/oB5V2AVhzZx9LQf4zDXm0pmopS9sUX3oB2O9dMtPZygzQp/2fy2BOTCiapLbGi1ZEwuKRTsnRM8inUWDpIEaXYY3Q7JBn43Dfm10zrordRbH23HQP31ixY1g3RrtlshburD0jadnhNLzPLgrc7p0GX1IzSTL7/Z8XDeehXCXOcOij6M= cd@local
@cdalar
cdalar / cloud-init-ssh-443-RHEL.config
Created February 1, 2024 08:22
Cloud init file for enabling SSHD on port 443 for Redhat RHEL.
#cloud-config
runcmd:
- sudo sed -i 's/Port 22/Port 443/g' /etc/ssh/sshd_config
- sudo echo "Port 443" >> /etc/ssh/sshd_config
- sudo semanage port -m -t ssh_port_t -p tcp 443
- sudo firewall-cmd --permanent --add-port=443/tcp
# - sudo systemctl stop firewalld.service
- sudo systemctl restart sshd.service
@cdalar
cdalar / main.py
Created July 10, 2023 11:47
python jinja2 template example
#!.venv/bin/python
import jinja2, sys
import configparser
from collections import defaultdict
def ini_to_dict(ini_path):
config = configparser.ConfigParser()
config.read(ini_path)
ini_dict = defaultdict(dict)
@cdalar
cdalar / gist:4ea147cd0715d96fa0ec5d6f8beed96c
Created June 16, 2021 20:21
sleeping ubuntu:20.04 for testing
apiVersion: v1
kind: Pod
metadata:
name: test
labels:
app: ubuntu
spec:
containers:
- image: ubuntu:20.04
command:
@cdalar
cdalar / script-for-enabling-nodegroup-metrics.sh
Created March 31, 2021 17:37
Enabling Group Metrics Collection for NodeGroup of AWS EKS and Capacity Alarm.
# Get's the FIRST Cluster on list-clusters. Assuming you only have 1 EKS
EKS_CLUSTER_NAME=$(aws eks list-clusters --region=eu-central-1 | jq -r .clusters[0])
echo $EKS_CLUSTER_NAME
# First NodeGroup from the list.
NG=$(aws eks list-nodegroups --cluster-name $EKS_CLUSTER_NAME | jq -r '.nodegroups[0]')
echo $NG
# First Autoscaling Group Name
ASG_NAME=$(aws eks describe-nodegroup --cluster-name $EKS_CLUSTER_NAME --nodegroup-name $NG | jq -r '.nodegroup.resources.autoScalingGroups[0].name')
# Enable Autoscaling Group Metrics
///
// Generated code. Do not modify.
// source: helloworld.proto
//
// @dart = 2.3
// ignore_for_file: camel_case_types,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
cd@Cemals-MacBook-Pro ~/realnetapi> dotnet test
Build started, please wait...
Build started, please wait...
Build started, please wait...
Build started, please wait...
Build started, please wait...
Build started, please wait...
Build completed.
Test run for /Users/cd/realnetapi/RealNetApi.Core/bin/Debug/netcoreapp2.0/RealNetApi.Core.dll(.NETCoreApp,Version=v2.0)