apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
# How to downgrade helm version on server and client | |
# https://medium.com/@jyotirbhandari/how-to-downgrade-helm-version-on-server-and-client-4838ca100dbf | |
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash -s -- --version v2.16.9 |
package com.xxx.common.config; | |
import com.atomikos.icatch.config.UserTransactionServiceImp; | |
import com.atomikos.icatch.jta.UserTransactionImp; | |
import com.atomikos.icatch.jta.UserTransactionManager; | |
import net.sf.ehcache.transaction.manager.TransactionManagerLookup; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
import org.springframework.context.annotation.Bean; |
ArrayList<Integer> array = new ArrayList<>(4); | |
ArrayList<Integer> input = new ArrayList<>(4); | |
for(int i=0;i<10;i++){ | |
array.add(i); | |
} | |
Collections.shuffle(array); | |
for(int j=0;j<4;j++){ | |
input.add(array.get(j)); |
#!/usr/bin/env bash | |
echo " | |
---------------------- | |
MONGODB | |
---------------------- | |
" | |
# import mongodb 4.0 public gpg key | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 |
A redux app is a chicken and egg problem. Given a particular state, the app should render a certain thing. But... where does that state come from?
Given a blank state, the app needs to rely on the URL to fetch the right data to populate the state.
In a server-side app, the initial state is determined in exactly this way. Given the initial URL, populate the state, render the app, send it to the client.
In a client-side app the situation is exactly the same, except it's totally different. On the client you have way more contextual information than just the URL. Given the URL, the current app state, a components own props and its internal state... a component must decide which data it needs loaded.
Cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
Ondrej Sika <[email protected]>
use DATABASE_NAME
This is a non-XA pattern that involves a synchronized single-phase commit of a number of resources. Because the 2PC is not used, it can never be as safe as an XA transaction, but is often good enough if the participants are aware of the compromises. The basic idea is to delay the commit of all resources as late as possible in a transaction so that the only thing that can go wrong is an infrastructure failure (not a business-processing error). Systems that rely on Best Efforts 1PC reason that infrastructure failures are rare enough that they can afford to take the risk in return for higher throughput. If business-processing services are also designed to be idempotent, then little can go wrong in practice.
Consider a jms based service, where there is an inbound Queue manager (QM1), an outbound queue manager (QM2) and a database (DB). Here are the scenarios that I would like to cover using Best efforts 1 PC commit process:
- Start MQ transaction on QM1 2
# copy/import data from heroku postgres to localhost pg database | |
# useful for copying admin's work on live site into local database to reproduce errors | |
# https://devcenter.heroku.com/articles/heroku-postgres-import-export | |
# take heroku pg snapshot and download | |
heroku pg:backups:capture | |
heroku pg:backups:download | |
# load the dump into local postgres database, assuming $DATABASE_URL set locally |