Skip to content

Instantly share code, notes, and snippets.

View tkamag's full-sized avatar

Thierry K. tkamag

  • AVISIA
  • Paris
  • 05:10 (UTC +01:00)
  • X @tkamag
View GitHub Profile
@tkamag
tkamag / fix_a_corrupt_zsh_history_file.md
Last active January 5, 2025 21:46 — forked from acampagnaro/How to fix a corrupt zsh history file
How to fix a corrupt zsh history file
@tkamag
tkamag / template.yaml
Created October 21, 2023 05:17
An example SAM template that creates a DynamoDB table, a Lambda function that writes to DynamoDB, and a CloudWatch Event trigger
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An app that includes a DynamoDB table, Lambda function that writes to DynamoDB, and CloudWatch Event trigger
Resources:
LambdaWriteToDynamoDB:
# A function that writes to a DynamoDB table on a schedule
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: LambdaWriteToDynamoDB
@tkamag
tkamag / test1.py
Last active August 30, 2023 17:51
test
import numpy as np
@tkamag
tkamag / ImageCenter.md
Created May 6, 2023 06:30 — forked from innat/ImageCenter.md
Center Images in GitHub README.md

For left alignment

 <img align="left" width="600" height="200" src="https://www.python.org/python-.png">

For right alignment

<img align="right" width="600" height="200" src="https://www.python.org/python-.png">

And for center alignment

# Import Python packages
import pandas as pd
import cassandra
import re
import os
import glob
import numpy as np
import json
import csv
@tkamag
tkamag / credential.sh
Created February 24, 2023 20:04
AWS CLI Credentials
# Get ACCOUNT_ID and the REGION, and insert these values into the aws ecr command.
export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account)
export REGION="`wget -q -O - http://169.254.169.254/latest/meta-data/placement/region`"
aws ecr get-login-password | docker login --username AWS --password-stdin ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com
# Add a new tag to first-container that references the Amazon ECR container registry.
docker tag first-container ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/first-container:latest
@tkamag
tkamag / containers.yml
Created February 24, 2023 19:56
Containers Files
AWSTemplateFormatVersion: "2010-09-09"
Description: "Containers Exercise"
Parameters:
VpcCIDR:
Default: 10.16.0.0/16
Description: "The CIDR block for the VPC"
Type: String
AllowedValues:
- 10.16.0.0/16