Skip to content

Instantly share code, notes, and snippets.

View abderrazak-bouadma's full-sized avatar
👻
DevOps

Abderrazak BOUADMA abderrazak-bouadma

👻
DevOps
  • Binance
View GitHub Profile
{
"Sid": "Stmt1234",
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:us-west-2:111111111111:QueueName",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "arn:aws:sns:us-west-2:555555555555:TopicName"
}
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": "*"
},
{
@abderrazak-bouadma
abderrazak-bouadma / gist:932c7aa4c0a804a709e881fbac45b6fc
Created January 14, 2024 19:33
ssm_designated_aws_account.tf
provider "aws" {
region = "your_aws_region"
}
data "aws_caller_identity" "current" {}
resource "aws_iam_policy" "ssm_access_policy" {
name = "SSMAccessPolicy"
description = "Policy for AWS SSO role to access AWS Systems Manager"
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
provider "aws" {
region = "your_aws_region"
}
resource "aws_elasticache_subnet_group" "example" {
name = "example"
subnet_ids = ["subnet-xxxxxxxxxxxxxxxxx", "subnet-yyyyyyyyyyyyyyyyy"]
}
resource "aws_elasticache_parameter_group" "example" {
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
@abderrazak-bouadma
abderrazak-bouadma / install_jenkins_swarm_jar.yml
Created November 27, 2023 14:26
ansible playbook to install jenkins swarm
---
- name: Download JAR file
hosts: your_vm_group
become: yes
tasks:
- name: Create directory for JAR file
file:
path: /path/to/destination/directory
state: directory
import random
def take_matches(matches, max_take):
# L'ordinateur prend des allumettes au hasard, mais en garantissant qu'il ne prend pas la dernière.
computer_choice = random.randint(1, max_take)
if matches - computer_choice == 1:
computer_choice = 1
return computer_choice
def main():
@abderrazak-bouadma
abderrazak-bouadma / convert-vmdk-to-fixed-vhd.ps1
Created September 11, 2018 08:33
converts a VMware vmdk to an Azure compatible fixed VHD
# converts a VMware vmdk to an Azure compatible fixed VHD
# to use the VHD you've then to upload into a storage container as a BlobPage
# then create a Managed Disk
# then create a VM from that Managed Disk
#
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath disk1.vmdk -VhdType Fixed -VhdFormat vhd -destination disk1.vhd
#!/bin/bash
docker run --name myxedb \
-d \
-p 51521:1521 \
-p 55500:5500 \
-e ORACLE_PWD=mysecurepassword \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-v /Users/abdenourbali/work/Docker/dockxedb/oradata:/opt/oracle/oradata \
-v /Users/abdenourbali/work/Docker/dockxedb/data/scripts/setup:/opt/oracle/scripts/setup \