Skip to content

Instantly share code, notes, and snippets.

@lambrospetrou
lambrospetrou / awslogs.config
Last active Jan 30, 2022
Custom CloudWatch Logs agent configuration file for Elastic Beanstalk AL2
View awslogs.config
###################################################################################################
#### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
####
#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#### except in compliance with the License. A copy of the License is located at
####
#### http://aws.amazon.com/apache2.0/
####
#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@lambrospetrou
lambrospetrou / deployment.log
Created Jan 29, 2022
Fly.io simple Dockerfile deployment
View deployment.log
2022-01-29T19:44:43.080 runner[121033e8] lhr [info] Shutting down virtual machine
2022-01-29T19:44:43.215 app[121033e8] lhr [info] Sending signal SIGINT to main child process w/ PID 518
2022-01-29T19:44:43.218 app[121033e8] lhr [info] Main child exited with signal (with signal 'SIGINT', core dumped? false)
2022-01-29T19:44:43.219 app[121033e8] lhr [info] Starting clean up.
2022-01-29T19:44:43.234 app[121033e8] lhr [info] Umounting /dev/vdc from /db
2022-01-29T19:44:47.326 runner[16cd4003] lhr [info] Starting instance
2022-01-29T19:44:47.367 runner[16cd4003] lhr [info] Configuring virtual machine
2022-01-29T19:44:47.369 runner[16cd4003] lhr [info] Pulling container image
2022-01-29T19:44:49.319 runner[16cd4003] lhr [info] Unpacking image
2022-01-29T19:44:50.514 runner[16cd4003] lhr [info] Preparing kernel init
@lambrospetrou
lambrospetrou / elastic-beanstalk-eb-engine.log.csv
Created Jan 29, 2022
The Elastic Beanstalk eb-engine.log for the AL2 Docker platform during a simple Dockerfile deployment.
View elastic-beanstalk-eb-engine.log.csv
timestamp message
1643482975156 2022/01/29 19:02:55.012950 [INFO] Starting...
1643482975156 2022/01/29 19:02:55.013002 [INFO] Starting EBPlatform-PlatformEngine
1643482975156 2022/01/29 19:02:55.013018 [INFO] reading event message file
1643482975156 2022/01/29 19:02:55.013572 [INFO] no eb envtier info file found, skip loading env tier info.
1643482975156 2022/01/29 19:02:55.013765 [INFO] Engine received EB command cfn-hup-exec
1643482975910 2022/01/29 19:02:55.101565 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-1:<redacted>:stack/awseb-e-234tsz8zsf-stack/59ba6f50-812b-11ec-89c0-0227d013ec45 -r AWSEBAutoScalingGroup --region eu-west-1
1643482976410 2022/01/29 19:02:55.677999 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-1:<redacted>:stack/awseb-e-234tsz8zsf-stack/59ba6f50-812b-11ec-89c0-0227d013ec45 -r AWSEBBeanstalkMetadata --region eu-west-1
1643482976410 2022/01/29 19:02:56.245445 [INFO] checking wh
@lambrospetrou
lambrospetrou / gist:b24559f9f058dba8191ac30a34537b72
Created Jan 29, 2022
The eb-engine.log file for an Elastic Beanstalk deployment using the AL2 Docker platform
We couldn’t find that file to show.
View asciidoc-guide.adoc

AsciiDoc User Guide

AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, blogs and UNIX man

@lambrospetrou
lambrospetrou / asciidoc-guide-top-partial.adoc
Last active Mar 17, 2021
3000 lines of sample Asciidoc. Full version (6K lines) is at https://asciidoc.org/asciidoc.txt
View asciidoc-guide-top-partial.adoc

AsciiDoc User Guide

AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, blogs and UNIX man

View ReadableStream-to-String.ts
// Option 1
async function streamToString(stream: NodeJS.ReadableStream): Promise<string> {
const chunks: Array<any> = [];
for await (let chunk of stream) {
chunks.push(chunk)
}
const buffer = Buffer.concat(chunks);
return buffer.toString("utf-8")
}
@lambrospetrou
lambrospetrou / README.md
Created May 21, 2019
Kotlin server script
View README.md
  1. Install tools
curl -s “https://get.sdkman.io" | bash

sdk install kotlin
sdk install kscript
  1. Run the script
@lambrospetrou
lambrospetrou / test-script.go
Last active Mar 11, 2018
Shebang for Go scripts
View test-script.go
// 2>/dev/null;/usr/bin/env go run $0 $@; exit $?
// Found at https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd
package main
import "fmt"
// You can run the script with one of two ways
// 1. chmod +x test-script.go && ./test-script.go
// 2. go run test-script.go
View git-change-author-commits.md

Change all commits

https://stackoverflow.com/a/750191/1066790

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='new@email'; GIT_COMMITTER_NAME='Newname'; GIT_COMMITTER_EMAIL='new@email';" HEAD

Change some commits