'2022/02'에 해당되는 글 58건

  1. 2022.02.14 plc ladder diagram
  2. 2022.02.14 우분투 크롬, 구글 로그인이 안됨
  3. 2022.02.14 lvm as ssd cache
  4. 2022.02.13 배터리 방전 시킬 뻔
  5. 2022.02.12 컴퓨터 메인보드가 보니.
  6. 2022.02.11 linux cache clear
  7. 2022.02.11 go lang rest
  8. 2022.02.11 파일 존재유무 확인하기
  9. 2022.02.10 jetson nano deepstream
  10. 2022.02.10 rpi i2c oled
하드웨어/PLC (LSE)2022. 2. 14. 19:02

기호가 눈에 익으려면 한참 걸리겠네..

결선에 의해서 and / or를 하는 컨셉.

 

[링크 : https://codingcoding.tistory.com/172]

[링크 : https://sw-eng.tistory.com/entry/래더-다이어그램]

 

'하드웨어 > PLC (LSE)' 카테고리의 다른 글

lse xgk-cpue rs232/modbus 연결  (0) 2022.03.21
plc timer 주기적인 on off  (0) 2022.03.18
lse modbus rs232  (0) 2022.03.18
LSE PLC Write  (0) 2022.03.17
LSE PLC XG5000 / 주소  (0) 2022.03.17
Posted by 구차니
Linux/Ubuntu2022. 2. 14. 16:18

이번에 시스템 날아가는 바람에 새로 설치했는데

크롬에서 이상하게 google 로그인하는게 보이지 않는다.

 

검색해보니 간단하게 요약하면

정책에 의해 차단, chromium이 아니라 google chrome만 허용한다.

[링크 : https://askubuntu.com/questions/1322559/]

 

20.04 에서는 google-chrome 이라는 걸 입력하면 실행(혹은 설치?) 되는 것 같은데

난 18.04라서 firefox로 구글 접속후 크롬 내려받기로 deb(64bit)를 하면 될 듯.

[링크 : https://linuxways.net/ubuntu/how-to-install-google-chrome-on-ubuntu-20-04-lts/]

 

deb 받아서 설치하니

사용자 이름에 로그인하지 않음 까진 똑같으나, 그 아래에 동기화 사용이 추가되었다.

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu unity tweak  (0) 2022.04.04
This kernel does not support RARP.  (0) 2022.03.08
크로스 컴파일 패키지  (2) 2022.01.28
ubuntu x86에서 arm용 아키텍쳐 패키지 추가하기(주의)  (0) 2022.01.28
debian 소스 받아 빌드하기  (0) 2021.12.02
Posted by 구차니
프로그램 사용/LVM2022. 2. 14. 14:15

SSD + HDD로 구성해서 write back cache를 SSD에 적용가능하다고 들었는데

mdadm에서 하는게 아니라 lvm 에서 설정이 가능하다고 해서 검색

 

lvm 관련 명령어를 이용해 nvme/ssd 등을 생성하고

volume group에 묶고 해당 vg를 cachepool 로 등록하는 걸로 되는 것 같긴하다.

# pvcreate /dev/sda
# pvcreate /dev/nvme0n1
# pvcreate /dev/nvme1n1
# vgcreate vg_data1 /dev/sda /dev/nvme0n1 /dev/nvme1n1
# lvcreate -l 19071823 -n lv_data1 vg_data1 /dev/sda
# lvcreate -i2 -L 16G -n lv_cache_meta1 vg_data1 /dev/nvme0n1 /dev/nvme1n1
# lvcreate -i2 -I2048 -l 100%FREE -n lv_cache1 vg_data1 /dev/nvme0n1 /dev/nvme1n1
# lvconvert --type cache-pool /dev/vg_data1/lv_cache1 --poolmetadata /dev/vg_data1/lv_cache_meta1 --chunksize 2048
# lvconvert --type cache /dev/vg_data1/lv_data1 --cachepool /dev/vg_data1/lv_cache1
# dmsetup status

[링크 : https://umount.net/ssd-caching-dm-cache-setting/]

[링크 : https://jabriffa.wordpress.com/2019/08/23/using-a-ssd-to-cache-data-volume-on-ubuntu-18-04-lts/]

[링크 : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/lvm_cache_volume_creation]

 

'프로그램 사용 > LVM' 카테고리의 다른 글

LVM 관리  (0) 2019.03.05
애증의.. LVM? centos 기본값 설치에서 변형했더니...  (0) 2019.03.05
lvm raid  (0) 2019.01.15
LVM - Logical Volumegroup Management  (0) 2009.01.22
Posted by 구차니

지하가 아니라 지상에 차를 대놔서

블랙박스 켜놨는데

일이주 운행안하고 주말에 왕복 30키로? 1시간 정도 운행한걸로는 부족했는지

시동이 한번에 안걸렸다 ㅠㅠ

 

내일 회사 차끌고 다녀와야하나..

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

태극기 구매  (0) 2022.02.27
17만 확진자  (4) 2022.02.23
휴가 9일차  (4) 2022.02.06
휴가 8일차  (0) 2022.02.05
휴가 7일차  (0) 2022.02.04
Posted by 구차니
개소리 왈왈/컴퓨터2022. 2. 12. 23:28

SATA 6개나 있네?!

[링크 : https://www.asus.com/kr/Motherboards-Components/Motherboards/PRIME/PRIME-B250M-K/]

 

이전 2세대 녀석들은 죄다 4개 뿐이었는데

그래도.. 8베이 짜리 하나 탐나긴 한데.. 애매하네 ㅠㅠ

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

플로피  (0) 2022.02.25
슈퍼마이크로 2U 8bay 서버 구매  (0) 2022.02.15
gtx660 gtx750 gtx1030 hd7950  (0) 2022.02.07
뜬금없이 맥미니(혹은 맥북에어) 사고 싶다!!  (0) 2022.01.18
sd 메모리 지름  (0) 2022.01.10
Posted by 구차니
Linux2022. 2. 11. 22:06

리눅스에서 이상하게 free 명령어에서 free 인 부분이 적게 나오는데

이럴때는 drop_caches를 강제로 하면 메모리가 돌아온다.

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        1.2G        5.8G        232M        757M        6.1G
스왑:        2.0G          0B        2.0G

# echo 3 > /proc/sys/vm/drop_caches

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        1.2G        5.9G        235M        667M        6.1G
스왑:        2.0G          0B        2.0G

 

리눅스 캐시의 종류를 좀 더 봐야 할 듯.

파일 시스템을 알아서 캐싱하는 느낌이었는데 2번 항목이 그런거였나?

1. Clear PageCache only.
# sync; echo 1 > /proc/sys/vm/drop_caches

2. Clear dentries and inodes.
# sync; echo 2 > /proc/sys/vm/drop_caches

3. Clear pagecache, dentries, and inodes.
# sync; echo 3 > /proc/sys/vm/drop_caches 

[링크 : https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/amp/]

[링크 : https://support.huaweicloud.com/intl/en-us/trouble-ecs/ecs_trouble_0336.html]

 

 

 

'Linux' 카테고리의 다른 글

dmesg log_buf_len  (0) 2022.06.29
bash set -e set -x  (0) 2022.06.22
sort 컬럼 별 정렬하기  (0) 2022.02.08
elementary os  (0) 2022.01.28
linux 터미널 pause, resume  (0) 2022.01.11
Posted by 구차니
Programming/golang2022. 2. 11. 19:38

node.js 처럼 go mod init 명령을 통해 모듈을 설치할 수 있는 것 같다.

 

go 1.10은 지원도 끊어졌고 해당 명령어 지원하지 않으니

g0 1.11은 가야 할 것 같다.

[링크 : https://stackoverflow.com/questions/60410729/unknown-subcommand-mod-error-while-running-go-mod-init]

 

아래껀 천천히 테스트 해봐야겠네..

(우분투 20.04로 가야하나...)

go mod init noah.io/ark/rest
$ vi main.go
package main

import (
"encoding/json"
"net/http"
)

var users = map[string]*User{}

type User struct {
Nickname string `json:"nickname"`
Email    string `json:"email"`
}

func main() {
http.HandleFunc("/users", func(wr http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet: // 조회
json.NewEncoder(wr).Encode(users) // 인코딩
case http.MethodPost: // 등록
var user User
json.NewDecoder(r.Body).Decode(&user) // 디코딩

users[user.Email] = &user

json.NewEncoder(wr).Encode(user) // 인코딩
}
})
http.ListenAndServe(":8080", nil)
}

[링크 : https://woony-sik.tistory.com/m/12]

 

$ go get github.com/julienschmidt/httprouter
$ vi rest.go
package main

import (
    "fmt"
    "github.com/julienschmidt/httprouter"
    "net/http"
    "log"
)

func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
    fmt.Fprint(w, "Welcome!\n")
}

func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
    fmt.Fprintf(w, "hello, %s!\n", ps.ByName("name"))
}

func main() {
    router := httprouter.New()
    router.GET("/", Index)
    router.GET("/hello/:name", Hello)

    log.Fatal(http.ListenAndServe(":8080", router))
}

[링크 : https://okky.kr/article/386116]

 

+

backport를 깔아주면 된다고는 한다.

$ sudo add-apt-repository ppa:longsleep/golang-backports
$ sudo apt-get install software-properties-common
$ sudo apt-get update 
$ sudo apt-get install golang-1.11

[링크 : https://www.gophp.io/install-go-1-11-on-ubuntu-18-04/]

 

추가해보니 1.18까지도 나왔나 보다.

$ sudo add-apt-repository ppa:longsleep/golang-backports
Golang 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17 and 1.18 PPA for Ubuntu
 더 많은 정보: https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports
[ENTER]을 눌러 진행하거나 Ctrl-c를 눌러 추가하는것을 취소합니다.

 

그래도 1.17을 기준으로 설치 되는 듯.

$ sudo apt-get install golang
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  golang-1.10-go golang-1.10-race-detector-runtime golang-1.10-src
  golang-1.11-doc golang-1.11-go golang-1.11-race-detector-runtime
  golang-1.11-src golang-race-detector-runtime
Use 'sudo apt autoremove' to remove them.
다음의 추가 패키지가 설치될 것입니다 :
  golang-1.17 golang-1.17-doc golang-1.17-go golang-1.17-src golang-doc
  golang-go golang-src
제안하는 패키지:
  bzr | brz mercurial subversion
다음 새 패키지를 설치할 것입니다:
  golang golang-1.17 golang-1.17-doc golang-1.17-go golang-1.17-src golang-doc
다음 패키지를 업그레이드할 것입니다:
  golang-go golang-src
2개 업그레이드, 6개 새로 설치, 0개 제거 및 1개 업그레이드 안 함.
72.0 M바이트 아카이브를 받아야 합니다.
이 작업 후 424 M바이트의 디스크 공간을 더 사용하게 됩니다.

'Programming > golang' 카테고리의 다른 글

golang gore(repl), delve  (0) 2022.03.31
go build 옵션  (0) 2022.03.31
go lang static http server  (0) 2022.03.10
go hello world build static / shared  (0) 2022.02.17
golang  (0) 2020.05.18
Posted by 구차니
Linux API/linux2022. 2. 11. 11:06

tmpfs에 touch로 파일을 생성/삭제하면서 테스트 해보니

마우스 이벤트에 묶여있어도 cpu 점유율 이 크게 오르지 않는걸 봐서는 부하가 크지 않은 듯.

 

if( access( fname, F_OK ) == 0 ) {
    // file exists
} else {
    // file doesn't exist
}

[링크 : https://stackoverflow.com/questions/230062/whats-the-best-way-to-check-if-a-file-exists-in-c]

 

#include <unistd.h>
int access(const char *pathname, int mode);

The mode specifies the accessibility check(s) to be performed, and is either the value F_OK, or a mask consisting of the bitwise OR of one or more of R_OK, W_OK, and X_OK. F_OK tests for the existence of the file. R_OK, W_OK, and X_OK test whether the file exists and grants read, write, and execute permissions, respectively.

[링크 : https://linux.die.net/man/2/access]

 

F_OK 파일 존재여부
R_OK 파일 read 퍼미션 여부
W_OK 파일 write 퍼미션 여부
X_OK 파일 execute 퍼미션 여부

'Linux API > linux' 카테고리의 다른 글

posix message queue  (0) 2022.09.21
zeroMQ  (0) 2022.09.20
select, poll, epoll  (0) 2021.11.02
Unhandled fault: external abort on non-linefetch  (0) 2021.05.25
Stopped (tty input)  (0) 2021.05.21
Posted by 구차니
embeded/jetson2022. 2. 10. 11:27

jetson nano developer (4GB 모델)로 해서 그런지

xavier nx에서 할때랑 비교하면 초기 구동 시간이 어마어마하게 오래 걸린다.

 

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html] 빠른 실행

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/] 목차

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_ref_app_deepstream.html]

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Zero_Coding_Sample_Graphs.html#deepstream-app]

'embeded > jetson' 카테고리의 다른 글

azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
nvidia jetson nano 2gb / csi  (0) 2022.01.21
jetson nano gpu 사용 상태 확인  (0) 2022.01.20
Posted by 구차니
embeded/raspberry pi2022. 2. 10. 10:45

동일한 녀석인듯? 일단 시도 해봐야 겠다.

 

[링크 : https://rudalskim.tistory.com/109]

 

+

일단 사용한 라이브러리는 deprecated 이고

[링크 : https://github.com/adafruit/Adafruit_Python_SSD1306]

 

이미지를 출력하도록 해놔서 python의 image 라이브러리를 이용하여 text도 그려서 출력하는 듯.

[링크 : https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/animate.py]

 

+

하라는 대로 해서 하니 나오긴 한데, 해당 라이브러리에서 이미지 말고 텍스트를 출력 할 수 있는진 좀 봐야 할 듯.

import time 
import Adafruit_GPIO.SPI as SPI 
import Adafruit_SSD1306 
from PIL import Image

RST = 25
DC = 24
SPI_PORT = 0
SPI_DEVICE = 0

disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)
disp.begin()
disp.clear()
disp.display()

image = Image.open('test.png').resize((disp.width, disp.height), Image.ANTIALIAS).convert('1')
disp.image(image)
disp.display()

 

테스트 용으로 대충 128x64 사이즈로 만든 png 파일

 

아래와 같이 잘 나온다.

 

다만 OLED 라고 해도 리프레시는 존재하는지(당연한건가...?)

셔터속도에 따라 비어보이는 경우가 존재한다.

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이2 / 마인크래프트  (0) 2022.03.18
rpi opencv python pid servo  (0) 2022.03.08
라즈베리 파이 부품 도착  (0) 2022.02.09
rpi csi to dsi...  (0) 2022.01.21
rpi 7" dsi  (0) 2022.01.21
Posted by 구차니