This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.entity.ContentType; | |
import org.apache.http.entity.mime.HttpMultipartMode; | |
import org.apache.http.entity.mime.MultipartEntityBuilder; | |
import org.apache.http.impl.client.HttpClientBuilder; | |
import org.json.JSONObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proxy settings have not been autoconfigured by default. You need to configure Proxy settings manually | |
On windows, it's automatically configured. This issue troubled me for few days. Here's how I solved it | |
There are two approaches to configure proxy setting on ubuntu | |
By terminal | |
step 1: run nano .bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proxy settings have not been autoconfigured by default. You need to configure Proxy settings manually | |
On windows, it's automatically configured. This issue troubled me for few days. Here's how I solved it | |
There are two approaches to configure proxy setting on ubuntu | |
By terminal | |
step 1: run nano .bashrc |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I tried to connect mysql server with root user that's running on a docker container | |
The warm message was shown Host '172.18.0.1' is not allowed to connect to this MySQL server | |
In MySQL database, execute this SQL script to list all existing database users | |
SELECT host, user FROM mysql.user; | |
It will display a table, for example like this: | |
+------------+------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker cp <containerId>:/file/path/within/container /host/path/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note different python builds can have different modules, they do not share modules | |
Python 2.7 has it own pip and pipenv | |
Python 3.7 has it pip3 and pipenv | |
Upgrading pip3 and pipenv for python 3 | |
pip3 install --upgrade pip. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
JPA (Java Persistence API) | |
Transaction Management with an Entity-Mananger: | |
--- | |
entityManager.getTransaction().begin(); | |
entityManager.persist(<some-entity>); | |
entityManager.getTransaction().commit(); | |
entityManager.clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
version="1.0"> | |
<!-- derby --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation | |
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration | |
@SpringBootApplication | |
public class FooApplication { | |
public static void main(String[] args) { | |
// Bootstrap the application | |
SpringApplication.run(FooApplication.class, args); | |
} | |
} |
OlderNewer