Skip to content

Instantly share code, notes, and snippets.

View jmsaavedra's full-sized avatar

Joe Saavedra jmsaavedra

View GitHub Profile
@sevastos
sevastos / aws-multipartUpload.js
Last active October 8, 2023 10:43
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@piuggi
piuggi / AWS_NODE_FOREVER_SETUP.md
Last active December 30, 2015 20:19
AWS Ubuntu 13.10 Setup Install for Node.js/Forever w. port forwarding for 80 Supports server reboots etc...

###AWS SERVER CONFIGURATION ####Configuring an Ubuntu AWS Box with Node, Mongodb, and Forever with port forwarding

  • Login to aws.amazon.com and create an EC2 instance with a standard Ubuntu installation.
  • Create a Security Group that allows type SSH on port 22 and HTTP on port 80.
  • Download the .pem file (during setup) which we'll use to authenticate into your server via terminal.

Modify permissions on the .pem file downloaded from AWS

$ chmod 0600 ~/Downloads/{your_key}.pem

@jmsaavedra
jmsaavedra / aws-server-configuration.md
Last active April 23, 2018 19:10 — forked from piuggi/AWS_NODE_FOREVER_SETUP.md
AWS Ubuntu Server Setup incl Node, Mongodb, Port Forwarding

AWS SERVER CONFIGURATION

Configuring an Ubuntu AWS Box with Node, Mongodb, and Forever with port forwarding


  • Login to aws.amazon.com and create an EC2 instance with a standard Ubuntu (14.04) installation.
  • Create a Security Group that allows type SSH on port 22 and HTTP on port 80.
  • Download the .pem file (during setup) which we'll use to authenticate into your server via terminal.
  • Modify permissions on the .pem file downloaded from AWS
$ chmod 0600 ~/Downloads/{your_key}.pem
@jmsaavedra
jmsaavedra / rPi-SD-imaging.md
Last active July 24, 2017 23:10
raspberry Pi SD card formatting and image copying

SD CARD IMAGE COPY AND RESTORE


great for RaspberryPi disk imaging and copying.

LOCATE AND UNMOUNT DISK

insert SD card into computer. to see all volumes mounted to machine:

$ diskutil list
@jmsaavedra
jmsaavedra / ffmpeg_install.md
Last active February 29, 2024 09:36
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root
@witooh
witooh / graphicsmagick.sh
Created February 1, 2015 17:42
Install Graphicsmagick
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:rwky/graphicsmagick
sudo apt-get update
sudo apt-get install graphicsmagick
@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@danmactough
danmactough / second-boot.sh
Created July 31, 2015 06:55
Setting up a gpu (nvidia) ec2 instance with ubuntu and electron for headless webgl rendering
#!/bin/bash -xe
# Unload nouveau
sudo rmmod nouveau
# Load nvidia
sudo modprobe nvidia
# Configure X
sudo nvidia-xconfig --use-display-device=None --virtual=1280x1024 --output-xconfig=/etc/X11/xorg.conf --busid=PCI:0:3:0 --enable-all-gpus
@ivan-loh
ivan-loh / gist:ee0d96c3795e59244063
Last active March 3, 2021 13:26
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb