couchbase where can I execute cbq command - couchbase

I have a couchbase server and I want to connect to it from my query engine. I asked a lot and I found that I have to use this command
./cbq-engine -couchbase http://--couchbase-server-name--:8091/
regarding that I have many questions about that command, like where should I put the username and password, why should I use the port 8091 when my server is working online so port is 8080, I don't want the answer of those questions, but I need to know where should I execute that command?
I tried on cmd on but I got that cbq is not defined.
I am on windows 7 64bit
please help

Since you're on windows, I believe the difference is that it's cbq.exe and you'll need to have it in your path or be in that directory. The downloads as posted at http://www.couchbase.com/communities/n1ql do have cbq.exe included:
.
├── LICENSE.txt
├── README
├── cbq-engine.exe
├── cbq.exe
├── data
├── start_tutorial.bat
└── static
2 directories, 5 files
Also note that the Java 2.0, node.js 2.0 and some other SDKs have experimental support for N1QL querying.

Related

Weird warning in gcloud console: The path is in a mounted secrets volume [...] but does not correspond to any secret

I'm deploying a gcloud function with two mounted secrets (from google secret manager), my local dir structure is the following:
├── index.js
├── mounted-secret-config
│ ├── config.js
├── mounted-secret-credentials
│ └── googleServiceAccountCredentials.json
├── package-lock.json
└── package.json
config.js and googleServiceAccountCredentials.json are ignored so the deploy process doesn't upload them.
I deploy using this command:
gcloud functions deploy <...> --region <...> --trigger-http --runtime nodejs16 --allow-unauthenticated --gen2 --memory 256Mi --set-secrets=/workspace/mounted-secret-config/config.js=configjs:latest,/workspace/mounted-secret-credentials/googleServiceAccountCredentials.json=googleServiceAccountCredentials:latest
It works, the node app finds the files and overall works but after each deploy I see this in the gcloud logs:
2022-08-26 10:11:18.130 CEST Could not open file at path /secret_volume_0/config. The path is in a mounted secrets volume, but the exact path does not correspond to any secret specified in the mount configuration.
Warning
2022-08-26 10:11:18.182 CEST Could not open file at path /secret_volume_0/package.json. The path is in a mounted secrets volume, but the exact path does not correspond to any secret specified in the mount configuration.
Warning
And after each http request to my service i get:
2022-08-26 10:05:33.511 CEST Could not open file at path /workspace/mounted-secret-config/config. The path is in a mounted secrets volume, but the exact path does not correspond to any secret specified in the mount configuration.
Warning
2022-08-26 10:05:33.572 CEST Could not open file at path /workspace/mounted-secret-config/package.json. The path is in a mounted secrets volume, but the exact path does not correspond to any secret specified in the mount configuration.
I've no idea what's going on here, I don't even know who's logging this. /workspace/mounted-secret-config/config doesn't exist, but /workspace/mounted-secret-config/config.js (note the .js extension) does, and the app finds it or it would not even start. /workspace/mounted-secret-config/package.json this doesn't but it isn't supposed to, who's even trying to access it? And why it doesn't complain about the other mounted secret?
config.js is required with: require('./mounted-secret-config/config')
If I change it to require('./mounted-secret-config/config.js') (adding .js) one of the two warnings disappears. Is node trying to import the exact name (giving the warning) and then falling back to config.js? But what about the package.json?
This is not a real solution, more like a workaround, feel free to add a real solution if you find it.
What I did to "fix" the problem was change the format of my config file from .js to .json (easy in my case because it only contained a dictionary with few keys/values)
Everything else stayed the same, I still read the file with require. I don't know what weird thing node was doing with the .js, but it doesn't do it with .json.
Both warning disappeared (including the one about package.json).

How to setup/configure laravel project on cloud server

I have this laravel application on /var/www/html/application-folder/public_html
When I enter the apache server IP it doesn't load the laravel application instead it displays the Apache home page
How can I display the url /var/www/html/application-folder/public_html ?
When I type the full url I get the following error:
Forbidden
You don't have permission to access /folder/public_html/index.php on this server.
Apache/2.2.15 (CentOS) Server
If you have full root access to your server then you can
Step 1
upload your laravel project from the development machine(local) to the /var/www on your server - upload all folders except vendor and node_modules
Step2
once the project is uploaded, run composer install, if you need any of the node packages run npm install
Step 3
create virtual host for your site with DocumentRoot /var/www/yourProjectFolder/public
Step 4
Ensure storage folder has write permissions for your apache/webserver user - recursively
Step 5
Ensure that public folder has appropriate permissions - recursively, if you have uploaded the project as root then you will need to change the owner/permissions
Following this workflow you will be able to get your Laravel site up and running.
Important distinction to make here is that you have full root access to your server and that you can install composer and/or npm on your server before proceeding with the workflow.
If you can't install composer and/or npm on your server, then you have to upload the vendor directory to your server as well (and if you need any node packages then the node_modules as well) - following the documentation link in my comment above will help you.
Refer Virtual Host on Cent Os 6

Subdirectories in openshift project cannot be found

I built a site using a php openshift project and accessing the root directory via http works fine. However, all the root directories give me a 404 not found, like this one: http://test.toppagedesign.com/sites/
I checked with ssh, and /app-root/repo/sites and app-deployments/current/repo/sites/ both exist.
EDIT
Added a directory called php and now I have 503 errors for everything...
EDIT 2
I deleted the php directory, now the 503 errors are gone. However, I do still get 404 errors for the subdirectory.
Here is my directory tree: http://pastebin.com/hzPCsCua
And I do use git to deploy my project.
php is one of the alternate document roots that you can use, please see the March Release blog post here about this (https://www.openshift.com/blogs/openshift-online-march-2014-release-blog)
As for the sub-directories not working, can you ssh into your server and use the "tree" command to post the directory/file structure of your project? Also are you using Git to deploy your project or editing files directly on the server?
You need to have an index.php or index.html file in any directory that you want to work like app-domain.rhcloud.com/sites , if you just have sub-directories, how would it know what to show? Also, indexing (showing a folders contents) is not enabled for security reasons, and I believe there is no way to enable it.
This sounds like it could be a problem with how you are serving your static content.
I recently created a new sample app for OpenShift that includes:
a basic static folder
an .htaccess file (for serving assets in production)
support for using php's local server to handle the static content (in your dev environments)
Composer and Silex - a great starting point for most new PHP apps
You can serve the project locally if you have PHP-5.4 (or better), available in your dev environment:
php -S localhost:8080 -t static app.php
For a more advanced project that is built on the same foundation, take a look at this PHP+MongoDB mapping example. I wrote up a blog post with some notes on my process for composing that app as well.
Hope these examples help!

How can I serve only statics files on Google App Engine?

I wrote a game with HTML5. Locally, it only works if I run:
python -m SimpleHTTPServer
And then I open localhost:8000. So, just a bunch of .html and .js files won't work. I want to put my game online and because of this Github (Pages) is out of question, because it won't work.
This is the part of the code I need a server for (I do realize that localhost:8000/res/ won't work on App Engine, I'll need to change the address):
var mapFile = new XMLHttpRequest();
var self = this;
mapFile.open("GET", "http://localhost:8000/res/map" + mapNumber.toString() + ".txt", true);
mapFile.onreadystatechange = function() {
if (mapFile.readyState === 4) {
if (mapFile.status === 200) {
self.lines = mapFile.responseText.split("\n");
self.loadTilesFromLines();
}
}
};
mapFile.send(null);
So, I heard that Google App Engine would work, it supports Python and is very popular. Now, I don't need anything like what they have in their documentation (which is pretty well-written):
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, webapp2 World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
All I need is a SimpleHTTPServer that allows me to open my index.html on my-app.appspot.com.
I did try the example and got it up and running, but I can't force my browser to open index.html or src/ or even res/.
So, I am not even sure if Google App Engine supports what I'm trying to achieve here. The documentation just focus on building applications that use Python and all I needed with Python was a SimpleHTTPServer, which I don't think I need with App Engine.
Yes it is very doable on what you're trying to achieve here. Since you just want to serve static files it is very simple and you don't need to include any Python code.
Let's assume that you have this following structure:
└── my-game
├── app.yaml
└── static
├── index.html
├── js
│   └── script.js
└── res
└── map.txt
This app.yaml should look like this:
application: my-app
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /
static_files: static/index.html
upload: static/index.html
- url: /
static_dir: static/
After you're going to install the Google App Engine SDK (if you didn't do that already), you will be able to run the dev_appserver.py command from your terminal. If you have the above structure try to run it using the following:
$ dev_appserver.py /path/to/my-game
If everything went smoothly you'll be able to see your index.html on http://localhost:8080, the map.txt on http://localhost:8080/res/map.txt and you should be able to figure out the rest.
Note that you could still run your application using the python -m SimpleHTTPServer from within the static directory and test it on localhost:8000.

Site Not Generating New Files

My jekyll site is generating files fine on my computer but is not working at all on the server; I can edit the _site folder to make the changes happen, but it won't generate on the server. I am running jekyll --server with no errors. Any suggestions?
My _config.yml file is:
server: false
permalink: /:year/:title/
Are you running any plugins? Unless you have a server that can run Ruby, plugins won't run anywhere besides locally. GitHub doesn't allow Ruby to be run for security reasons.
I'm surprised it's generating fine locally, since you should probably have server:true. More info on your server setup would be helpful if this doesn't solve your issues.