Skip to content

Instantly share code, notes, and snippets.

View domderen's full-sized avatar

Dominik Deren domderen

  • Hyperion Gray
  • Poland
View GitHub Profile
from pathlib import Path
import sys
# from wireguard import Server
client_public_key = sys.argv[1]
server_private_key = sys.argv[2]
wg_interface_name = sys.argv[3] if len(sys.argv) > 3 else 'devenvsrv'
out_interface_name = sys.argv[4] if len(sys.argv) > 4 else 'ens5'
config_path = sys.argv[5] if len(sys.argv) > 5 else './'
# server = Server(
#!/bin/bash
echo "Installing CW Agent"
sudo yum install amazon-cloudwatch-agent -y
echo "Creating CW Agent config file"
cat > /opt/aws/amazon-cloudwatch-agent/bin/config.json <<EOL
{
"agent": {
"metrics_collection_interval": 60,
import * as playwright from 'playwright';
/**
* Defines type used to extract complex values from the page.
*/
type CompositeSelector = {
selector?: string;
attributeName?: string;
}
https://www.airbnb.com/rooms/21679018
https://www.airbnb.com/rooms/12797906
module.exports = {
topic: 'SomeTopic4'
}
￿
@domderen
domderen / README.md
Created December 3, 2016 12:41
Returns the contents of a single file from a GitHub repository, relying on standard Git authentication method.

GitHub repositories don't support git archive command, which allows getting content of a single file. A different method of getting file contents from GitHub is to use GitHub API with an access token, but this requires a different authentication method, and would require creating a special account in an org that could be used for example in CI systems. I wanted a method that relies on the same auth method as git clone for example, and still just gets the content of a single file.

Example usage:

./get_github_file.sh facebook react docs/README.md
// This is a simple approach to downloading the data from our API
// and processing it as JSON Object. This method is only sufficient for
// small API responses (should work for responses below 100k results).
// If your response contains more results, try having a look at this Stack Overflow QA:
// http://stackoverflow.com/questions/15121584/how-to-parse-a-large-newline-delimited-json-file-by-jsonstream-module-in-node-j
// We start by getting data from our API:
let extractorRunId = "00000000-0000-0000-0000-000000000000";
let jsonFieldId = "00000000-0000-0000-0000-000000000001"; // You can get this value, by displaying https://store.import.io/store/crawlrun/${extractorRunId} in the browser, and getting the value from `json` field.
let apiKey = "YOUR_API_KEY"; // You can get it here https://import.io/data/account/
#!/usr/bin/env bash
JS_FILES_LOCATION_PATTERN=$1
VERSION=$2
ATATUS_API_KEY=$3
URL=$4
ATATUS_CORRECT_RESPONSE="Upload successful!"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
usr/bin/slimerjs -v
usr/bin/slimerjs --webdriver `hostname -I | awk '{print $1}'`:8080 ${PHANTOMJS_OPTS} --webdriver-selenium-grid-hub http://hub:4444 --webdriver-logfile /tmp/webdriver.log --webdriver-loglevel DEBUG