2018-12-26

iPhone stuck at apple logo





When you get the option to restore or update, choose Update. iTunes will try to reinstall iOS without erasing your data.

https://support.apple.com/en-sg/HT201412



After install OS, iPhone will restart, and go into this: "Attempting data recovery"
Took 2hrs for:

  1. Download itunes.
  2. Install itunes.
  3. Update iPhone 6 Plus, 128GB.
  4. Turned off, force restart.
  5. Update iPhone 6 Plus, 128GB.
  6. Data recovery.
  7. Update Completed on screen.
















2018-12-21

Maven repository with ID and Password.








Referene URL:
https://www.onehippo.org/library/enterprise/enterprise-developer-information/hippo-maven-enterprise-repository-manual.html













Finding:

seems 2 sets(settings.xml & pom.xml) of maven config above linked by tag "<id>" so username & password in settings.xml will be used for repository.












































2018-12-18

Install DotCms "Caused by: com.dotmarketing.exception.DotRuntimeException: No Company!"



Reference URL:
https://groups.google.com/forum/#!topic/dotcms/fxUv2Q1hy2A





Caused by: ran ./bin/startup.sh script without sudo.


Solutions:
cd /home/dotcms/Programs/CMSs/dotcms_5.0.3;

sudo ./bin/startup.sh













2018-12-11

CsvToBean unable to get 1st column





Reference URL:
https://stackoverflow.com/questions/42328597/opencsv-populating-first-column-as-null


I met the same problem.

Solution

I saved the csv file again by utf-8 without BOM.
Then the first column is set with correct value.
No code needs to be changed.
I use the text editor named sakura.After choosing encoding as utf-8,a checkbox of BOM is enabled.Uncheck it and save the csv file.I think other editors have the same BOM option.

Reason

A BOM-ed UTF-8 string will start with the three following bytes. EF BB BF
The three bytes added to your csv file may changed your first column name.
  • Rather than link to existing questions you should raise a flag to mark this question as a duplicate of the one you believe answers it. – Neil Lunn May 31 '17 at 10:25


Ant builder from old environment hit issue after move to new IDE and new Machine(laptop)




Java Virtual Machine Launcher
A Java Exception has occurred.

Building workspace, Ant build





[eclipse-workspaces]\eclipse-jee-photon-R-win32-x86_64\.metadata\.log



!ENTRY org.eclipse.ant.launching 4 120 2018-12-11 14:46:39.726
!MESSAGE Error logged from Ant UI:
!STACK 0
java.net.SocketTimeoutException: Accept timed out
at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:89)










[Project Properties](Alt + Enter) > Builder

Select Ant Builder from the listing.
Edit
JRE
Separate JRE: Select JDK 1.8

































Windows 10 change login id




Solution
Reference URL:
https://www.groovypost.com/howto/change-account-name-windows-10/





Method 2: User Accounts Advanced Control Panel
There is another way you can do it. Press Windows key + R, type: netplwiz or control userpasswords2 then hit Enter. Select the account then click Properties


Select the General tab then enter the user name you want to use. Click Apply then OK, then click Apply then OK again to confirm the change.


2018-12-10

Spring controller submit chinese character into DB via JPA.






Web page chinese character to tomcat via Spring



Solved by solution below:
https://stackoverflow.com/questions/4318664/save-chinese-characters-with-spring-mvc-java





<filter>
    <filter-name>charsetFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>charsetFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>






Tomcat Java to MySql

SHOW VARIABLES LIKE "%version%";


mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 5.7.23                       |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| tls_version             | TLSv1,TLSv1.1                |
| version                 | 5.7.23                       |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86_64                       |
| version_compile_os      | Linux                        |
+-------------------------+------------------------------+
8 rows in set (0.00 sec)




Normally with this would be enough to solve the encoding

https://stackoverflow.com/questions/4782077/execute-mysql-query-contains-chinese-character-using-java-program

Try connecting with following switch
 String url = "jdbc:mysql://host/database?characterSetResults=UTF-8&characterEncoding=UTF-8&useUnicode=yes";




But I'm using JPA

https://stackoverflow.com/questions/18163328/jpa-utf-8-characters-not-persisted
Solved by solution below:
use the character encoding in the property of persistence.xml file
<property name="javax.persistence.jdbc.url" 
   value="jdbc:mysql://localhost:3306/blogdatabase?useUnicode=yes&amp;characterEncoding=UTF-8"/>































2018-12-06

eClipse Photon- Run As: maven install hit "Error: Could not find or load main class TLSv1.2"








Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version



JDK 7 issues from https://feitianbenyue.iteye.com/blog/2429045:

由于我的同事, 使用的 jdk 是 1.7 , jdk1.7虽然支持TLS 1.2 但是默认是 disabled的, 所以就会出现上面的 Received fatal alert: protocol_version  异常

下表格是 根据Oracle文档 各版本JDK默认使用的TLS协议:

JDK 8
(March 2014 to present)
JDK 7
(July 2011 to present)
JDK 6
(2006 to end of 2013)
TLS ProtocolsTLSv1.2 (default)
TLSv1.1
TLSv1
SSLv3
TLSv1.2
TLSv1.1
TLSv1 (default)
SSLv3

TLS v1.1 (JDK 6 update 111+)
TLSv1 (default)
SSLv3
Resolve by using
3. 解决方案
3.1 方案1 :   使用 http  去访问 maven  中央仓库




In Maven User Settings(settings.xml), assigned xml config below to my profile.

<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>repo.maven.apache.org</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>



Reference URL:

  1. https://feitianbenyue.iteye.com/blog/2429045
  2. https://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
  3. https://stackoverflow.com/questions/14396017/difference-between-repository-and-pluginrepository













2018-11-30

Development Environment configs...






Without configurations backup / update / restore capability for a development environment, this will cause into trouble for scenarios:


  1. Projects that actively to keep update to SDK.
  2. Projects that having huge interval of maintenance period.
  3. Always need to check out to new machine:
    1. organization which having high turn over rate.
    2. high diversity developers rotating between projects.

















2018-11-27

Check mysql access privileges.



resource URL: https://dev.mysql.com/doc/refman/5.5/en/privilege-system.html



SHOW GRANTS FOR user_abc;


2018-11-22

restart google drive cmd





Source URL:
https://www.reginout.com/help-center/google-drive-not-syncing-learn-how-to-fix-this-problem/





taskkill /f /im googledrivesync.exe

"C:\Program Files\Google\Drive\googledrivesync.exe"




2018-11-16

Exception while configure log4j 1.2 by java.util.Properties & PropertyConfigurator.configure


Scenario:

Exception while configure log4j 1.2  by  java.util.Properties & PropertyConfigurator.configure


log4j:WARN No appenders could be found for logger (com.test.TestLog).
log4j:WARN Please initialize the log4j system properly.


Searched by: WARN No appenders could be found for logger after PropertyConfigurator.configure java.util.Properties

found: Log4J warn please help me urgent - Experts Exchange
















Source URL: https://www.experts-exchange.com/questions/24432318/Log4J-warn-please-help-me-urgent.html


> after my application loading then my log file successfully creating file and writing what every error into the log file

because it is working fine, and is not causing your error

> but why that error is coming.....................

because other parts of the application are trying to use log4j before it is configured


2018-11-13

Practice in 1440


Practice in 1440


Source URL: https://www.youtube.com/watch?v=-Qy2vist-XQ&t=274s

The 15 secrets successful people know about time management.

So here are the 15tips , incase u r in hurry;)

41% of items that people put on their to-do lists are never done at all, to-do lists is the graveyard, is important but not urgent

1) Time is ur most valuable and scarcest source (1440 mins a day)
2) Identify ur most imp task and do it first.
3) Work from ur calendar not from a to- do list.
4) To overcome procrastination beat ur future self.
5) There will be always more to do
6) Always carry a notebook(to capture info.)
7) Control ur inbox( to avoid distractions)
8) Schedule and attend meetings as a last resort(say no to things)
9) Say no to everything that doesnt support ur immediate goals
10) Follow the powerful pareto principle (80/20 rule)
11) Focus on ur unique strengths and passion.
12) Batch ur work with recurring themes.
13) If u can do a task in less than 5 mins , do it immediately
14) Routinely use early mornings to strength ur mind ur body and ur spirit.
15) Productivity is about energy and focus and not time. And follow pomodoro technique, take breaks , sleep properly , do exercise,eat properly.
And watch full video to get proper explanations.




2018-11-12

apache 2.4.6 virtualhost reverse proxy tomcat proxy:error] [pid 3363] AH00940: HTTP: disabled connection for (localhost)



sudo tail -200f /etc/httpd/logs/yourdomainname-error_log



[Mon Nov 12 19:40:54.576505 2018] [proxy:error] [pid 3363] AH00940: HTTP: disabled connection for (localhost)
[Mon Nov 12 19:40:54.615281 2018] [proxy:error] [pid 3365] AH00940: HTTP: disabled connection for (localhost)



Source URL: https://serverfault.com/questions/382076/apache-proxy-not-working-for-a-localhost-port


Here is the solution for your problem:
To turn on this boolean you simple have to use this line (root permissions)
setsebool -P httpd_can_network_connect on
or
sudo setsebool -P httpd_can_network_connect on
Hope that helps. Reference see here: https://wiki.centos.org/TipsAndTricks/SelinuxBooleans







apache 2.4.6 virtual host reverse proxy Your browser sent a request that this server could not understand


The case i hit this is due to apache configuration version issue.

Source URL: https://stackoverflow.com/questions/10445455/apache-dont-have-permission-to-access-on-this-server-when-i-am-using-virtua

This configuration was valid for apache version 2.2
First check your apache version by typing apachectl -V in your terminal.
If it shows something like this
Server version: Apache/2.4.27 (Ubuntu)
Server built:   2018-04-18T14:20:05
then your apache version has updated but the conf you are using is deprecated.
So instead of
2.2 configuration:
Order allow,deny
Allow from all
use this:
2.4 configuration:
Require all granted
For further documentation related to the upgrade, follow the official docs: