Skip to content

Instantly share code, notes, and snippets.

View omersiar's full-sized avatar

Ömer Şiar Baysal omersiar

  • Earth
View GitHub Profile
@omersiar
omersiar / bagaj.ino
Last active February 9, 2023 18:00
bagaj
#include <ESP8266WiFi.h>
#ifndef WIFISSID
#define WIFISSID ""
#define WIFIPASS ""
#endif
#define RELAY 5
const char* ssid = WIFISSID;
@omersiar
omersiar / create-scram-user.py
Last active August 15, 2022 05:55
Create SCRAM user directly on Zookeeper for Apache Kafka to use it without AdminClient API
#!/usr/bin/env python3
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, Lev Goncharov <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
@omersiar
omersiar / change-docker-data-directory.sh
Last active August 9, 2021 09:04
Change docker's default data directory
# Make sure that we have rsync installed
yum install -y rsync
# Make a copy of original unit file
cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
# Add data directory string
sed -i 's/\(containerd.sock\)/\1 -g \/opt\/lib\/docker/' /lib/systemd/system/docker.service
# Test files
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: filebeat
labels:
k8s-app: filebeat
rules:
- apiGroups: [""] # "" indicates the core API group
resources:
apiVersion: apps/v1
kind: Deployment
metadata:
name: kibana-logging
namespace: elasticsearch
labels:
k8s-app: kibana-logging
spec:
replicas: 1
selector:
@omersiar
omersiar / aternity.2
Created October 19, 2020 08:49
aternity2
5nQtCw2eq246y91MgzqAfn6sTWNRbgdlg==rkWdmTaluGWhvb8/6H19/3S0rAl5oIdKpQTRybHa9PzkkwHthxOPuw8juJ4/VLNpn37PkaK4gFxuI5pVwnw5fw==
Foreach ($i in (Get-Disk).Number | Where-Object {$_ -gt 1}) { Get-Disk $i | Clear-Disk -RemoveData -Confirm:$false; Initialize-Disk -Number $i; Get-Disk $i | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -Confirm:$false}
Foreach ($i in (Get-Disk).Number | where-object {$_ -ne 0}) { $i + 1 }
- name: add disk
vmware_guest_disk:
hostname: "{{ vcenter_host }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: False
datacenter: "{{ vcenter_host }}"
name: "{{ target_host }}"
disk:
- size_gb: 2