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 / apt.md
Created May 15, 2025 15:43 — forked from CodingKoopa/apt.md
APT Repositories Explained

Intro

To install and update packages on Debian, Ubuntu, or most derived distributions, you use APT, the Advanced packaging tool, to download the packages and their dependencies, which uses dpkg to install them.

These notes go into the downloading part, as I think it's easy to get overwhelmed by how the repositories work. I will eventually turn this into a page on my website.

Repository

A repository is where the packages come from. It provides binary packages for an arbitrary selection of architectures as well as source packages. Repositories are APT's data source. [https://wiki.debian.org/DebianRepository]

@lacoski
lacoski / nexus-ingress.yaml
Created March 5, 2025 05:38 — forked from AlexGluck/nexus-ingress.yaml
ingress-nginx manifests for sonatype nexus docker repositories
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-nginx-controller
data:
http-snippet: "proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=nexus:100m inactive=30d max_size=2g use_temp_path=off;"
...
---
@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(