Skip to content

Instantly share code, notes, and snippets.

View aswinkm-tc's full-sized avatar

Aswin K.M. aswinkm-tc

  • Truecaller
  • Sweden
  • 12:58 (UTC +01:00)
View GitHub Profile
@aswinkm-tc
aswinkm-tc / pipeline.go
Created October 23, 2024 09:24
This code will read a file and write the data to another file after doing some processing on the data line by line.
package main
import (
"bufio"
"context"
"fmt"
"io"
"log/slog"
"os"
"sync"
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu or other *nix.
# Description: nginx init.d dash script for Ubuntu or other *nix.
### END INIT INFO
#!/bin/bash -e
if [ -z "$1" ]; then
exit 1
fi
# source configuration if it exists
[ -f /etc/aws-ec2-ssh.conf ] && . /etc/aws-ec2-ssh.conf
# Assume a role before contacting AWS IAM to get users and keys.
#!/bin/bash -e
# source configuration if it exists
[ -f /etc/aws-ec2-ssh.conf ] && . /etc/aws-ec2-ssh.conf
# Should we actually do something?
: ${DONOTSYNC:=0}
if [ ${DONOTSYNC} -eq 1 ]
then