Skip to content

Instantly share code, notes, and snippets.

View oguzhalit's full-sized avatar
Present Day.. Present Time!

oguzhalit oguzhalit

Present Day.. Present Time!
View GitHub Profile
@ssg
ssg / tdsn.pas
Created August 24, 2010 01:06
Turkish DemoScene News reader
{ - arteffect tdsn reader - (c) 1997 SSG/arteffect - 28th Sep 97 - 15:54 - }
uses
XStream,XColl,XBuf,XMouse,Objects,qText,XStr,Dos;
type
PArticle = ^TArticle;
TArticle = record
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 21, 2024 20:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@richadams
richadams / aws_security_group_details.sh
Last active February 23, 2024 20:46
A quick and dirty script to list out all security group settings on an AWS account. Barely tested, use at own risk, etc. Requires awscli to be installed.
#!/bin/bash
# Requires: awscli (http://aws.amazon.com/cli/)
# Prints out a list of all security groups and their settings, just for quickly auditing it.
# Your AWS credentials
if [ -z ${AWS_ACCESS_KEY_ID} ]; then
export AWS_ACCESS_KEY_ID='***'
export AWS_SECRET_ACCESS_KEY='***'
fi
@Khoulaiz
Khoulaiz / gist:41b387883a208d6e914b
Last active June 10, 2024 15:36
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@superseb
superseb / rancher2ha_selfsigned_layer4lb.md
Last active March 29, 2022 17:58
Install Rancher 2.0 HA by using self signed certificates (+ intermediate) and Layer 4 Loadbalancer (TCP)

Install Rancher 2.0 HA by using self signed certificates (+ intermediate) and Layer 4 Loadbalancer (TCP)

Warning: the RKE install method is only supported up to v2.0.8!

This gist describes how to setup Rancher 2 HA, by using self signed certificates (with intermediate) and a Layer 4 Loadbalancer (TCP)

Requirements

  • Linux OS
  • OS Binaries

type tmux in terminal

Windows:

  • Create new window: Ctrl+b c
  • Move to next window: Ctrl+b n
  • Move to previos window: Ctrl+b p
  • List all wondows: Ctrl+b w

Panes/Split:

@pahud
pahud / ecs-task-export-import.sh
Last active April 24, 2024 18:20
ECS Task export/import
# export the task def
family='TaskDefName'
$ aws ecs describe-task-definition --task-definition $family \
--query "taskDefinition.{family:family, taskRoleArn:taskRoleArn, executionRoleArn:executionRoleArn, networkMode:networkMode, containerDefinitions:containerDefinitions, volumes:volumes, placementConstraints:placementConstraints, requiresCompatibilities:requiresCompatibilities, cpu:cpu, memory:memory, tags:tags, pidMode:pidMode, ipcMode:ipcMode, proxyConfiguration:proxyConfiguration}" | jq 'del(.[] | nulls)' > taskDef.json
# import the task def into newFamily task family
$ aws ecs register-task-definition --cli-input-json file://taskDef.json --family newFamily
# one-liner
aws ecs describe-task-definition --task-definition $family \
@prakasha4devops
prakasha4devops / docker_cert_notes.txt
Created October 8, 2019 15:37 — forked from miguelmota/docker_cert_notes.txt
Docker Certified Associate (DCA) prep notes
tiers-basic:platform for certified infrastructure, standard:advanced image and container management, LDAP,RBAC , advanced:security scanning
docker swarm:clustering and scheduling tool
docker swarm manager:responsible for validating, logging the state of and distributing instructions to docker swarm workers
docker service daemon is installed on every node in a swarm (manager or worker)
managers:use a consensus algorithm to maintain quorum (require a min of 2 managers)
workers: register with managers and receive workloads from them
services:an application that exist and hosted across workers
RBAC:roll based access control
/etc/docker/daemon.json
/var/lib/docker/containers
@jossef
jossef / force-delete-k8s-namespace.py
Created August 13, 2020 12:50
force delete k8s namespace
#!/usr/bin/env python3
import atexit
import json
import requests
import subprocess
import sys
namespace = sys.argv[1]
proxy_process = subprocess.Popen(['kubectl', 'proxy'])
atexit.register(proxy_process.kill)
@t2wu
t2wu / gist:ce286e0883fe10cd54b664be17bf63fe
Created January 6, 2022 12:52
Create secret for K8S to access AWS ECR
kubectl create secret docker-registry regcred \
--docker-server=<aws-account-id>.dkr.ecr.<aws-region>.amazonaws.com \
--docker-username=AWS \
--docker-password=$(aws ecr get-login-password) \
-o yaml
# This creates the regcred secret and at the same time output YAML to standard output which you
# can store elsewhere. In my case I have two machines, one having aws and the other having kubectl.
# So I run "aws ecr get-login-password" on one machine and paste the result to replace
# $(aws ecr get-login-password).