Node.js - using socks5 module - macos

I'm on a Mac running OSX 10.8.2. I'm learning Node.js and want to do requests using socks.
In the Terminal I used
git clone https://github.com/mattcg/socks5-http-client.git
to get the socks5 http client source.
In the downloaded source folder is an example called example-tor, so I ran
node example-tor.js
This gives me a message saying "Cannot find module 'socks5-client'".
This error is being thrown in a js file in the source folder called agent.js on a line that says var socksClient = require('socks5-client');
What am I doing wrong?
To be honest, I am just beginning Node.js. I'm not sure if I fully understand how modules work, where they are located on my Mac and how Node.js is supposed to know where they are.
I have been running through the documentation, "hello world" tutorials and tutorials to install things like "npm" package manager but the whole process of getting something working seems very messy and unclear.
Hope someone can point me in the right direction.

Try running npm install from the terminal in the socks5-http-client top folder (the same one with the package.json file)

Related

Issues installing a go program

Im new to go and I have been unable to find any thing online for my issue.
I have downloaded this code https://github.com/hashicorp/http-echo and I would like to set it up so I can run this command.
$ http-echo -listen=:8080 -text="hello world"
I have been getting quite a few different path issues.
Currently I have the code sitting in this directory.
/Users/jon/go/src/github.com/hashicorp
When I try and install it I get this error
$ go install http-echo
can't load package: /usr/local/go/src/http-echo/handlers.go:9:2: non-standard import "github.com/hashicorp/http-echo/version" in standard package "http-echo"
Where should I keep go projects on an OSX computer, and how do I get this to install or compile?
The code currently seems to be in /usr/local/go/src/http-echo. Packages should always reside in the directory $GOPATH/src/package-name, e.g.: $GOPATH/src/github.com/hashicorp/http-echo. (unless you're using go modules).
It should work if you move the source to the correct path (/Users/jon/go/src/github.com/hashicorp/http-echo). Then execute:
go install github.com/hashicorp/http-echo
Even easier would be to use go get to download the package in the first place. Simply run the following command from any directory:
go get github.com/hashicorp/http-echo
And http-echo is automagically installed.
If you still get an error after this, make sure $GOPATH/bin is in your $PATH.

Apache Flink Installation 1.6.2 on Mac with Homebrew

I am trying to use Apache Flink for the first time for a school project, but I'm running into some trouble after installation. I have tried to follow the Quicksetup on the site, but I keep running into the same problem.
(https://ci.apache.org/projects/flink/flink-docs-stable/quickstart/setup_quickstart.html)
Console Output
The brew installation seems to work fine, this is where I ran into the first inconsistency however. Next the guide tells me to execute the following line
$ ./bin/start-cluster.sh # Start Flink
which doesn't work without installing a binary from here though
https://flink.apache.org/downloads.html
So I did that (I downloaded the Flink 1.6.2 with Hadoop 2.7 binary) and was then able to find the file and execute it. After doing this I'm supposed to go the the web frontend, and verify that a task is running. However when I go there nothing is shown.
Console Output
Web Dashbord
I started by executing the stop-cluster file, because for some reason I'm constantly getting the INFO Message
[INFO] 1 instance(s) of standalonesession are already running on Moritzs-MBP.fritz.box.
So far I have tried to to look into the flink-conf.yaml file which does set the numberOfTaskSlots to 1, so the problem does not seem to lie there. Otherwise I didn't really know where to look from there however and only tried to uninstall the and reinstall everything with no results however.
Sorry that the images are not shown, previously I had been able to fix all my code problems with existing posts and thus I can't directly post them yet. Any help would be much appreciated, thanks in advance,
Moritz
By using brew installation, the start-cluster.sh should be able to found in:
/usr/local/Cellar/apache-flink/1.6.2/libexec/bin
I'm not sure why start-cluster.sh isn't succeeding in starting up a taskmanager, but you can always (try to) start another one by hand with
$ ./bin/taskmanager.sh start

Has anyone managed to add custom icons into Ionic in Windows?

I refer the instructions here
What I did (on Windows):
Install fontforge through web instead of 'brew'
Install SASS through Ruby GEM
Place my-icon.svg inside src/ (of the ionicons-master)
Run the python ./builder/generate.py
I think I am very closed. Until i saw this error message:
windowsError: The system cannot find the file specified
And I think I get even closer when I saw the last post of this link
But, I don't get what it means. I downloaded the .exe but it doesn't work.
Is it the python build only meant for MAC? Has anyone managed to make this work in Windows?

Installing Zend Framework 2 on XAMPP in Windows

I know this question may have appeared few times here and in the internet. But still I feel it is not clear for somebody who wanted to enter into the world of frameworks. I have followed these links Rob Allens Tutorial, ZF Quick Tutorial.
But some how I feel it is not quite clear with the installation part. I have a windows system basically Vista with the newest version of XAMPP installed. I have downloaded the latest version of ZFSkeletonApplication from this link ZFSkeletonApp, extracted the skeleton contents, renamed the folder to zendframework and moved it to xampp folder i.e now ZF skeleton is in c:\xampp\zendframework.
So until here everything seems clear and easy, from here I am some how lost with the configurations. Can some one elaborate the things from here how to install the Zf and make it work, like changes in the include paths, .htaccess files and so on. Please do remember that I have windows with XAMPP on it. If some one can guide me exactly for this set up, it would be helpful.
P.S. It would be good if one can provide info about the changes which I need to make with examples consisting of paths, so that I am not lost, for example like you can find .htaccess file here(ex pathname), changes in .htaccess file should be so and so.
Thanks
For future references, i also made a big post on how to install ZF2 on a windows xampp environment right here Install ZF2 on Windows Xampp
OK, i have done this on multiple systems now. For a home system the following steps work quite well:
Download msysGit and install it to any directory
Run the git-cmd.bat from the msysGit-Folder
Move into the directory you want i.e. C:\xampp\htdocs\ (this is done via cd dirname or cd .. to go up a level, change partition with D: and hit enter)
Run the following command. The <OptionalFolderName> would be the name of a Sub-Directory of htdocs, if you skip this, the folder will get named ZendSkeletonApplication
git clone git://github.com/zendframework/ZendSkeletonApplication.git <OptionalFolderName>
Possible Trouble Scenario (fatal:unable to connect to github.com)
Once again at workplaces, pretty often the default port (9418) for the git-protocol is blocked. If this is the case for you, then you should try one of the following Commands
git clone https://github.com/zendframework/ZendSkeletonApplication.git <OptionalFolderName>
git clone git#github.com:zendframework/ZendSkeletonApplication.git <OptionalFolderName>
Now you are not done yet. The skeleton Application is installed, but the framework is still missing, here some people might run into the first problems, but this actually is quite easy.
We're still at the command line interface
cd <OptionalFolderName> or cd ZendSkeletonApplication depending on what you did earlier
php composer.phar self-update
php composer.phar install (this might take a while)
So, this is the part where lots of things can happen. I have two scenarios happened to me:
Scenario #1 No directory write permissions
This is easily handled by running the command line interface with administrator privileges
Scenario #2 Working behind a router (i.e. at work)
Personally i didn't have to do much to get this working, but the line might change depending on your proxy. Personally i did the following at the command line interface
SET HTTP_PROXY=http://proxy.domain.tld:8080 you might also be good with
SET HTTP_PROXY=proxy.domain.tld:8080 don't ask me why, but i needed the http://
With all those done, you should have an almost running ZendSkeletonApplication. The other part is how to set up your virtual host, but i won't go into detail on this, as that's even ZF1 Stuff and everyone should be familiar with that by now, if not, there's good resources to learn out there.
I hope i could be of help to you.
Setbacks have to install in Windows, but I ended up finding a solution. From ZF2 to install on windows via git, for this is the only use that simulates msysGit git linux on windows, for it is only access the tutorial: http://zf2.com.br/tutoriais/post/instalando-o-git-no-windows-para-fazer-a-instalacao-do-zf2-somente-no-comando-do-windows-via-composer
Since I had lot dependency extension problems (mostly .dll files) with old version of XAMPP, so first thing I did was made sure I uninstall all previous versions of PHP already present on my system as well as old XAMPP. Then installed latest XAMPP v3.2.2 (using latest XAMPP 3.2.2-32-bit on Win-7-64-bit). Then followed installation steps in XAMPP Documentation under title Start a New Zend Framework 2 Project.
I had issues while installing composer also with old-XAMPP, but somehow those errors didn't appear during composer installation this time. And, I successfully installed ZEND till I typed http://localhost:8081/myapp/ (I renamed my ZendSkeletonAppliction folder as myapp as per documentation) into my browser to access the same and met the error which said:
Fatal error: Uncaught RuntimeException: Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable. in C:\xampp\apps\myapp\htdocs\init_autoloader.php:51
Stack trace:
#0 C:\xampp\apps\myapp\htdocs\public\index.php(18): require()
#1 {main} thrown in C:\xampp\apps\myapp\htdocs\init_autoloader.php on line 51
Composer.phar was not even present the first time I downloaded ZendSkeletonApplication‐master.zip from Github (there was only composer.json and composer.lock files present). Anyhow I didn't need them since I followed XAMPP Doc which doesn't call composer.phar in command line:
composer create‐project ‐s dev zendframework/skeleton‐application path/to/install
I am not that tech-savvy to know how to 'define a ZF2_PATH environment variable' correctly, so I wasted time looking for solution online, couldn't find any (which is when I stumbled on this forum which also turned out not to have a solution for my query). In the end, in a fit of depression and anxiety, serendipity happened. All I did was as per XAMPP's ZEND documentation I right-clicked inside C:\xampp\apps\myapp\htdocs folder and clicked 'Composer Install' which reinstalled the Zend files from cache. Then refreshed http://localhost:8081/myapp/ and the Zend intro page appeared.
I just did it like that:
D:\web_dev\zendapp>C:\PHP\php.exe composer.phar self-update
it worked perfectly

Proper files for socket.io 0.7?

I'm developing something with node.js and socket.io, but I'm doing my local dev on Windows for my own convenience. Installation instructions for socket.io say just do npm install socket.io. This is fine for my linux environment, and I'm guessing node will just find it in modules. But on Windows I don't know what to do. I got version 0.6 working fine somehow, managing to find the files I need.
Now, it looks like I need two sets of files, one for the server side and one for the client. There's also two repos on github, socket.io and socket.io-client. So I'm trying to just download all the files I need from there. The issue is that the server one refers to the client one, but the socket.io-client files aren't in the server repo. If I put the server files in, and reference them in my node server, it crashes on startup saying Cannot find module 'socket.io-client'.
tl;dr If I'm just copying files into my project directory, rather than doing an npm install, what is the proper file structure to get socket.io version 0.7 running?
Had the same issue here and I'm not using NPM either. But nothing to do with Windows: I'm on Ubuntu with the same prob.
You also need to have the socket.io-client module available in your node_modules path or wherever you keep the server-side socket.io module.
For solving similar issues I created a runner script that simply set the NODE_PATH env variable as needed and then execute my script. I also put my own modules (or the modules I don't want to install via npm) in the node_modules subdirectory of my project. A better explanation is here http://www.bennadel.com/blog/2169-Where-Does-Node-js-And-Require-Look-For-Modules-.htm
#!/bin/sh
export NODE_ENV=development
if [ "${NODE_PATH}" = "" ]; then
export NODE_PATH=$(npm -g root 2>/dev/null)
fi
node ${1}

Resources