Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Thursday, July 14, 2016

Ubuntu Commands and Tips #2

Memo - commands and tips in ubuntu


1. Network setting on ubuntu : when you can't connect lan(wired) network
- open follows
$ sudo gedit /etc/network/interfaces
- text in file
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface

auto lo
iface lo inet loopback
- case1_auto : add as follows under text in file
auto eth0
iface eth0 inet dhcp
- case2_manual : add as follows
auto eth0
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers ~~~~~
- save and network restart
$ sudo ifdown eth0
$ sudo ifup eth0
ref : http://blog.iolate.kr/89
ref : http://promobile.tistory.com/300


2. Error : " ubuntu wired network unmanaged "
- open follows
$ sudo gedit /etc/NetworkManager/NetworkManager.conf
- file contains, set "managed=true"
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false
- save and restart network manager
$ /etc/init.d/network-manager restart
ref : https://wishkane.wordpress.com/2013/07/11/ubuntu-network-manager-wired-networks-are-unmanaged/


3. Activate workspaces
- System Settings -> Appearance -> Behavior
- check "Enable workspaces"


4. 우분투 한글 및 한글 키보드 설정
- System Setting -> Language Support -> Language Support install
- System Setting -> Text Entry -> 왼쪽 하단에 '+'를 이용해서 'Korean(Hangul)' 이라고 되어있는 항목을 추가
(되도록이면 영어 - 한국어 순으로 설정)
- System Setting -> Keyboard -> Shortcuts -> Typing -> Compose Key를 'Disabled'에서 'Right Alt'로 변경
- terminal에 아래의 내용을 입력 (한/영 키 사용 위함)
$ sudo apt-get install dconf-editor
- 설치가 완료되면 org -> gnome -> desktop -> wm -> keybindings -> switch-input-source의 값을 'Hangul'이라고 입력



Monday, July 11, 2016

Errors and Problems - text, image, title clipping

Memo - occurred errors & exceptions

Linux 14.04
Eclipse Mars 4.5.2
Jsoup


1. DB Connection
- call URL data
Error : exception in thread main java.net.sockettimeoutexception read timed out
ref : http://stackoverflow.com/questions/6571548/i-get-a-sockettimeoutexception-in-jsoup-read-timed-out

- insert userAgent
Error : exception in thread main org.jsoup.httpstatusexception http error fetching url. status=403
ref : http://stackoverflow.com/questions/14467459/403-error-while-getting-the-google-result-using-jsoup

- url of pdf
Error : org.jsoup.unsupportedmimetypeexception unhandled content type. must be text/*
ref : http://stackoverflow.com/questions/16327105/connection-error-org-jsoup-unsupportedmimetypeexception-unhandled-content-typ



2. Jsoup
Error : jsoup java.util.zip.zipexception not in gzip format
ref : http://stackoverflow.com/questions/13018732/java-util-zip-zipexception-not-in-gzip-format
ref : https://github.com/MrL1605/Pronto-Auth/blob/master/logout.java
Jsoup.connect(url).userAgent(~~~)
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,**;q=0.8")
.header("Accept-Encoding", "gzip, deflate")


Error : java.io.ioexception too many redirects occurred trying to load url
ref : http://stackoverflow.com/questions/7765316/too-many-redirects-occurred-trying-to-load-url-there-arent-any-redirects
ref : https://github.com/MrL1605/Pronto-Auth/blob/master/logout.java
.userAgent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0")


Error : exception in thread main org.jsoup.unsupportedmimetypeexception unhandled content type
ref : http://stackoverflow.com/questions/16327105/connection-error-org-jsoup-unsupportedmimetypeexception-unhandled-content-typ
Jsoup.connect(articleURL)~~~ .ignoreContentType(true)


Error : javax net ssl sslhandshakeexception sun security validator validatorexception pkix path building failed
ref : https://www.lesstif.com/pages/viewpage.action?pageId=12451848
$ wget https://java-use-examples.googlecode.com/svn/trunk/src/com/aw/ad/util/InstallCert.java

$ gedit InstallCert.java
remove line "package com.aw.ad.util;" top
$ javac InstallCert.java

$ java -cp ./ InstallCert undertheradar.co.kr
Enter certificate to add to trusted keystore or 'q' to quit: [1]
Added certificate to keystore 'jssecacerts' using alias 'undertheradar.co.kr-1
$ keytool -exportcert -keystore jssecacerts -storepass changeit -file output.cert -alias undertheradar.co.kr-1

$ sudo keytool -importcert -keystore /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -storepass changeit -file output.cert -alias undertheradar.co.kr-1