2022의 게시물 표시

아파치 슈퍼셋 관련 filter 설정

https://tedparkdev.tistory.com/6

HTML escape online tool.

- https://www.freeformatter.com/html-escape.html 블로그 글 쓸때 markdown 안에서 html을 쓰면 레이아웃이 망가지는 상황이 발생. 이를 해결 하기 위해 code block안에 항목을 넣을 때 html escape를 해서 진행

Elixir Cast!

[https://elixircasts.io/](https://elixircasts.io/)

엘릭서 Phoenix migration (1.5 -> 1.6 and scss for esbuild)

1. 우선 scss를 사용하는 상황이었기 때문에 app.scss를 복사해서 app.css로 바꾸고 내용을 삭제. (맨 마지막에 migration을 할 예정임,) 2. `package-lock.json` 파일을 지움. 3. package.json 파일에 내용을 변경 (음.. 일단은 삭제만 했네..) ``` ... "nprogress": "^0.2.0" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "babel-loader": "^8.0.0", "copy-webpack-plugin": "^5.1.1", "css-loader": "^3.4.2", "sass-loader": "^8.0.2", "node-sass": "^4.13.1", "hard-source-webpack-plugin": "^0.13.1", - "mini-css-extract-plugin": "^0.9.0", - "optimize-css-assets-webpack-plugin": "^5.0.1", - "terser-webpack-plugin": "^2.3.2", - "webpack": "4.41.5", - "webpack-cli": "^3.3.2" "mini-css-extr...

NPM에서 packege version spec 관련 내용

- `~version` “Approximately equivalent to version”, will update you to all future patch versions, without incrementing the minor version. `~1.2.3` will use releases from `1.2.3 to

Phoenix에서 사용하고 있는 plot chart

- https://elixirschool.com/blog/server-side-svg-charts-with-contex-and-liveview - https://hexdocs.pm/contex/Contex.html#content - https://github.com/mindok/contex-samples

gcc 깔기.

https://linuxconfig.org/how-to-install-gcc-the-c-compiler-on-ubuntu-22-04-lts-jammy-jellyfish-linux ``` $ sudo apt update $ sudo apt install build-essential ```

elixir 연습을 위해서 livebook을 깔았다.

https://livebook.dev/#install - wsl에 엘릭서 설치 - instruction을 따라 설치! - Path에 경로 추가 하기 ``` Are you sure you want to install "livebook"? [Yn] y * creating /root/.mix/escripts/livebook warning: you must append "/root/.mix/escripts" to your PATH if you want to invoke escripts by name root@LAPTOP-8QLSMA72:~/projects/daily_workouts/coding-test# vim ~/.bash .bash_history .bashrc root@LAPTOP-8QLSMA72:~/projects/daily_workouts/coding-test# vim ~/.bashrc ``` 음? 환경 변수를 설정 해 줬는데도 실행이 안되네? 와이? 아래와 같이. 실행해서 livebook을 실행함. `/root/.mix/escripts/livebook server` 불편한점은? - shift + enter로 실행이 안된다. - 다른 바로가기 키 기능들이 없다..

code 연습을 해볼 수 있는 사이트들

- https://www.codewars.com/ - https://www.acmicpc.net/ - https://leetcode.com/

elixir에서 튜플 접근

elixir tuple indexing ``` a = {1,2,3, 6} a[1] # 이러면 에러남. elem(a, 0) # 이함수로 접근 해야 함. ``` [1] [https://inquisitivedeveloper.com/lwm-elixir-13/#:~:text=Elixir%20tuples%20are%20stored%20contiguously,pair%20of%20curly%20braces%20%7B%7D%20.&text=The%20elem%2F2%20function%20is,data%20item%20in%20a%20tuple.&text=The%20length%20of%20a%20tuple,with%20the%20tuple_size%2F1%20function.](https://inquisitivedeveloper.com/lwm-elixir-13/#:~:text=Elixir%20tuples%20are%20stored%20contiguously,pair%20of%20curly%20braces%20%7B%7D%20.&text=The%20elem%2F2%20function%20is,data%20item%20in%20a%20tuple.&text=The%20length%20of%20a%20tuple,with%20the%20tuple_size%2F1%20function.)

ecto cheat sheet (작성중)

```elixir alias BikeRide.Repo # 이렇게 쓰는 것은 아래의 축약형이다. alias BikeRide.Repo as: Repo alias BikeRide.Accounts.User # id로 user를 select 한다 User |> Repo.get(1) # 음 아래로 할때 get_by에서 찾을 수 있는게 1개가 아니면 에러가 난다. User |> Repo.get_by(name: "someone") # User |> Repo.first |> Repo.one User |> Repo.all User |> where(name: "someone") |> Repo.all User |> (where [u], u.updated_at Repo.all User |> (where [u], ilike(u.name, "%name") |> Repo.all User |> Repo.aggregate(:count, :id) ``` ```elixir Import Ecto.query User |> group_by(:name) |> select([u], [u.name, count(u.id)] |> Repo.all User |> group_by(:name) |> select([u], [u.name, count(u.id)] |> Repo.all User |> distinct ([u], u.name) |> Repo.all Limit = 4 User |> limit(^Limit) |> Repo.all # 아래는 changeset의 validation을 거치지 않는다, %User{name: "stephan"} |> Repo.insert # changeset을 통해 validation user changeset을 정의 하기는 해야함, import Ecto.cha...

윈도우 디스크 관리세어 삭제 불가능 파티션 삭제 (필요해서 찾아봄)

음... 간혹 남는 SSD를 이용해서 포터블 스토리지로 쓸려고 하거나, 기존 OS를 깔았던 곳에 새로 밀고 파티션을 조정한 다음 다시 OS를 설치하려고 할때 `윈도우 디스크 관리`에서 삭제가 안되는 파티션들이 있음. 이경우는 - 관리자 권한으로 명령 창을 실행 시키고 - diskpart - list disk - select disk 1 - list partition - select partition 1 - delete partition overide 이런 식으로 삭제를 원하는 디스크의 파티션들을 찾아서 삭제해 주면 된다. 참조 [1] https://siait.tistory.com/378

Prometheous 모니터링 용 Metric export example with python

이미지
특정 서버의 redis에 있는 값으로 계산되는 항목을 지속적으로 모니터링 해야 하는 상황이 있어서, 어떻게 할까 하다가, 이전에 구축해놓은 프로메테우스-그래파나 서버에서 metiric을 땡겨가는 것이 더 좋을 것 같아서 검색해 보았다. 파이썬 프로메테우스 클라이언트가 존재 하더라! [https://github.com/prometheus/client_python](https://github.com/prometheus/client_python) ```jsx pip install prometheus_client ``` ```jsx from prometheus_client import start_http_server, Summary import random import time import redis from prometheus_client import Gauge # Create a metric to track time spent and requests made. REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request') # Decorate function with metric. client_count = Gauge('client_count', 'number of client that connected to server') client_bandwidth = Gauge('client_bandwidth', 'assigned bandwidth of server with current clients') @REQUEST_TIME.time() def process_request(): """A dummy function that takes some time.""" client_count.set(4.2) # TODO...

Reset.

일단 이전 글들이 너무 오래된 주제이다보니, 일단 숨김 처리 함. 이전 주제들에 묶여서 블로그에 새 글을 쓰기도 꺼려지는 것도 한원인이었음. 여기에 새 글을 안써온 이유중에 하나는 mark down 같은게 쓰기 어려운 것도 한 원인 이었음. blogger 에서 markdown을 쓸수 있게 해주는 방법을 발견함 [https://github.com/cs905s/md-in-blogger](https://github.com/cs905s/md-in-blogger) 뭔가 조금씩 쓰다보면 나에게 도움이 되지 않을까?