Search the Community
Showing results for tags 'nodejs'.
-
I'm trying to use self-signed certs for my web-application based on vue/node.js. And added two conf files for nginx to handle vue and node. The Vue part works if I disable the Nginx node conf file. I just add it for completion. I guess the problem is within the proxy to node (or self-signed certs?). VUE: server { listen 80; listen [::]:80; server_name inf-education-67.umwelt-campus.de; return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name inf-education-67.umwelt-campus.de; # point to ssl certificate path include snippets/self-signed.conf; include snippets/ssl-params.conf; location / { # point to dist folder inside vue source code folder root /var/www/client/pvapp-client/dist; autoindex on; autoindex_exact_size off; index index.html index.htm; try_files $uri $uri/ /index.html; } } NODE: server { listen 80; listen [::]:80; server_name MY_IP; return 301 https://$server_name$request_uri; } server { listen 443 ssl; listen [::]:443 ssl http2; server_name MY_IP; # point to ssl certificate path include snippets/self-signed.conf; include snippets/ssl-params.conf; root /var/www/server/pvapp-server; location / { proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://MY_IP:60702; proxy_ssl_verify off; } } The Nginx logs are: Error.log (This one is common with self-signed certs tho) 2021/02/23 07:30:07 [warn] 233791#233791: "ssl_stapling" ignored, issuer certificate not found for certificate "/etc/nginx/selfSignedCerts/example.crt"` 2021/02/24 07:26:48 [error] 233793#233793: *17 connect() failed (111: Connection refused) while connecting to upstream, client: IP, server: IP, request: "GET / HTTP/2.0", upstream: "http://MyIP:60702/", host> Access.log MYIP - - [23/Feb/2021:07:31:02 +0000] "GET / HTTP/2.0" 404 128 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
- 4 replies
-
- nginx
- ssl certificate
-
(and 1 more)
Tagged with:
-
nodejs Apache Server (Virtual hosts) with NodeJS
Nik schaad posted a topic in Servers, NAS, and Home Lab
Here's the case: I'm running an Apache webserver from home with several Virtual hosts and subdomains, I recently got into NodeJS and would love to run a NodeJS server with a subdomain of my website nikkiedev.com (node.nikkiedev.com). Unfortunately, I can't seem to get it to work. I've tried ProxyPass / https://localhost:6979 (6979 is the port on my NodeJS webserver, I've also tried port 80, and 8080), but That doesn't work it's all port forwarded though and I double checked everything, it just refers it to my server's domain (nikkiedev.mooo.com) in HTTP without an SSL cert. Anyone have an idea on how I could host my NodeJS webserver in an Apache Virtual Host under port 80? Help would be greatly appreciated! Thanks in advance. TL;DR: How to run NodeJS webserver in Apache Virtual Host -
Hi there. So I'm currently experiencing some issues with Google Drive and NPM. I am using the new Google Drive on Windows (if I remember correctly, used to be called Google Filestream). The issue basically involves the fact that when I do npm install in a Node.JS directory, it tells me that the <PROJECT DIRECTORY>/node_modules folder doesn't exist. Using the same project files and package.json in my local Downloads folder worked absolutely fine and installed everything like it was supposed to. The full error is as below: npm ERR! code ENOTDIR npm ERR! syscall mkdir npm ERR! path G:\My Drive\Coding\1. Node\1. Discord.JS\SleepBot\node_modules npm ERR! errno -4052 npm ERR! ENOTDIR: not a directory, mkdir 'G:\My Drive\Coding\1. Node\1. Discord.JS\SleepBot\node_modules' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\stent\AppData\Local\npm-cache\_logs\2022-03-13T17_06_01_171Z-debug.log The log file mentioned above has been attached to this post. And my package.json: { "name": "sleepbot", "version": "1.0.0", "description": "A custom bot to fix the brat's sleep schedule", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "sleepbot" ], "author": "Stentorian", "license": "ISC", "dependencies": { "ascii-table": "^0.0.9", "chalk": "^4.1.2", "cron": "^1.8.2", "discord.js": "^13.6.0", "fs": "^0.0.1-security", "moment": "^2.29.1", "ms": "^2.1.3" } } If anyone could help, that'd be great! 2022-03-13T17_06_01_171Z-debug.log
-
Over the last few years I've become decently versed in javascript, specifically in nodejs. Ive been considering learning C++ as a next step but is it worth it? What advantages (other than speed) does it have?
-
Hello! This may be a bit long winded, but bare with me. TLDR: Looking for ways of parsing binary response from a Bluetooth device. So, I've got a crazy idea (maybe) in that I've been trying to develop a data logging application and fitness tracker for my new IC4 bike. The difference between this app and others available on the market is that it works via the experimental Bluetooth browser standard. Described in more detail here. Web Bluetooth API - Web APIs | MDN (mozilla.org). Getting to the point. I've paired to my Bluetooth connection (server). Parsed through the services available and exposed by using a Bluetooth discovery application on my phone. Again, pairing to the bike. I'm able to see what I can retrieve, notify, read, write etc. But I don't know how to translate that on a web browser? Why might that be? Well, since the standard is relatively new. When I subscribe to notifications from the bike via Bluetooth. On the characteristic CSC Measurement I get a little endian binary 88 bit response that I can't seem to figure out where the data indicated above lies. It's not auto-magical like the above screenshot on my phone would indicate. For example it will look something like this when subscribing to notifications on the WEB for CSC Measurement. hex: 0x593400e04890 binary: 11001011011010000000000111000000100000011100000 What I do know so far is that the times in milliseconds reported are unsigned 16 bit integers. That lets me guess and check where in the sequence those measurements may be in the response. However rather than guessing and checking I figured I'd just ask if there's an easier way to translate the data received. So, I can use it in my web application. Figured it my android device can parse the Bluetooth notifications then so can I. Also, I've already emailed the manufacturer if there's a data sheet describing the notifications. import { Injectable } from '@angular/core'; import { SchwinIc4BluetoothCharacteristics, SchwinIc4BluetoothServices } from '@solid-octo-couscous/model'; import { BaseBluetoothConnectionService } from './base-bluetooth-connection.service'; declare const navigator: Navigator; @Injectable() export class SchwinIc4BluetoothConnectionService extends BaseBluetoothConnectionService { constructor() { super( [{ name: 'IC Bike' }], [ SchwinIc4BluetoothServices.cyclingSpeedAndCadence, SchwinIc4BluetoothServices.deviceInformation, SchwinIc4BluetoothServices.fitnessMachine, SchwinIc4BluetoothServices.genericAccess, SchwinIc4BluetoothServices.heartRate, ] ); } public async connectToCyclingSpeedAndCadenceService(): Promise<void> { const primaryBluetoothServices = await this.connectToSchwinBike(); const cyclingSpeedCadenceService = primaryBluetoothServices?.find( service => service.uuid === SchwinIc4BluetoothServices.cyclingSpeedAndCadenceUUID ); const cscMeasurementChararacteristic: | BluetoothRemoteGATTCharacteristic | undefined = await cyclingSpeedCadenceService?.getCharacteristic( // CSC Measurement feature. csc = cycling speed cadence. SchwinIc4BluetoothCharacteristics.cscMeasurement ); const result: | BluetoothRemoteGATTCharacteristic | undefined = await cscMeasurementChararacteristic?.startNotifications(); result?.addEventListener('characteristicvaluechanged', this.parseCadenceWheelSpeedWheelTime); } private readonly connectToSchwinBike = async (): Promise<BluetoothRemoteGATTService[]> => { // TODO: add a check in here to notify the user if they're using a non-supported browser. const userSelectedSchwinIc4Bike: BluetoothDevice = await navigator.bluetooth.requestDevice( this.bluetoothDeviceSearchOptions ); this.bluetoothDevice$.next(userSelectedSchwinIc4Bike); const serverConnection: | BluetoothRemoteGATTServer | undefined = await userSelectedSchwinIc4Bike?.gatt?.connect(); this.bluetoothServer$.next(serverConnection); return (await serverConnection?.getPrimaryServices()) ?? []; }; /** * !!!! this portion is where I'm having trouble after i'm connected and receiving responses. !!!!! **/ private readonly parseCadenceWheelSpeedWheelTime = event => { // here is where the value of the notification would be something like // 0x593400e04890 // this buffer is embedded in a DataView object. const { value } = event?.target; const dataView = value as DataView; console.log(`some real data: ${dataView.getUint16(0, true)}`); console.log(`some other real data: ${dataView.getUint16(2, true)}`); }; }
- 6 replies
-
- bluetooth
- typescript
-
(and 3 more)
Tagged with:
-
Hello fellow tech nerds ! I've been working on a program over the past several months and I am happy to be sharing it with you all today (ง ͠° ͟ل͜ ͡°)ง !! As most of you are aware, the issue of online scalpers buying up a lot (if not all) merchandise and reselling at at ridiculous prices has been a growing issue over the past several months. I myself was stuck refreshing web-pages of major online retailers hoping that the item I wanted would come back in stock, and hoping then that I could check out in time.. This is something I know many of you must also be going through. To help me tackle the issue, I created Puppet-purchase!!! PUPPET-PURCHASE puppeteer.ico WHAT IS IT? Puppet-purchase is a bot that automates the process of purchasing an item from a few of the most popular online retailers. HOW DO YOU USE IT ? The program uses node.js. Simple clone the repository to your local machine and install npm using node.js Links: Node.js Puppet-Purchase Once you've installed npm, provide the necessary user account information. This can be done inside of the .env.userInfo file, found in scripts/< bot >/user_info/.env.userInfo Alternatively, you can run one of the test to make sure everything is working as expected. To provide the user account information when running test, export them: export TEST_USER_EMAIL= \ TEST_USER_PASSW= \ TEST_USER_LOC= \ TEST_USER_CVV= \ TEST_USER_LISTING_URL= // This is the information the program will use to login, and checkout your cart. Test do not perform the last step of the workflow - i.e they do not click on the 'place order' button. It's a perfect way of making sure that the program will perform as intended before the moment of truth. For the program to run as as expected, be sure to set up your online account with the retailer you wish to use this bot on. A list of all scripts is located in the package.json file. A far more detailed tutorial / explanation can be found in the README.md of the github repo. WHAT IS THE INTENT ? Let me start by saying, I'm fully aware that this program isn't a perfect solution to the current situation. I'm also aware that by making this publicly available to everyone, I am making it available to those who might potentially use it for unintended purpose ( intended purpose being to check out x1 item ). My main goal by creating puppet-purcahse was to help those out there who aren't able to help themselves. Those who might otherwise have to turn to buying these items from scalpers at ridiculous prices. I'm happy to report that by using this program I was able to secure my very own ps5, and that was a few months ago. With that said, I'll add: Buyers should not have to rely on programs like this one. And, The sooner that the online retail business start implementing effective solutions to bots like these, the sooner that we will all be better off. But, the fact that programs like puppet-purchase are still effective, means that retailers aren't doing the most they can to help out buyers in this position( This program is not that sophisticated at all + These business have lot of cash to pay devs). Hope this helps. - Rusti Shackleford ( DevOps engineer )
-
- combat scalping
- puppeteer
- (and 4 more)
-
nodejs JS/Express Send a very big string to an express server
Playlogo posted a topic in Programming
What is the best way to send a very big String to a nodeJs express server? I have a Webpage with Codemirror which is able to load files from a express server and load them into Codemirror. But what method is the best to send "the file"(actually it's a string,can be realy big) back to the express api ? -
Node.js 15.0.0 is released and along with Node.js, npm also got a new update and now it's npm 7. npm 7 comes with many new features - including npm workspaces and a new package-lock.json format. npm 7 also includes yarn.lock file support. One of the big changes in npm 7 is that peer dependencies are now installed by default. ---------------------------------------------- Summary Node.js released Node.js 15.0.0 on 20 Oct, 2020. It comes with a lot of new things and a few things are purged. npm also got a new update and released as npm 7. Sources https://nodejs.org/en/blog/release/v15.0.0/
-
I'm new to coding and just installed node for vite. I don't know if I did it correctly or anything but still learning. Right now I'm having a problem where if I delete a project in my projects folder, the deleted files start showing in my source control for projects where vite is installed. I already have a Stackoverflow post about this and I really just need help getting this fixed. I would appreciate it if anyone can check out that post to get the full details, just need more eyes on it. If you have solutions be free to reply here or on Stackoverflow. Here's the link to the original post: https://stackoverflow.com/q/74077564/20247009
-
Hi all, In the last few WAN shows, Linus' complaints and troubles with Strawpoll motivated me to do some experimentation and development with a potential replacement for strawpoll that actually works. So I came up with this - a fully open-source, MIT licensed polling platform built on NodeJS and Redis. I've put a bit of thought into it to ensure it can manage high levels of load, with the details of some of my decisions and choices outlined in the README.md on the repo. The full source and details on a publicly available instance of it that I run are available here: https://github.com/peasee/poll It's relatively easy to install, and I've made an easy-install script that would be suitable for most installations if people want to install it for themselves to run their own polling platform (for whatever reason). Theoretically, LTT could also install it in their own racks with their hundreds of cores to handle any level of load the community could possibly throw at it. My publicly available instance isn't too high spec, but should be suitable for most loads for a theoretical 20-40k requests per second. If you encounter any bugs while using or installing it, feel free to raise issues on the repo and I'll get around to them. Hope you all enjoy!
-
I have an index.js file that I want to load in the Node REPL to try some stuff, but when I use .load index.js in the REPL, it goes in an infinite loop and keeps repeating the first line in the file. const mongoose = require('mongoose'); I found an alternative solution which works in Ubuntu 20.04.5 in WSL2, which is to use the command node -i -e "$(< index.js)" in the terminal which loads the file perfectly fine and I can interact with its contents. But when I try the same command in PowerShell it gives me this error: < : The term '<' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:15 + node -i -e "$(< index.js)" + ~ + CategoryInfo : ObjectNotFound: (<:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException C:\Program Files\nodejs\node.exe: -e requires an argument The reason I'm asking about PowerShell "even though I use Ubuntu and things work there", is that I'm taking a web development course, and I provided the solution of using node -i -e "$(< index.js)" to people who were having the same issue, but other people can't get this to work in PowerShell, so I'm just trying to help. and I couldn't find any solution online to this .load issue, or to using an alternative to the node -i -e "$(< index.js)" command in PowerShell. index.js contents: const mongoose = require('mongoose'); mongoose.set('strictQuery', false); mongoose.connect('mongodb://localhost:27017/movieApp', { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => { console.log("CONNECTION OPEN!!!") }) .catch(err => { console.log("OH NO ERROR!!!!") console.log(err) }) const movieSchema = new mongoose.Schema({ title: String, year: Number, score: Number, rating: String }); const Movie = mongoose.model('Movie', movieSchema); const amadeus = new Movie({ title: 'Amadeus', year: 1986, score: 9.2, rating: 'R' });
-
- javascript
- powershell
-
(and 2 more)
Tagged with:
-
So, I have this contact form in the website I'm making, I'm using a template I found online that uses ajax to validate that the form is working and the email has been sent, the problem is that this file that validates the form is set to work with PHP I think, so I tried modifying the file that has ajax to make it work with my node app, but I end up with the form loading forever and I get Failed to load resource: net::ERR_EMPTY_RESPONSE in the console. note: the form is working and all and the email gets sent but I just need an indication to the user that it worked. here's the code: validate.js: $.ajax({ method: "POST", url: "/home", data: str, success: function(msg) { if (msg == 'OK') { this_form.find('.loading').slideUp(); this_form.find('.sent-message').slideDown(); this_form.find("input:not(input[type=submit]), textarea").val(''); } else { this_form.find('.loading').slideUp(); this_form.find('.error-message').slideDown().html(msg); } } }) index.js: const express = require("express"), router = express.Router(), nodemailer = require("nodemailer"), mailGun = require("nodemailer-mailgun-transport"); router.get("/home", (req, res) => { res.render("index"); }); router.post("/home", (req, res) => { let { firstName, lastName, email, website, company, message } = req.body; console.log("Data: ", req.body); let mailOptions = { from: email, to: "myemail@email.com", subject: "No Subject", html: "<h3>First Name: " + firstName + "</h3>" + "<h3>Last Name: " + lastName + "</h3>" + "<h3>Email: " + email + "</h3>" + "<h3>Company: " + company + "</h3>" + "<h3>Website: " + website + "</h3>" + "<h3>Message: " + message + "</h3>" } smtpTransport.sendMail(mailOptions, (error, response) => { if (error) { console.log(error) } else { console.log("Successfully sent email.") } }) }); Thanks in advance
-
Hello Thogether I am working on a Solution for this. i am using a apu2d4 board from pcengines.ch. This bord has 3 100/1000mbs Interfaces from Intel and a quad core cpu from amd, The bord alsow has 4GB ddr3 eec ram. Because the board "only" was 3 nics, i am using a cheap vlan switch from tp-link. so i can can use one Nic for 7 wan connections (1 port as trunk tu apu board and the seven remaining for up to 7 individual outgoing connections). At the moment i am working on an webui to manage the thing. If someone is interesting in helping on this Project, pleas let mi know. PS: sorry for bad english, my main language is german
-
Hello everyone ! I’m currently studying computer science and I’d like to create my own website for a professional use. This is what I’m planning to have on it: - General presentation. (Home page) - Detailed CV. - Project page (and pages for each project). - Eventually a “Tutorial” section. I’d like to host it on Gitlab (git), which means it needs to be static: HTML, CSS and JS (etc). However, there are plenty of ways of going about it: Plain, Jekyll, Hexo, Middleman… All use different environments, such as Ruby on Rails, Python or NodeJS. This is where I kind of get lost with the amount of options I have. These environments seem more specialized in blog style websites, am I wrong? I don’t have any knowledge in Python or Ruby for instance. Just for reference, I’m a strong OOP kind of guy, so if it’s possible to translate that into my web dev experience, that would be great. It really comes down to what would be the most appropriate for me to use? Are there other options I should check out? Is there any real advantage in using these SSGs instead of just writing and managing everything yourself? Thanks! ~3751_Creator
- 6 replies
-
- static website
- website
-
(and 4 more)
Tagged with:
-
Hi! In this post I'll be posting stuff about a vacation project I started a week ago. It's called plane engine (inspired by floatplane). I'm not trying to copy floatplane, I just wanted to try to build my own engine ?. It will be fully written in NodeJS (es6). I'm thinking of improving the performance of some parts (mostly the transcoding service) with native C++ bindings. What plane engine will do: Trans-coding media Serving media Handling metadata Handling extra info linked to the media (like comments, etc...) What plane engine will NOT do: It won't be a full video platform. I'm probably not making a frontend for it (I just want to build the backend. Maybe I'll do something in Angular or React if I'm still interested in the project ?). It won't handle any user account stuff It won't auto scale. You should probably implement this on the loadbalancer layer or use a central performance monitoring system. It won't handle payments, etc.. (This could be implemented in another microservice using something like Stripe, etc...) It won't be production ready. I don't have the resources to fully test this project without deployment. I'm not planning to use this in production. Idk, I'm just making this for fun The architecture The application uses a conveyor belt system design. The application is split in multiple microservices that each do it's own thing. This allows for easier maintenance, smoother updates, easy bottleneck cancellation (spawning more instances for a microservice that takes longer than others). Microservices allow for dynamic scaling, this is a big cost saver because not every service has to run 24/7. Also, when your site is on high load, it can spawn a couple extra services. Splitting the application also makes is so you aren't bound to run the full app on one platform. For example: you can host the injection service on a cloud provider (like AWS or GCloud) and host the transcoding service on your own infra. It's based around MongoDB. There are some reasons why I chose for this: It's nice to use with NodeJS It has GridFS (I'll talk about why this is nice). It's ok for temporary storage while processing. It's a bit slower than normal storage. But It performs great from my experience Like almost every other database, it scales nicely Here is the "path" the video takes when a creator uploads a video. First, it's handled by the Injection service. This service creates an entry in the database. This entry contains the video metadata (description, title, etc...). It also contains an unique ID that points to the video file in GridFS. I use this only for the conveyor system. Once the video is done processing it will be stored on a storage server (still have to do that service ?). It will also store a state with the entry, each service checks the database for entries with a specific state. This describes what to do next (eg. transcode, publish, etc...). This is probably not the best solution. A better solution would be to make it event based. The injection service doesn't do much more. It's focus is to quickly move the video into the processing queue. The second service the video will reach is the Transcoding service. This service transcodes the video (who thought ?). It checks the database for entries with the transcode state. It will transcode the video to the right formats for serving to the right platforms in multiple resolutions. It currently uses a simple solution based on ffmpeg. I'm still working on this service, I'm looking into native C++ bindings with some CUDA magic. I'm still working on the rest of the services, these will probably handle the distribution of the transcoded media to multiple servers around the world. It should update the database once it has stored the transcoded media on a storage server so another service (something like a content serving thing) knows what storage servers have the media. Once it has been fully distributed it should also remove the files from GridFS. It should also move the entry from the queue collection to a permanent collection for permanently storing the metadata. Storage servers should also check with each other for new files for faster distribution. This would also fix the problem that the distribution service can't upload media to a storage server that's offline. I'll update the source to GitHub once I have most of the services done or in a state that the full process works. - A 16y/o who loves to code ?
-
Hey guys! I have run into at problem where I have two different arrays: // Sample data from function getTimeIntervals() [ RowDataPacket { issue_id: 117648, seconds_elapsed_issue: '318' }, RowDataPacket { issue_id: 118090, seconds_elapsed_issue: '8940' }, RowDataPacket { issue_id: 118092, seconds_elapsed_issue: '5357' }, RowDataPacket { issue_id: 118199, seconds_elapsed_issue: '41604' }, RowDataPacket { issue_id: 118351, seconds_elapsed_issue: '3778' }, RowDataPacket { issue_id: 118395, seconds_elapsed_issue: '2974' }, RowDataPacket { issue_id: 119014, seconds_elapsed_issue: '37680' }, RowDataPacket { issue_id: 119729, seconds_elapsed_issue: '15006' }, RowDataPacket { issue_id: 119735, seconds_elapsed_issue: '26389' }, RowDataPacket { issue_id: 119742, seconds_elapsed_issue: '67' }, ... ] // Sample data from function getIssueData() [ RowDataPacket { project_id: 1445, issue_id: 121007 }, RowDataPacket { project_id: 1445, issue_id: 120921 }, RowDataPacket { project_id: 1445, issue_id: 121011 }, RowDataPacket { project_id: 1420, issue_id: 120454 }, RowDataPacket { project_id: 1420, issue_id: 121004 }, RowDataPacket { project_id: 1445, issue_id: 120868 }, RowDataPacket { project_id: 1467, issue_id: 121010 }, RowDataPacket { project_id: 1445, issue_id: 120870 }, RowDataPacket { project_id: 1420, issue_id: 121009 }, RowDataPacket { project_id: 1445, issue_id: 120018 }, ... ] Now... What I want to do is avoid using a nested for loop for this because using nested for loops is in my opinion the slowest possible way to solve this task (O(n^2) time if I'm not mistaken): I want to add up all elapsed seconds from an issue under the 'project_id' value from the second array. This means producing a result that looks something like this: [ {project_id: 1445, seconds_elapsed: '270129'}, {project_id: 1467, seconds_elapsed: '16012'}, ... ] Does anyone have a solution to this particular problem? Because those I have found out there on the internet, I either do not understand or does not apply to my use case. -- Thanks!
-
I asked this question before on stackoverflow but i got 0 replies and also a downvote. I hope someone could help me. First of all sorry for my bad English because i am from Germany. For generall infromations: node version 12.14.0 npm version 6.13.4 electron version 8.2.5 angular version 9.1.4 I have generated a Electron Angular App from this template and i added a button so that when i click the button the script trys to send files to ftp via a npm ftp package. The problem is none of the packages does work correct like it should. Packages i tried: ftp ftp-client basic-ftp The Problem i had with ftp: when i use this package i must click the button at least twice so that it connects and uploads the file. It should upload the file imidiatly but it doesnt. I tested a few things and found out that its becuase it times out after 10 seconds. But thats not the problem. The problem is that it never ever connects on the first attempt. I've tested it at least 30 times and it always times out at the first attempt. The Problem i had with basic-ftp: The problem here was that it connects directly at the first attempt but it takes like 10 seconds to connect to the ftp and then uploads the file in another 10 seconds or takes even longer. Also it just sometimes works on the first attempt. Sometimes i must click the button 5-10 times so it uploads the file. It logs a lot to the console if you follow the example code. But the log doesnt seem to have any errors or something it just doesnt go like it takes a nap and then wakes up again. The Problem i had with ftp-client: Here the problem is realy not complicated: it just doesnt work. Sometimes it gives me an "Error: Control connection timed out." after i hit the button 5 to 8 times and sometimes it just doesnt work. In every case i used the example code from every repository but just for reference here are the codes i used for the diffrent npm packages: ftp: var Client = require('ftp'); var fs = require('fs'); var c = new Client(); c.on('ready', function() { c.put('C:/test/test.txt', 'test.txt', function(err) { if (err) throw err; c.end(); }); }); // connect to localhost:21 as anonymous c.connect({host: "local.host.com", username: "username", password: "**********"}); ftp-client: const config = { host: 'local.host.com', port: 21, user: 'username', password: '*******' } var ftpClient = require('ftp-client'); var client = new ftpClient(config, {}); client.connect(function() { client.upload(["C:/test/test.txt"], './', { baseDir: 'test', overwrite: 'all' }, function(result) { console.log(result); }) }) basic-ftp: const ftp = require("basic-ftp") async function example() { const client = new ftp.Client() client.ftp.verbose = true try { await client.access({ host: "local.host.com", user: "username", password: "***********", secure: true }) console.log(await client.list()) await client.uploadFrom("C:/test/test.txt", "test.txt") } catch(err) { console.log(err) } client.close() } I realy hope anyone can help me. I realy dont know where the mistake is. I also didnt upload a realy big file it was just an .txt with "Hello World" in it. As you might have guessed the test.txt is located in "C:/test/test.txt" and also the domain "local.host.com" is just a placeholder.
-
Hi. I am a small part of a Discord bot that has Minecraft-server-console-logging-in-a-discord-channel functionality. We currently use NodeJS' child_process.exec(command[, options][, callback]) which creates a shell and runs a command in it (in our case it is a start Minecraft server command). We then pass its STDOUT to a discord channel. I am looking for a way where whatever we type into that channel will be executed in the virtual shell that the Minecraft server is in. Thanks!
-
Good morning, yesterday I installed a newer version of Armoury Crate and the ASUS Framework Service/Core-SDK on my laptop. A few hours later I restarted my computer and noticed, that cscript.exe would be executed on boot. I immediately thought I had caught myself some malware. However, with Procmon I was able to trace the origin of the execution to the asus_framework.exe (process: ASUS NodeJS Web Framework). I now believe, that no malicious software is behind this issue, however, it annoys me a fair bit. Can anyone confirm, that this is happening on their computer as well? Just want to be 100% sure that everything is safe (however, even Kaspersky did not find anything). I have an Asus ROG Strix Scar III (G531GW), so maybe it will not affect those with solely an Asus motherboard. And finally, how may I disable this pop-up on startup? I cannot find it in the system configuration. Maybe it´s essential, but I just want to hide it, not disable it. Thank you so much in advance for any information on this topic! Regards
- 5 replies
-
- asus
- armoury crate
-
(and 3 more)
Tagged with:
-
I am programming a discord bot in nodejs and need the quick.db package for a message leveling system. When I try to install, I get this: I'm not sure what it wants from me other than something to do with installing python. I'm not very experienced with this so any help would be greatly appreciated!
- 1 reply
-
- nodejs
- javascript
-
(and 1 more)
Tagged with:
-
So I want to move forward as a web developer and I'm trying to sink my teeth into Sass, but I've had a lot of trouble just trying to get it set up properly. I'll just outline my current situation: Running Windows 10 Use Sublime Text 3 for all editing Node.js and npm installed in Program Files node-sass installed in User directory (by default) Nodejs, npm and Sass packages for ST3 installed So where I'm confused is how to properly make use of Sass. Can I use Sublime Text alone as an interface with the global installation of node-sass for all my projects? As a side question, how do I properly set the paths for the Nodejs package? I have the "node_command" path set as "C:\\Program Files\\nodejs\\node.exe" and "npm_command" as "C:\\Program Files\\nodejs\\npm.cmd". However, both node and npm commands return the following: Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'node' is not defined
- 4 replies
-
- web development
- css
-
(and 2 more)
Tagged with:
-
hi linustechtips, i am writing a program that shows tweets with a specific word in it. this works all great. the libarie i am using to get the tweets is twit (https://www.npmjs.org/package/twit) but i also have a function that let the user change the filter. here is the server(nodejs) code: io.sockets.on('connection', function (socket) { socket.on('filtername', function (data) { console.log(data); var stream_filter = T.stream('statuses/filter', { track: data }); stream_filter.on('tweet', function (tweet) { io.emit(data, tweet); }); });}); but here is my problem and i am trying to fix it for weeks. for some reason the server can only handel one user defined tweet filter. so it is not asynchronous. can some one help me with this please? Noah