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
#!/bin/sh | |
# FTP_COPY version 0.3 by MP77V www.4pda.ru | |
# ---------------------------- | |
FTP_DEST_DIR="/FTP_directory" | |
FTP_DEST_HOST="FTP_host" | |
FTP_DEST_PORT="21" | |
FTP_DEST_LOGIN="FTP_user" | |
FTP_DEST_PASS="FTP_password" | |
# ---------------------------- |
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
import os | |
from google.cloud import datastore | |
import google.cloud.exceptions | |
#https://stackoverflow.com/questions/1593019/is-there-any-simple-way-to-benchmark-python-script | |
def timereps(reps, func): | |
from time import time | |
start = time() | |
for i in range(0, reps): | |
func() |
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
#!/bin/bash | |
# The MIT License | |
# | |
# Copyright (c) 2010, MaDeuce | |
# | |
# https://en.wikipedia.org/wiki/MIT_License | |
# | |
# ============================================================================ | |
# This command measures latency and bandwidth of an internet connection from the command line. |
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
set $cors ''; | |
if ($http_origin ~* (https?://.*\.foobar\.com(:[0-9]+)?)) { | |
set $cors "true"; | |
} | |
if ($request_method = 'OPTIONS') { | |
set $cors "${cors}options"; | |
} |
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 fs = require('fs'); | |
const readline = require('readline'); | |
const Datastore = require('@google-cloud/datastore'); | |
const parse = require('csv-parse'); | |
const instream = fs.createReadStream(process.argv[2]); | |
const datastore = Datastore({ | |
projectId: 'cloudprojectid', | |
keyFilename: 'serviceaccount.json' |
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
function mqttConnect(connVar) { | |
var mqtt = require("MQTT"); | |
const MQTT_OPTIONS = { | |
host: 'mqtt.host.net', | |
keep_alive: 15, | |
client_id: "espruino", | |
username: "mqtt_username", | |
password: "mqtt_password", | |
path: '/doordash-temp' | |
}; |
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 http = require("http"); | |
var wifi = require("Wifi"); | |
var analogOutPinGREEN = 'D12'; // Analog output pin that the LED is attached to GREEN | |
var analogOutPinBLUE = 'D13'; // Analog output pin that the LED is attached to BLUE | |
var analogOutPinRED = 'D15'; // Analog output pin that the LED is attached to RED | |
var outputValue = 0; // duty cycle of PWM (0-1) | |
var lastValue = 0; |
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
# | |
# URI parsing function | |
# | |
# The function creates global variables with the parsed results. | |
# uri_schema, uri_address, uri_user, uri_password, uri_host, uri_port, uri_path, uri_query, uri_fragment | |
# It returns 0 if parsing was successful or non-zero otherwise. | |
# | |
# [schema://][user[:password]@]host[:port][/path][?[arg1=val1]...][#fragment] | |
# | |
function uri_parser() { |
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
// Get a reference to the Cloud Storage component | |
var storage = require('@google-cloud/storage'); | |
function findCOMmarkers(buffer) { | |
var comment = []; | |
for (var i=0; i < buffer.length; i++) { | |
if (buffer[i] == '0xFF') { | |
if (buffer[i+1] == '0xFE') { // JPEG COM marker | |
comment.push(readcomment(buffer, i+4)); |
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
## @author Jay Goldberg | |
## @email [email protected] | |
## @license Apache 2.0 | |
## @description Implement timeout for systems that don't have it | |
## @usage source it, then timeout <secs> <command> | |
#======================================================================= | |
timeout() { | |
local timeout_secs=${1:-10} | |
shift |