Skip to content

Instantly share code, notes, and snippets.

View luciopaiva's full-sized avatar
🐌
I may be slow to respond

Lucio Paiva luciopaiva

🐌
I may be slow to respond
View GitHub Profile

CORS issues when running via Webstorm

Jetbrains had a Chrome extension where you could configure Webstorm to include CORS headers just fine, but it seems to not be working anymore (setting the field and hitting the apply button has no effect - reloading the extension configuration page shows that the field is still empty).

This comment was what helped me, but it was not enough. I reply to that comment with the extra instructions needed. Here's the full conversation in case that page goes down:


Ekaterina Prigara says:

@luciopaiva
luciopaiva / AWS - obtain data about own instance.md
Created January 28, 2020 20:24
AWS - obtain data about own instance
@luciopaiva
luciopaiva / instance-type.sh
Created February 11, 2020 15:53
Get AWS own instance type via curl
#!/bin/bash
curl http://169.254.169.254/latest/meta-data/instance-type
@luciopaiva
luciopaiva / Network perf test with iperf3.md
Created February 17, 2020 19:33
Network perf test with iperf3

Network perf test with iperf3

iperf: https://github.com/esnet/iperf

Installation

In case sudo yum install iperf3 doesn't work:

git clone https://github.com/esnet/iperf.git

cd iperf

.foo {}
/* @include other.css */
.bar {}
console.info("HULLO");
// @include https://raw.githubusercontent.com/luciopaiva/foo/master/bar.js
@luciopaiva
luciopaiva / change-files-timestamps.js
Created August 13, 2020 17:44
Quick script to change timestamps of files in given directory
/*
* This script changes the timestamps of a series of files in batch. The script will go through all files in
* specified folder, ordering them by name. The first file will be stamped with given start date. The second one will
* be stamped with start date plus 1 second, the third with start date plus 2 seconds, and so on.
*
* But why? I had a series of photos that I wanted to upload to the cloud and their timestamps did not represent the
* actual date when they were taken. The photos were all taken in the same day and I knew what day was that, so I just
* needed a script to do it in batch for me. Also, files were sequentially named by the digital camera, and although I
* didn't know the exact time of day each photo was taken, I could at least preserve the sequence, that's why I decided
* to stamp each one second after the other, ordered by name.
@luciopaiva
luciopaiva / gist:87b64d8d47a51d1bb6866b7c9df9bf23
Created December 23, 2020 20:51
Windows remote desktop access with simultaneous users
General steps:
- download Microsoft Remote Desktop app on client machine (check the Apple store)
- enable remote access on host Windows (window key, type "allow remote access" to find the setting)
- test the connection using the Remote Desktop app. Notice that any current logged in users on the host machine will need to log out
- download [RDP Wrapper](https://github.com/stascorp/rdpwrap/releases) - I tested with v1.6.2. The msi installer did not work for me (got an error trying to execute it), but the zip worked fine
- unzip, run install.bat
- run the "*conf*.exe" app that comes with the zip
- it should show all green - if it shows a red "[not supported]", continue below
- get the ini file posted by Damasker [here](https://github.com/stascorp/rdpwrap/issues/1252). As instructed, run `net stop TermService`, replace the ini file in `Program Files/RDP Wrapper`, then `net start TermService`
@luciopaiva
luciopaiva / debugging-remote-nodejs-processes.md
Last active December 25, 2020 16:58
Debugging remote Node.js processes

Debugging remote Node.js processes

There are 3 steps involved:

1. send a signal to the process so it enters debug mode

Connect to the remote machine, get the pid of the Node.js process and then run:

kill -usr1 <pid>