2017년 5월 18일 목요일

리눅스 홈서버 팬속도 조절하기 home server fancontrol

집에 홈서버를 하나 돌리고 있어요. 저전력으로
작고 얇은...
그런데... 팬소리가 좀 거슬려요.
이번에는 팬속도를 조절해야겠다 마음먹었어요.

검색한 끝에

https://possiblelossofprecision.net/?p=450

여기 포스팅을 보고 그대로 따라했습니다.

전 이미 sensors 설치를 해놓은 터라

일부만 따라했어요.

순서는
1. 센서라이브러리(lm_sensors)를 설치합니다.
2. pwmconfig 실행합니다.
3. fancontrol을 실행합니다.
4. 시스템시작시에 자동으로 실행되게 합니다.

2번에서 헤매게 되는데요.
설명은 본문아래에서 다시 하겠습니다.

1. Detecting sensors

Before you can read out any temperature values and change the fanspeed accordingly, you have to your operating system which sensors you are actually using.
Fortunately, there is a small program that does the job for you. sensors-detect comes with lm_sensors, so we make sure, the latest version of lm_sensors is installed
yum install lm_sensors
before we start sensors-detect
Pretty cool, huh? Make sure, the lm_sensors daemon gets started automatically
chkconfig lm_sensors on

2. Configuring sensors and fans

The fancontrol script can automatically respond to temperature changes of your system by changing fanspeeds. Basically, we have to map one temp-sensor to one fan controller. fancontrol‘s config-file can be easily manipulated with pwmconfig. The program is quite self-explaining; It can even create detailed correlation with gnuplot automatically.
If you later want to change some values manually, you can also edit /etc/fancontrol without pwmconfigusing your favourite editor. See also fancontrol manpage.

3. Automatically starting fancontrol

Unfortunately there comes no init script with fancontrol in Fedora or CentOS. So we have to ensure, fancontrol gets started automatically during boot. The easiest way is to put fancontrol into rc.local
# echo 'fancontrol &' >> /etc/rc.local
Sending the process to background with a subsequent ampersand is crucial. Otherwise the boot process may hang.
You can of course write your own fancontrol init script if you want to do the full Sys V style init stuff.

Restart the computer and enjoy silence!

아래는 pwmconfig를 실행했을 때 볼 수 있습니다.
[root@localhost ~]# pwmconfig
# pwmconfig revision $Revision$ ($Date$)
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0 is acpitz
   hwmon1 is coretemp
   hwmon2/device is it8772

Found the following PWM controls:
   hwmon2/device/pwm1           current value: 0
   hwmon2/device/pwm2           current value: 150
   hwmon2/device/pwm3           current value: 76

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon2/device/fan1_input     current speed: 0 ... skipping!
   hwmon2/device/fan2_input     current speed: 6683 RPM
   hwmon2/device/fan3_input     current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue:(첫번째 팬이 멈추고 온도가 올라갈 수 있다 원하지 않으면 컨트롤 씨, 엔터는 시작!)

Testing pwm control hwmon2/device/pwm1 ...
  hwmon2/device/fan2_input ... speed was 6683 now 6683
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon2/device/pwm1,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? n(팬이 멈추는 것을 들었나요?)

Testing pwm control hwmon2/device/pwm2 ...
  hwmon2/device/fan2_input ... speed was 6683 now 0
    It appears that fan hwmon2/device/fan2_input
    is controlled by pwm hwmon2/device/pwm2
Would you like to generate a detailed correlation (y)?(상세설정을 원하는가?)
    PWM 255 FAN 6683
    PWM 240 FAN 6683
    PWM 225 FAN 6553
    PWM 210 FAN 6308
    PWM 195 FAN 6026
    PWM 180 FAN 5672
    PWM 165 FAN 5314
    PWM 150 FAN 4963
    PWM 135 FAN 4560
    PWM 120 FAN 4141
    PWM 105 FAN 3688
    PWM 90 FAN 3214
    PWM 75 FAN 2657
    PWM 60 FAN 2076
    PWM 45 FAN 0
    Fan Stopped at PWM = 45


Testing pwm control hwmon2/device/pwm3 ...
  hwmon2/device/fan2_input ... speed was 6683 now 6683
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon2/device/pwm3,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)?(팬이 멈추는 것을 들었나요?)

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)?(파일에 반영할까요?)
What should be the path to your fancontrol config file (/etc/fancontrol)?(경로는 디폴트로)
Loading configuration from /etc/fancontrol ...

Select fan output to configure, or other action:
1) hwmon2/device/pwm2  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 1(1번을 설정함)

Devices:
hwmon0 is acpitz
hwmon1 is coretemp
hwmon2/device is it8772

Current temperature readings are as follows:
hwmon0/temp1_input      26
hwmon1/temp2_input      37
hwmon1/temp3_input      37
hwmon1/temp4_input      39
hwmon1/temp5_input      39
hwmon2/device/temp1_input       32
hwmon2/device/temp2_input       33
hwmon2/device/temp3_input       -70

Select a temperature sensor as source for hwmon2/device/pwm2:
1) hwmon0/temp1_input
2) hwmon1/temp2_input
3) hwmon1/temp3_input
4) hwmon1/temp4_input
5) hwmon1/temp5_input
6) hwmon2/device/temp1_input
7) hwmon2/device/temp2_input
8) hwmon2/device/temp3_input
9) None (Do not affect this PWM output)
select (1-n): 6(어떤센서를 사용하나요?)

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 30(몇도일때 최저속도로 할까요?)

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 70(몇도일때 최고속도로 할까요?)

Enter the minimum PWM value (0-255)
at which the fan STOPS spinning (press t to test) (100): 45 (언제 팬이 멈추었나?)

Enter the minimum PWM value (45-255)
at which the fan STARTS spinning (press t to test) (150): 60 (언제 팬이 돌기시작했나?)

Enter the PWM value (0-45) to use when the temperature
is below the low temperature limit (0): 45 (저온일 때 사용할 PWM값은?) 

Enter the PWM value (45-255) to use when the temperature
is over the high temperature limit (255): 180(고온일때 사용할 PWM값은?)


Select fan output to configure, or other action:
1) hwmon2/device/pwm2  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 4(저장하고 종료)

Saving configuration to /etc/fancontrol...
Configuration saved
[root@localhost ~]# fancontrol (실행)
Loading configuration from /etc/fancontrol ...

2017년 4월 26일 수요일

spring boot mybatis 스프링 부트 마이바티스 설정시 java.sql.SQLException: No suitable driver found for mysql://localhost:3389/test 발생 이유

한 몇시간은 이것 때문에 설정을 얼마나 확인을 많이 했던가..

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for mysql://localhost:3306/test
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82)
at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68)
at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:315)
at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java:78)
at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:58)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:134)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)
... 38 common frames omitted
Caused by: java.sql.SQLException: No suitable driver found for mysql://localhost:3306/test
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:120)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
... 47 common frames omitted


이와 같은 에러일 경우에

url을 확인하길 바랍니다.

mysql://localhost:3306/test

아마 url에 jdbc가 빠져있는 현상을 볼 수 있을 것이다.

jdbc:mysql://localhost:3306/test

jdbc:가 포함되어야한다.

2017년 3월 29일 수요일

갤럭시 S8, G6 스펙 비교 - 크기와 무게 중심으로

쓰던 스마트폰이 노후되어서 이제 교체를 해야겠다고 마음먹고 있는데
최근 엘지와 삼성의 플래그쉽 모델이 잇달아 신규 출시되었다.
갤럭시 S8은 오늘 0시에 발표되고나서 포털 실시간검색어에 노출되어
스마트폰에 대한 현대인들의 관심의 정도를 보여주고 있다.

최근에 부자병이라고 하는 어플루엔자(어플루엔자(Affluenza)는 풍요를 뜻하는 낱말 affluece와 유행성 독감을 뜻하는 낱말 influenza의 합성어이다)를 통해서 느끼는 바가 어느정도 있지만...

시대에 뒤떨어질 수는 없기에 어떤 스마트폰을 선택할 것인가를 고민하고 있었다.

그래서 삼성과 엘지의 플래그쉽 모델의 스펙을 비교하여 의사결정에 도움을 받고자 했다.
휴대성이 중요하다는 판단하에 무게와 크기를 중심으로 정보를 검색하는데
직접적으로 비교해 놓은 글을 찾기가 어려워 손수 작성하여 참고하려고 한다.

최근 베젤리스라던가 풀비젼이라던가 하는 것과 동시에 무게와 크기가 휴대성에 영향을 주지 않도록 디자인하는 것이 트랜드가 되어가는 것 같다.

일단은 먼저 출시된 G6의 스펙을 공식 페이지에서 가져왔다.

Specifications

  • Display: 5.7" QHD Plus FullVision (2880 x 1440) with 564 ppi and 18:9 Aspect Ratio
  • Battery Capacity: 3,300 mAh Non-Removable
  • Platform: Android 7.0 (Nougat)
  • Processor: Qualcomm Snapdragon™ 821 2.35 GHz + 1.6 GHz Quad-Core Custom 64-bit Qualcomm Kryo™
  • Technology: LTE, CDMA, GSM, UMTS
  • Network: CDMA, GSM, LTE, LTE CA

  • microSD cards sold separately.
  • Size & Weight: 5.86" (H) x 2.83" (W) x 0.31" (D); Weight: 5.74 oz.
  • Internal Memory: 32 GB
  • Supports microSD card up to 2 TB1
  • RAM: 4 GB
  • Available Colors: Platinum, Black

갤럭시 S8의 스펙을 공식 홈에서 가져왔다.


  • OS
    Android N OS 7.0

  • Size
    Product Dimensions (inches)
    2.68" x 5.86" x 0.32"

  • Camera
    Camera resolution (Front)
    8MP
    Camera resolution (Rear)
    12MP
    Features

    High Photo Quality Camera

  • Battery
    Battery, Standby

    Up to 3.38 days


    Battery, Talk Time

    Up to 29hrs
    Battery Type and Size
    3000mAh

  • Memory
    Internal Memory
    Flash: 64 GB, RAM: 4GB
    External Memory/microSD™ Capacity
    Removable microSD up to 256 GB

  • Connectivity
    Wi-Fi
    802.11 a/b/g/n/ac
    Bluetooth
    Bluetooth v5.0

  • Processor
    Processor Speed, Type
    Powerful MSM 8998 Octa Core 2.35Ghz (Quad Core) + 1.9GHz (Quad)

  • Display
    Main Display Size
    5.8"
    Main Display Technology
    Super AMOLED

    thegear에서 가져온 스펙

    갤럭시 S8(SM-G950) 스펙

    • 5.8인치 QHD+(2960 x 1440, 570ppi) 인피니티 디스플레이
    • 퀄컴 스냅드래곤 835·엑시노스 8895 옥타코어 프로세서
    • 4GB 메모리
    • 64GB·128GB 저장 공간(마이크로SD 최대 256GB 확장)
    • 전면 800만·후면 1200만 화소 카메라
    • 802.11 a/b/g/n/ac(2X2 MIMO), 블루투스 5, NFC, 홍채인식, 지문인식, GPS, GLONASS, Beidou, Galileo
    • 148.9 x 68.1 x 8.0mm, 152g
    • 3000mAh 배터리(USB 타입C), 고속 충전, 무선 충전
    • 안드로이드 7.0 누가

    갤럭시 S8 플러스(SM-G955) 스펙

    • 6.2인치 QHD+(2960 x 1440, 529ppi) 인피니티 디스플레이
    • 퀄컴 스냅드래곤 835·엑시노스 8895 옥타코어 프로세서
    • 4GB 메모리
    • 64GB·128GB 저장 공간(마이크로SD 최대 256GB 확장)
    • 전면 800만·후면 1200만 화소 카메라
    • 802.11 a/b/g/n/ac(2X2 MIMO), 블루투스 5, NFC, 홍채인식, 지문인식, GPS, GLONASS, Galileo
    • 159.4 x 73.4 x 8.1mm, 173g
    • 3500mAh 배터리(USB 타입C), 고속 충전, 무선 충전
    • 안드로이드 7.0 누가



    나무위키의 갤럭시 S8 스펙은 아래와 같다.

    프로세서삼성 엑시노스 9 Series (8895) SoC. ARM big.LITTLE↓, ARM Mali-G71 MP20 550 MHz GPU
    Samsung Exynos M2 MP4 2.3 GHz CPU + ARM Cortex-A53 MP4 1.7 GHz CPU
    퀄컴 스냅드래곤 835 MSM8998 SoC. Qualcomm Kryo 280 MP4 2.35 GHz + 1.9 GHz CPU, 퀄컴 Adreno 540 670 MHz GPU
    퀄컴 Hexagon 680 DSP
    메모리4 GB LPDDR4 SDRAM, 64 GB UFS 2.1 규격 내장 메모리micro SDXC (256 GB 공식 지원)
    디스
    플레이
    5.8인치 2960 x 1440 (배열 RG-BG 펜타일) 서브픽셀 방식의 삼성D Super AMOLED Dual-Edge
    멀티터치 지원 정전식 터치 스크린, 고릴라 글래스 5
    네트워크LTE Cat.16·13, HSPA+ 42Mbps, HSDPA & HSUPA & UMTS, GSM & EDGE
    근접통신Wi-Fi 802.11a/b/g/n/ac, 블루투스 5.0 / aptX Codec, NFC, ANT+, MST
    카메라전면 800만 화소 F1.7, 후면 OIS 기술 탑재 Dual Pixel 1200만 화소 F1.7 AF 트래킹 지원 위상차 검출 AFLED 플래시
    배터리내장형 Li-lon 3000 mAh
    운영체제안드로이드 7.0 (Nougat)
    삼성 터치위즈 Dream UX
    규격68.1 x 148.9 x 8.0 mm, 152 g
    색상[1]미드나이트 블랙, 오키드 그레이, 아크틱 실버, 코랄 블루, 메이플 골드
    단자정보USB 3.1 Gen1 Type-C x 1, 3.5 mm 단자 x 1
    기타VoLTE 및 Wideband Audio 지원, IP68 등급 방수 방진 지원, 무선충전 Qi 규격 및 PMA 규격 지원
    홍채인식 및 에어리어 방식 지문인식 지원, 심장 박동 인식 센서 내장





    나무위키의 LG G6의 내용을 보면....

    프로세서퀄컴 스냅드래곤 821 MSM8996 Pro SoC. Qualcomm Kryo MP2 2.34 GHz + MP2 1.6 GHz CPU, 퀄컴 Adreno 530 653 MHz GPU
    퀄컴 Hexagon 680 DSP
    메모리4 GB LPDDR4 SDRAM, 32 / 64 GB UFS 2.0 규격 내장 메모리, micro SDXC (2 TB 공식 지원)
    디스플레이5.7인치 2880 x 1440 RGB 서브픽셀 방식의 LGD Full Vision Display (IPS TFT-LCD 방식 & 564 ppi)
    멀티터치 지원 정전식 AIT(Advanced In-cell Touch) 터치 스크린
    고릴라 글래스 3
    고릴라 글래스 5
    네트
    워크
    기본HSPA+ 42Mbps, HSDPA & HSUPA & UMTS, GSM & EDGE
    선택LTE Cat.12·13LTE Cat.11TD-LTECDMA & EV-DO Rev. A
    근접통신Wi-Fi 802.11a/b/g/n/ac, 블루투스 4.2+BLE, NFC, MST[1]
    카메라전면 500만 화소, 후면 OIS 기술 탑재 1,300만 화소 x 2 듀얼 렌즈 위상차 검출 AF 및 듀얼 LED 플래시
    배터리내장형 Li-lon 3300 mAh
    운영체제안드로이드 7.0 (Nougat)
    LG UX 6.0
    규격71.9 x 148.9 x 7.9 mm, 163 g
    색상[2]아스트로 블랙, 미스틱 화이트, 아이스 플래티넘
    단자정보USB 3.1 Gen1 Type-C x 1, 3.5 mm 단자 x 1
    기타기본VoLTE 및 Wideband Audio 지원, IP68 등급 방수 방진 지원 및 MIL-STD-810G 인증 취득
    에어리어 방식 지문인식 지원, Dolby Vision & HDR 10 규격 지원
    선택쿼드 Sabre DAC 탑재지상파 HD DMB 및 고화질 스마트 DMB 지원무선충전 Qi 규격 지원



    자료를 찾다보니 쉽게 결론을 낼 수 있을 것 같다.
    찾고 싶었던 자료는 아래와 같은 것이다.

    갤럭시의 크기, 무게(해상도)

    68.1 x 148.9 x 8.0 mm, 152 g (2960 x 1440)

    LG G6의 크기, 무게(해상도)

    71.9 x 148.9 x 7.9 mm, 163 g (2880 x 1440)


    세로 크기는 동일하고 두께도 비슷하고..
    갤럭시 S8 가로크기 G6보다 -3.8mm 이다.
    무게도 -11g 이다.
    삼성전자가 진정 극한의 기술력을 선보이려하나...


    좋은 마케팅으로 극복가능한 차이라고 쓰고
    적당한 가격차로 승부를 걸자라고 말한다.


    갤럭시 S8 출시가 아직 20일 이상 남았으니
    엘지 마케팅본부, 이제는 배수의 진을 쳐봐야하지 않겠는가...




    .