This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Sid": "AllowAccessToAllExceptPrivate", | |
| "Action": [ | |
| "s3:GetObject", | |
| "s3:GetObjectVersion" | |
| ], | |
| "Effect": "Allow", | |
| "NotResource": [ | |
| "arn:aws:s3:::bucket/prefix1/prefix2/private/*", | |
| "arn:aws:s3:::bucket/prefix1/prefix2/private" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| всем привет. просьба к опытным разрабам: помогите решить проблему плс. | |
| задача: получить стрим большого файла (пол гига примерно) и обрабатывать его чанками, что бы не хранить весь файл в памяти и не ждать полной загрузки файла. | |
| проблема: написав следующий код я обнаружил, что по мере загрузки файла увеличивается использование памяти, при чем только rss, в то время как heap стабильно очищается. как видно в логах после полной прогрузки файла и выхода из функции main (по идее все ссылки на dataStream должны очиститься garbage collector-ом) rss все еще занимает 64mb. в реальном проекте таких файлов много и желательно обрабатывать их параллельно, но из-за того что использование памяти постоянно растет, приложение просто падает. | |
| вопрос: почему так происходит (может это баг ноды?) и можно ли до закрытия стрима удалять из памяти чанки, которые уже обработаны? | |
| гуглить пробовал. проверять дампы памяти в chrome inspect-е тоже - там только ссылки на какие-то внутренние объекты движка. | |
| */ | |
| const https = require('https |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var AWS = require("aws-sdk"); | |
| AWS.config.update({ | |
| region : "us-west-2", | |
| endpoint : "http://localhost:8000" | |
| }); | |
| var documentclient = new AWS.DynamoDB.DocumentClient(); | |
| var itemsArray = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DynamoDB = require('aws-sdk/clients/dynamodb'); | |
| const dynamoDB = new DynamoDB(); | |
| dynamoDB.updateTable( | |
| { | |
| TableName: `development-publication-tasks`, | |
| AttributeDefinitions: [ | |
| { AttributeName: 'sort_key', AttributeType: 'S' }, | |
| { AttributeName: 'attributeChanged', AttributeType: 'S' } | |
| ], | |
| GlobalSecondaryIndexUpdates: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const params = { | |
| TableName: TASKS_TABLE_NAME, | |
| KeyConditionExpression: '#account_id = :account_id and begins_with(#sort_key, :sort_key)', | |
| ExpressionAttributeNames: { | |
| '#account_id': 'account_id', | |
| '#sort_key': 'sort_key' | |
| }, | |
| ExpressionAttributeValues: { | |
| ':account_id': `account_id=${accountId}`, | |
| ':sort_key': `changelog#${taskSortKey}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "AllowPublicReadAccess", | |
| "Effect": "Allow", | |
| "Principal": "*", | |
| "Action": [ | |
| "s3:GetObject" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const docClient = new AWS.DynamoDB.DocumentClient(); | |
| const params = { | |
| TableName : "customer", | |
| Key : { | |
| "customerId": "customer_001" | |
| }, | |
| UpdateExpression : "REMOVE address.street3", | |
| ReturnValues : "UPDATED_NEW" | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ERROR: | |
| An error occurred during the signature verification. The repository is not updated and the previous index files will be used. | |
| GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the | |
| public key is not available: NO_PUBKEY 23E7166788B63E1E | |
| SOLUTION: | |
| curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| # SSL configuration | |
| # | |
| # listen 443 ssl default_server; | |
| # listen [::]:443 ssl default_server; | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:7.0.4-fpm | |
| RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
| mysql-client libmagickwand-dev --no-install-recommends \ | |
| && pecl install imagick \ | |
| && docker-php-ext-enable imagick \ | |
| && docker-php-ext-install mcrypt pdo_mysql |
NewerOlder