Learning with learners
W3LC brings you Discussions For IT People. Stuffed with personal touch & humor by Anwar Jamal Faiz.
A great place to read and participate in IT discussions. With over 3.5 million hits from bright technical minds across the globe, W3LC urges to read, enjoy, and comment. Learning, ofcourse, would just be a side-effect. Also visit MeOnShow. And, Technology Job Puzzles.
Showing posts with label port. Show all posts
Showing posts with label port. Show all posts
Wednesday, March 11, 2020
Friday, March 6, 2020
First Hello World using Hack & HHVM from Facebook
1. Install HHVM on MacOS via Homebrew:
brew tap hhvm/hhvm
brew install hhvm
The out-of-the-box HHVM configuration won't need tweaking by most new users. Notably, the JIT compiler that gives HHVM its speed is on by default. If you want to take a look at the configuration used, it's at /usr/local/etc/hhvm/php.ini in MacOS.
2. Test: After installing HHVM, change to the directory where your code lives, and start up HHVM:
hhvm -m server -p 8080
-m represents the mode and here indicates that HHVM is running in HTTP server mode.-p configures the TCP port that HHVM uses to listen to HTTP requests. The default port is 80, the standard HTTP port. However, that port requires root access, so for this example, we will use port 8080.This will start the server as follows and then you can test on browser.
3. Write a simple "Hello World" program named
<<__entrypoint>> function main(): noreturn{ echo "Hello World in Hack Language! \nThis is Anwar Jamal Faiz"; exit(0); }
Save this
See in browser:
You may also write the program as:
hello.hack:<<__entrypoint>> function main(): noreturn{ echo "Hello World in Hack Language! \nThis is Anwar Jamal Faiz"; exit(0); }
Save this
hello.hack in the same directory that you ran the hhvm command from above. Then, load http://localhost:8080/hello.hack in your browser and verify you see "Hello World!" appear.See in browser:
You may also write the program as:
<<__entrypoint>>
function main(): noreturn{
echo "Hello World in Hack Language! \nThis is Anwar Jamal Faiz";
exit(0);
}
4. You can directly run file using hhvm itself.
$ hhvm hello.hack
Note: You can configure HHVM too. Running HHVM automatically at boot as a service (instead of just on the command line as above) unfortunately does require some configuration. See the proxygen documentation for details. However, default settings are okay for any average usecase.
Tuesday, November 19, 2019
How to install Redis and run its instance
First, step first. You can simply install it using homebrew
$ brew install redis
After installation you can check that it creates a configutration file at:
/usr/local/etc/redis.conf
Then, you can verify the install as follows:
$ brew info redis
You can start an instance i.e Start Redis server using the configuration file.
$ redis-server /usr/local/etc/redis.conf
By default, it Runs in standalone mode on Port: 6379
Test if Redis server is running.
$ redis-cli ping
It will replu=y you pong!
To Uninstall Redis and its files.
$ brew uninstall redis
What more do you want. So cheers.
:)
Subscribe to:
Posts (Atom)



