Skip to content

Instantly share code, notes, and snippets.

View mand2's full-sized avatar
🎯
Focusing

Nayeon Kim mand2

🎯
Focusing
View GitHub Profile
@mand2
mand2 / blog_auto_commit.sh
Created August 31, 2020 10:52
Auto commit shell script for Hugo template users.
#!/bin/bash
msg_public_file={{ directory of the `public` commit message file}}
msg_blog_file={{ directory of the `blog` commit message file }}
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Build the project.
hugo
const aws = require('aws-sdk');
// autoScaling 객체 생성
let autoScaling = new aws.autoScaling({region: {my_region}});
var params = {
AutoScalingGroupNames: [
'STRING_VALUE',
/* more items */
],
/* This example describes the specified Auto Scaling group. */
var params = {
AutoScalingGroupNames: [
"my-auto-scaling-group"
]
};
autoscaling.describeAutoScalingGroups(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
🌞 Morning 39 commits ██░░░░░░░░░░░░░░░░░░░ 10.0%
🌆 Daytime 91 commits ████▉░░░░░░░░░░░░░░░░ 23.3%
🌃 Evening 206 commits ███████████░░░░░░░░░░ 52.8%
🌙 Night 54 commits ██▉░░░░░░░░░░░░░░░░░░ 13.8%
package com.order;
import org.json.simple.JSONObject;
import java.util.Objects;
public class Order {
private int orderSeq;
private int userSeq;
private int storeSeq;
package com.order.aws;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClientBuilder;
import com.amazonaws.services.sqs.model.*;
import java.lang.UnsupportedOperationException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
package com.order.aws;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.toList;
fun createS3DirectoryClient(accessKeyId: String,
secretAccessKey: String,
region: String): TransferManager {
val awsCredentials = AWSStaticCredentialsProvider(BasicAWSCredentials(accessKeyId, secretAccessKey))
val s3Client:AmazonS3 = AmazonS3ClientBuilder.standard()
.withCredentials(awsCredentials)
.withRegion(Regions.fromName(region))
.build()
@JvmField val pathRegEx: Regex = Regex("^(/)|(/)$")
fun uploadDirectoryOfClient(s3DirectoryClient:TransferManager, defaultPath: String) {
// 로컬 디렉토리 세팅
val localPath = "/d/test/uploader/"
val localDirectory = File(localPath)
// s3 객체 경로 세팅
val bucketName = "mand2"
val s3Path = pathRegEx.replace(defaultPath, "")
@JvmField val pathRegEx: Regex = Regex("^(/)|(/)$")
fun uploadDirectoryOfClient(s3DirectoryClient:TransferManager, defaultPath: String) {
// 로컬 디렉토리 세팅
val localPath = "/d/test/uploader/"
val localDirectory = File(localPath)
// s3 객체 경로 세팅
val bucketName = "mand2"
val s3Path = pathRegEx.replace(defaultPath, "")