How to access CouchDB server from another computer? - database

I created a couchDB on my computer, that is I used the Python line server = couchdb.Server('http://localhost:5984')
I want to share this database with two other colleagues. How can I make it available to them? For the moment, I am comfortable giving them full admin privileges until I get a better handle on this.
I tried to read the relevant parts of CouchDB: The Definitive Guide, but I still don't get it.
How would they access it? They can't just type in my computer's IP address?

In order to avoid NAT problems, I would use an external service like Cloudant or Iris Couch. You can replicate your local database against the common DB in the cloud and your colleagues can connect to it.

sure they can.
Start your server like this:
server = couchdb.Server('http://192.168.56.1:5984')
Where the IP address is the IP address of your PC. Find this out via the cmd prompt and ipconfig. Then they type in their python console
server = couchdb.Server('http://192.168.56.1:5984')
Yep, exactly the same. The IP identifies it for both you and everyone else. If you want them to access it in a browser then I guess you'll need to write that front end however.
If you are not on the same local network the the same more or less applies, except you'll have to add port forwarding into the mix.

I would use ngrok (https://ngrok.com/) its free and it will expose your localhost to colleagues in order to access the db.
once you download and execute, in the command line type ngrok http 192.168.56.1:5984 and they should be able to access it when you provide them the url ngrok returns, which exposes your localhost externally

Related

connect to a database server without exposing a network share

this is quite simple to do in many databases, but I have not yet found a way to achieve this with Advantage in Server-mode over the network.
assume 2 PCs:
SERVER: running Advantage Database Server, and contains A database
CLIENT: contains a simple application, or even just Advantage Architect.
If the folder containing this database was shared via the OS (network share, with read/write permissions), then establishing connection is straight-forward.
I am however, precisely trying to avoid exposing a network share.
In Firebird, for example, this can be done using connection path:
SYSDBA#SERVER:C:\SomePrivateFolder\myapp.FDB
Isn't this the reason for exposing a port for the database (6262)?
What's interesting is that they offer something called "internet" connection. I highly doubt they would require a network share over the internet to access the database.
So, is this doable, and if so, would love a hint.
Thanks!
Edit:
following the answer below, adding more details.
SERVER contains 2 folders, each one with its ADV Dictionary:
C:\Data\mydata.add (not a shared folder)
C:\DataShared\mydata.add (shared folder)
I am able to connect to the second one using the connect path \\SERVER:6262\DataShared\mydata.add
to connect to the first one i've tried:
\\SERVER:6262\C:\Data\mydata.add
\\SERVER:6262\Data\mydata.add
\\SERVER:6262:C:\Data\mydata.add
none of which worked.
Note that I am not calling the stored procedure directly, but using the Delphi ADS components, which certainly internally call that same stored procedure.
I am certainly connecting as Remote (have the ADS Server launched on SERVER). For the other parameters, I am using TCP/IP as comm. type, and default ADSSYS / blank password.
with this setup in mind, what would the path be to connect to C:\Data\mydata.add on \\SERVER?
Thanks again
No need to expose your database on a shared folder. You'd only do that if using the LOCAL connection. If using INTERNET or REMOTE, then simply connect using API AdsConnect60(). Look it up on the help file.
UNSIGNED32 AdsConnect60( UNSIGNED8 *pucConnectPath,
UNSIGNED16 usServerTypes,
UNSIGNED8 *pucUserName,
UNSIGNED8 *pucPassword,
UNSIGNED32 ulOptions,
ADSHANDLE *phConnect );
Furthermore, you can hide the path where your data resides by using a server side Alias. Look it up on the help files. It is quite simple.
To simplify things, do this:
Run ads server configuration utility, go to "Configuration Utility" tab and inside that, go to "File Locations" tab. Write down path for Error and Assert Log Path. Let's assume it is c:. Let's also assume server is 192.168.1.1.
Now create a file named AdsServer.ini in that path (c:) with section: [ServerAliases] and a line adsdata=c:\data. Now use API function AdsConnect60 like this: AdsConnect60( "\\192.168.1.1\Adsdata\Mydata.add", ADS_REMOTE_SERVER, "adssys", "password", ADS_DEFAULT, &hConn ) ;
If you are working from Delphi or some other language make sure you check out the clases that are already built wrappers for the API.
It is all really-really well documented: http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?ace_adsconnect60.htm

Per machine variables in ExtJS 7

I am developing an app using ExtJS 7 and have a team of developers.
Each user is getting their external API's from a different source, i.e some localhost, some 192.168.1.100 etc etc
Is it possible to write something like an env file that each developer can add to their directory root and then I can pull in a variable into the app?
There is a way in pretty much every other system these days, but it seems Ext doesnt do this apart from hardcoding the value into the app.json but as this is committed to source control, it gets really messy
Something simple like
API_URL=https://localhost/api
If anyone has developed something like this, could they please share, I haven't been able to find anything
Just let them setup a common local development host-name, either in /etc/hosts or C:\Windows\System32\Drivers\etc\hosts. This file is being queried, before any DNS server will be queried - so it could even be the host-name of the public API, which still would resolve locally.
127.0.0.1 localhost
# 127.0.0.1 api.local
192.168.1.100 api.local

Connection tab of Google Cloud SQL instance taking forever to load the console interface

I want to access my cloud database from my computer but the connection tab cannot load to finish so that I can enter my IPv6 address. This is the second time am experiencing this issue and my network is strong enough. It's now been 20 minutes, but still the three dots are just indicating progress that never ends.
The first time it happened I had to leave my computer and go for a walk. This really frustrates me since it's in production and rapid updates should not be delayed.
How can I fix this?
POSSIBLE CAUSE:
It happens after I re-open Mysql-workbench and it fails reason being my IPv6 has been changed possibly by my Internet Service Provider (ISP) (I dont know of other possible reasons). After Mysql-workbench fails, I go to the console to update the new one but this problem occurs.
I think Cloud SQL security (don't know exact name) is treating this a malicious access attempt hence initiating this weird delay for immediate subsequent access. If so, then this is purely impractical for b/s since my computer does not tell me that my IPv6 has changed, besides, that normal regular IPv6 updates can't be treated as malicious lest developers continue to suffer this issue.
EDIT: This time it finished loading after approximately 50 minutes.
Have you considered using the Cloud SQL proxy to connect to your instance instead of white-listing an IP? White-listing an IP can be insecure since it provides anyone on your network access, and inconvenient (as you have discovered) because if your IP changes you lose access.
The proxy uses a service account to provide authenticated access to your instance, so it will work regardless of your IP (as long as your service account has the correct permissions). Check out these instructions for a guide on starting it up.
(As a side note, it's a difficult problem to tell why your connectivity tab is failing to get load. It might be a browser add on or even a networking failure in your local network that is interfering. You can check the browser dev console to see if any errors appear)

Use different IP address for every loop in running iMacros script

Can anyone help me with the iMacros? This will be my first time that i will use this. I need to create a script to visit a certain website but for each visit IP address should change for the website to count it as a unique visitor.
Here's what i have so far:
URL GOTO=http://sampleWebsite.com
WAIT SECONDS=10
SET !ERRORIGNORE YES
PROXY ADDRESS=192.168.4.5:80
BYPASS=http://sampleWebsite.com
I'm really not sure about the PROXY ADDRESS and BYPASS script part.
I don't think you can do that.
Your IP address is a property of your computer, not your browser.
Typically it is allocated dynamically via DHCP, but could be set statically via eg control panel.
In the DHCP case, you could in theory release the Ip address, and hope the DHCP server allocates a different one
hint: it probably wont.
In the static case, modification typically requires user interaction and administration permission.
However, assuming this website is public, and not on the local network, then it doesn't matter. The Ip address the website sees is your public IP, and this is set by the ISP. You have no control over this.
By the way, IP address is a terrible way of detecting unique visitors, as it doesn't allow for large corporate environments where hundreds/thousands of unique users will share one external IP.
It is more likely that the website would use additional information, for instance cookies, user agent strings etc. You might have better results if you modify the user agent string, and clear cookies

Implementing Domain Name System

I am working on a project in embedded c.The project is the electronic Cash Register.In this
project i need to send the sale data through gprs on to a server our own made application
in C#. Now i have to change the ip of the server on the machine side because of dynamic ip.i
want to implement dns in my Machine so that idont need to change ip every time.plz anyone
in this.And what changes does i need to do on the server side.
Is your IP dynamic because of your ISP setup?
If so i'd say the easiest way would be to sign up to someone like no-ip.com. their free service will give you a url and an application to install on your server. When your ip changes on the server the application updates their records so the url is routed to the correct IP. Basically in short, going to the url there give you will alway go to your server.
Hope this helps.
I'm not sure that you want or need to implement a DNS server (and this is a very complex task, because DNS is a complex protocol, and you need to think of security issues). You only need to use a library call (like getaddrinfoand friends) which use eventually DNS to transform a host name to an IP address or vice versa.

Resources