Skip to content

Instantly share code, notes, and snippets.

View lacoski's full-sized avatar
😀
An Introvert Engineer

Nguyễn Bá Thành lacoski

😀
An Introvert Engineer
View GitHub Profile
@lacoski
lacoski / encoded-20201212150102.txt
Created May 4, 2024 00:33 — forked from thegreatestminer/encoded-20201212150102.txt
MobaXTerm Professional x64 License Key [READ COMMENTS]
UEsDBBQAAAAIABNQjFGCf/GfLgAAACwAAAAHAAAAUHJvLmtleTMqdncpCXQOKDAp9woMzEo1MTVOrHAzTjTLME7VNs1LK8owTjQpcU8tcuLlAgBQSwECFAAUAAAACAATUIxRgn/xny4AAAAsAAAABwAAAAAAAAAAAAAAAAAAAAAAUHJvLmtleVBLBQYAAAAAAQABADUAAABTAAAAAAA=
@lacoski
lacoski / fluent-filebeat-comparison.md
Created November 7, 2023 09:20 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
labels:
k8s-app: fluent-bit
data:
# Configuration files: server, input, filters and output
# ======================================================
@lacoski
lacoski / tfsec.gitlab-ci.yml
Created February 23, 2023 17:01 — forked from sumansrivastava/tfsec.gitlab-ci.yml
pipeline for tfsec code
stages:
- test
unit_test:
stage: test
image:
name: tfsec/tfsec-ci
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
script:
@lacoski
lacoski / CloudWatchAgentConfig.json
Created January 18, 2023 19:56 — forked from csereno/CloudWatchAgentConfig.json
AWS CloudWatch Agent configuration file example for Linux with standard /var/log/messages, secure, and yum logs
{
"agent": {
"metrics_collection_interval": 10,
"logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log"
},
"metrics": {
"metrics_collected": {
"cpu": {
"resources": [
"*"

Gist for https://www.youtube.com/watch?v=38di3_iVDIA

Commands

  • kopia repository create s3 --bucket=<<bucketId>>
  • kopia repository validate-provider
  • kopia repository status
  • kopia snapshot create /var/lib/jenkins
  • kopia snapshot list
  • kopia diff <a> <b>
@lacoski
lacoski / assume_role.py
Created July 21, 2022 16:09 — forked from DaisukeMiyamoto/assume_role.py
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@lacoski
lacoski / lambda-aws-ssm-run-command-on-ec2-instance.py
Created July 5, 2022 15:37 — forked from lrakai/lambda-aws-ssm-run-command-on-ec2-instance.py
Run commands on EC2 instances using Lambda and Systems Manager (SendCommand)
import boto3
import botocore
import time
def handler(event=None, context=None):
client = boto3.client('ssm')
instance_id = 'i-07362a00952fca213' # hard-code for example
response = client.send_command(
@lacoski
lacoski / HashiCorp Certified: Terraform Associate 2021
Created July 5, 2022 07:38 — forked from vsathyak/HashiCorp Certified: Terraform Associate 2021
HashiCorp Certified: Terraform Associate 2021 by Zeal
Getting Started & Setting Up Labs : Choosing a right Infrastructure as Code tool
********************************************************************************
- Terraform
- CloudFormation
- Heat
- Ansible
- SaltStack
- Chef, Puppet and Others
@lacoski
lacoski / list_objects_google_storage_boto3.py
Created May 25, 2022 16:59 — forked from gleicon/list_objects_google_storage_boto3.py
How to use boto3 with google cloud storage and python to emulate s3 access.
from boto3.session import Session
from botocore.client import Config
from botocore.handlers import set_list_objects_encoding_type_url
import boto3
ACCESS_KEY = "xx"
SECRET_KEY = "yy"
boto3.set_stream_logger('')