python3 -m pip install localstack
  chmod 777 /var/run/docker.sock
  sudo chmod 777 /var/run/docker.sock
  localstack start -d
  pip install awscli-local
  which awslocal
  cd ~/.local/bin
  awslocal sqs create-queue --queue-name sample-queue
  
~/.local/bin$ awslocal sqs create-queue --queue-name sample-queue
{
    "QueueUrl": "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/sample-queue"
}


# response = sqs_client.receive_message
# queue 가 비었을 때
{
    "ResponseMetadata": {
        "HTTPHeaders": {
            "content-length": "2",
            "content-type": "application/x-amz-json-1.0",
            "date": "Wed, 11 Sep 2024 06:33:04 GMT",
            "server": "TwistedWeb/24.3.0",
            "x-amzn-requestid": "fb6a358f-f955-4ffa-b3a8-360533218623"
        },
        "HTTPStatusCode": 200,
        "RequestId": "fb6a358f-f955-4ffa-b3a8-360533218623",
        "RetryAttempts": 0
    }
}

# queue 에 데이터가 있을 때
{
    "Messages": [
        {
            "Attributes": {
                "ApproximateFirstReceiveTimestamp": "1726036509898",
                "ApproximateReceiveCount": "1",
                "SenderId": "000000000000",
                "SentTimestamp": "1726036493564"
            },
            "Body": "{\"database\": \"o_tango_i\", \"table\": \"im_eqp_bas\"}",
            "MD5OfBody": "544343dab91d4ce41a6ccbc9864c1809",
            "MessageId": "526d4863-4a79-40ce-989b-9b8d765197b6",
            "ReceiptHandle": "OWU1MDI2MTQtMDU1ZS00Mjc3LTkxOGUtYTYyZGE2MjIyMzhiIGFybjphd3M6c3FzOnVzLWVhc3QtMTowMDAwMDAwMDAwMDA6c2FtcGxlLXF1ZXVlIDUyNmQ0ODYzLTRhNzktNDBjZS05ODliLTliOGQ3NjUxOTdiNiAxNzI2MDM2NTA5Ljg5ODE5OTY="
        }
    ],
    "ResponseMetadata": {
        "HTTPHeaders": {
            "content-length": "558",
            "content-type": "application/x-amz-json-1.0",
            "date": "Wed, 11 Sep 2024 06:35:09 GMT",
            "server": "TwistedWeb/24.3.0",
            "x-amzn-requestid": "ea205782-a143-43ac-8d48-80c76f1f6384"
        },
        "HTTPStatusCode": 200,
        "RequestId": "ea205782-a143-43ac-8d48-80c76f1f6384",
        "RetryAttempts": 0
    }
}


# 세 줄 이상 빈 줄을 두 줄로 줄이기

sed -i -r ':a; /^\s*$/ {N;ba}; s/( *\n *){2,}/\n\n/' a.txt


# systemctl stop tomcat  
systemctl status tomcat
systemctl start tomcat 
systemctl status tomcat


linux, cp -p

카테고리 없음 2022. 12. 22. 00:10

cp -p file1 file2

파일의 소유자, 그룹, 권한, 시간 정보를 보전한 채로 복사

(https://deeds-not-words.tistory.com/entry/CP-%EB%AA%85%EB%A0%B9%EC%96%B4-%EC%98%B5%EC%85%98)


// error fix :Failed to lookup view  in views directory "/views"

app.set('views', path.join(__dirname, 'views'));


 

app.use(express.json());
app.use(express.urlencoded({extended:true}));

...

app.put('/location/:loc_cd', function(req,res) {
    
var loc_cd = req.params.loc_cd;
console.log('Put Parameter = ' + loc_cd);

var loc_nm = req.body["loc_nm"];
console.log('Put loc_nm = ' + loc_nm);

})



document.querySelectorAll("input[type='checkbox']");

(https://developer.mozilla.org/ko/docs/Web/API/Document/querySelectorAll)