I have an image with code that I need to update very often. In order to see the new changes I have to delete the containers and create a new docker-compose.
Is there another way to do it?
I have an image with code that I need to update very often. In order to see the new changes I have to delete the containers and create a new docker-compose.
Is there another way to do it?
I have a basic node container
ROM node:boron
RUN npm install
EXPOSE 1337
CMD ["npm","start"]
but when launching it it tries to connect to mongodb://localhost:27017/my-bd
what is a local mongo on my mac...
This generates the following error:
Unable to ensure uniqueness for usernames: MongoNetworkError:
failed to connect to server [localhost:27017] on first connect
[MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
Any ideas?
I have a background service that lasts approximately 5 minutes and executes X methods every X time each, it is necessary that these times be fulfilled and be consecutive.
The problem is that android 7 kills the service on "turn off screen".
Can I do this with a JobScheduler? (the service has timers inside), or should I use a foreground service?
Example of my service:
public class MyServide extends Service {
class MyBinder extends Binder {
MyServide getService() {
return MyServide.this;
}
}
public IBinder onBind(final Intent intent) {
if (intent != null) {
Observable.timer(randomTime), TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> {
//random code
});
}
return MyBinder;
}
}
I have an activity with two FrameLayouts, each with a fragment. But when doing a backpress first the fragmentA returns to its previous state, and after another backpress the fragmentB returns to its previous state.
I want when backpressing both FragmentA and FragmentB to return to their previous state at the same time.
Here the code:
mFragmentService.replaceAndAddToBackStack(FragmentA.newInstance(), R.id.container_top);
mFragmentService.replaceAndAddToBackStack(FragmentB.newInstance(), R.id.container_bot);
public void replaceAndAddToBackStack(Fragment fragment, @IdRes int idRes) {
mFragmentManager
.beginTransaction()
.replace(idRes, fragment)
.addToBackStack(fragment.getClass().getName())
.commit();
}
Any ideas?
I have a Parse Server node.js app where I need to use console.log to debug the cloud code, the problem is that launching the app like this:
node index.js
the log appears, but if I launch it with pm2:
pm2 start index.js
The console.log logs do not appear but the native parse logs do appear, (in the previous case both appear)
Any ideas? Thank you
Reading about the best way to save an api key in Android, I came to the conclusion that a good way would be to save it using C++ in the NDK.
To hide a key in the NDK it would be something like this:
#include <string.h>
#include <jni.h>
jstring Java_com_riis_sqlndk_MainActivity_invokeNativeFunction(JNIEnv* env,
jobject javaThis) {
return (*env)->NewStringUTF(env, "pass123");
}
The question is... how do I indicate in an Android project that I want to write in c++?
Here the tutorial in question: see tutorial
Cheers
I've been trying this for a long time, looking for documentation and different questions on stackoverflow but I haven't found the key.
I need to launch a service that doesn't die when closing the APP completely.
I have tried
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
with the permission:
<uses-permission android:name="android.permission.WAKE_LOCK" />
When launching it:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock cpuWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
cpuWakeLock.acquire();
Intent intent = new Intent(this, WebViewService.class);
bindService(intent, serviceConnection, BIND_AUTO_CREATE);
And endless codes that have not worked... is it possible?
Any advice? Thank you!
I'm starting to learn the advantages of RxJava, and I would like someone to give me a hand to get more to the point.
The issue would be to modify this code made with listeners:
public void getData( final OnResponseListener listener ){
if(data!=null && !data.isEmpty()){
listener.onSuccess();
}
else{
listener.onError();
}
}
Listener:
public interface OnResponseListener {
public void onSuccess();
public void onError();
}
And the one who listens:
object.getData( new OnResponseListener() {
@Override
public void onSuccess() {
Log.w(TAG," on success");
}
@Override
public void onError() {
Log.e(TAG," on error");
}
});
How to do this with observables? Thank you
I configured https with letsencrypt in nginx, and accessing by ip in most cases if it redirects to https, but if I enter specifically by this route it http://11.255.123.0:4040/login
accesses unencrypted, any suggestions? I leave here the nginx configuration:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mydomain.com www.mydomain.com;
return 301 https://$server_name$request_uri;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:4040/;
proxy_set_header Host $http_host;
proxy_redirect off;
}
I've been investigating more and all the ones that have to do with the active docker images are without redirection /parse :1337 and :4040
I need to launch a docker-compose on an ubuntu-server every time it is rebooted.
I have tried to create a crontab like this:
@reboot docker-compose -f /home/user/docker-compose/docker-compose.yml up -d
But when I restart it this has not given results, any ideas?
Good day good evening. I am using the yahoo weather API in an application but I have a problem.
This is the query I do to do the GET . Maybe it returns data, maybe it doesn't, that's my problem. Is there any IP limitation for accessing several times in a short time? In yahoo it says that there is a limit per ip of 2000 daily requests, but I don't see anything else...
Do I have to add an api key? This is also not clear to me.
Thank you!
I need to join certain parts of a game made in Unity with an android app, is it possible? That is, put a game-like intro with unity and then use Android's own activities.
Something similar to joining java with react native.
Cheers
I have set up a Parse Server on an ubuntu, and every time I add a modification to the index.js I have to restart, which takes 4 or 5 seconds to come back to life.
Is there a better way to add changes without crashing the server?