docker log limit
method 1 -> docker run example
docker run -d \
--log-driver json-file \
--log-opt max-size=5k \
--log-opt max-file=10 \
chentex/random-logger:latest
docker log limit
method 1 -> docker run example
docker run -d \
--log-driver json-file \
--log-opt max-size=5k \
--log-opt max-file=10 \
chentex/random-logger:latest
openssl aes-128-cbc -d -K babb4a9f774ab853c96c2d653dfe544a -iv 00000000000000000000000000000000 -in "${HOME}/Library/DBeaverData/workspace6/General/.dbeaver/credentials-config.json" | dd bs=1 skip=16 2>/dev/null |
1 | |
Below worked for me in AWS CENTOS 🦊 - Amazon Linux 2 AMIS( Karoo) | |
Step 1 : Update the EBS volume from AWS console of attached EC2 | |
Step 2 : Login( SSH ) to EC2 instance in which the volume is attached |
const AWS = require('aws-sdk'); | |
exports.handler = async (event, context) => { | |
console.log(JSON.stringify(event)) | |
// ================================ | |
// Define your backups | |
// ================================ | |
const instanceName = event.instanceName || process.env['instanceName']; | |
const backupDaysMax = event.days || process.env['days']; // keep at least 7 daily backups |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": [ | |
"arn:aws:s3:::<bucket-name>/file1.txt", | |
"arn:aws:s3:::<bucket-name>/file2.txt" |
import json | |
import urllib.parse | |
import boto3 | |
import os | |
print('Loading function') | |
s3 = boto3.client('s3') | |
TOPIC_ARN = os.environ['topicARN'] | |
def lambda_handler(event, context): |
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
#Set the Region | |
AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone -H "X-aws-ec2-metadata-token: $TOKEN"` | |
export AWS_DEFAULT_REGION=${AZ::-1} | |
echo $AWS_DEFAULT_REGION | |
#Retrieve latest Linux AMI | |
AMI=$(aws ssm get-parameters --names /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 --query 'Parameters[0].[Value]' --output text) | |
echo $AMI |
create database aws; | |
use aws; | |
CREATE TABLE RESTART ( | |
StudentID int not null AUTO_INCREMENT, | |
StudentName varchar(255), | |
RestartCity varchar(255), | |
GraduationDate Datetime, | |
PRIMARY KEY (StudentID) | |
); |
SELECT Region, Name, Population, RANK() over(partition by region ORDER BY population desc) as 'Ranked' FROM world.country ; |
def isPrime(num): | |
flag = False | |
if num == 1: | |
return False | |
elif num > 1: | |
# check for factors | |
for i in range(2, num): | |
if (num % i) == 0: | |
# if factor is found, set flag to True |