2021년 10월 15일 금요일

LG NAS SSH권한 획득

집에쓰던 LG NAS를 ssh접속하기 위해 권한을 얻기위해 검색하던중 여러사이트들을 보게 됨

https://www.zen-tech.info/2012/08/acces-ssh-sur-les-nouveaux-firmwares-des-nas-lg-n1t1/

http://dandylife.net/blog/archives/63

https://www.clien.net/service/board/lecture/2609323

http://reshout.com/?p=4229

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=tomynymph&logNo=167602052

 

내 나스 모델이 N1T1인줄 알았으나..

어떻게 해도. 뭘 마줘도.. 파일이 맞지 않는다고 나왔으니.

 

알고보니 N1A1이었음 -_-; 헐...

 

그외에는 같은대로 맞춰하면 잘돌아감 개짜증

 

2020년 9월 1일 화요일

Graylog fielddata=true 설정하라는 오류 관련

그레이로그 버전업 후 생긴 문제점

(2.0.3 -> 3.3.3)

message에 따라서 Aggregation을 하는데.. (파이차트 등.)


상위버전에서 message, full_message 항목에 대해서 index를 잡지 않는 상태가 되어 통계를 쓸수 없게 되었다.

fielddata를 true로 하라는 개떡 같은 메시지가 있었으나.


엘라스틱서치에 대한 설정이었으며


curl -X GET '설정IP:9200/_template/graylog-internal?pretty'

명령어로 내부에 설정된 것을 확인했을때.


아래 message에 fielddata:false가 되어 있음을 확인



curl -X GET '설정IP:9200/graylog_deflector/_mapping?pretty'

현재 매핑된녀석들을 볼수 있으며

message가 어찌되어있는지 확인을 해보면 좋음;



custom인덱스를 이용하기로 마음을 먹었고

curl -X PUT "설정IP:9200/_template/graylog-custom-mapping?pretty" -H 'Content-Type: application/json' -d'

{

  "template": "graylog_*",

  "mappings" : {

    "message" : {

      "properties" : {

        "message" : {

          "type" : "text",

          "analyzer" : "standard",

          "fielddata": true,

          "fields": {

            "keyword": { 

              "type": "keyword"

            }

          }

          }

        }

      }

    }

  }

}'


추가하였음;


curl -X GET '설정IP:9200/graylog_deflector/_mapping?pretty'

를 해보았는데.. 여전히 fielddata에 대한 부분이 설정이 안되어 있는 것을 확인


추가해도 안먹히는 이유는 기존인덱스에는 당연히 적용이 안되어있어서 여전히 표현이 안되는 것이고.

GraylogWeb에서 Indices -> default index set -> Maintenance -> Rotate active write index

하게 되면 graylog_* -> 다음것으로 바뀌게 되며 graylog_deflector했을때.. 내가 설정한 커스텀 값이 적용되는 것을 볼수 있으나.


여전히 검색할때 안먹히는 이유는 기존에 생성된 graylog_0 같은 인덱스에는.. 적용이 안되었기 때문임

그냥 기존것 가볍게 삭제.. -_-; 하고나서 잘됨.


입력했던 커스텀을 삭제하고 싶으면

curl -X DELETE "설정IP:9200/_template/graylog-custom-mapping?pretty"

이런것을 때리면 됨;


참고했던것

https://docs.graylog.org/en/3.3/pages/configuration/elasticsearch.html

https://blog.voidmainvoid.net/314

2016년 11월 25일 금요일

Visual Studio (찾기가 중지되었습니다.)

비주얼 스튜디오에서 검색을 하다보면

검색을 제대로 다 하지 못하고 찾기가 중지되었다고 나올때가 있다.

이럴땐 Alt + Ctrl + Pause Break 를 누른후

다시 찾아보자.


정상 작동한다.

2014년 9월 9일 화요일

MYSQL - Grant

Mysql Grant에 대해서..

문법은

GRANT
    priv_type [(column_list)]
      [, priv_type [(column_list)]] ...
    ON [object_type] priv_level
    TO user_specification [, user_specification] ...
    [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
    [WITH with_option ...]

object_type:
    TABLE
  | FUNCTION
  | PROCEDURE

priv_level:
    *
  | *.*
  | db_name.*
  | db_name.tbl_name
  | tbl_name
  | db_name.routine_name

user_specification:
    user [IDENTIFIED BY [PASSWORD] 'password']

ssl_option:
    SSL
  | X509
  | CIPHER 'cipher'
  | ISSUER 'issuer'
  | SUBJECT 'subject'

with_option:
    GRANT OPTION
  | MAX_QUERIES_PER_HOUR count
  | MAX_UPDATES_PER_HOUR count
  | MAX_CONNECTIONS_PER_HOUR count
  | MAX_USER_CONNECTIONS count

mysql> GRANT ALL PRIVILEGES on *.* to 'id'@'hosts' identified by '패스워드;

*.* 은. DB명.Table명 쯤 된다 전체다주고 싶으니 *.*
'id' @ 'hosts' id계정에 hosts에서 접속한녀석에게 해당된다는 얘기
(id는 알아서 주면 될테고 hosts는 %로 줄때 어디서 접속하든이 될것임)

권한을 골라서 줄수가 있음
ALL 대신에 select, insert, delete, update 엄청 많으니 표를 참조
Table 13.1 Permissible Privileges for GRANT and REVOKE
PrivilegeMeaning and Grantable Levels
ALL [PRIVILEGES]Grant all privileges at specified access level except GRANT OPTION
ALTEREnable use of ALTER TABLE. Levels: Global, database, table.
ALTER ROUTINEEnable stored routines to be altered or dropped. Levels: Global, database, procedure.
CREATEEnable database and table creation. Levels: Global, database, table.
CREATE ROUTINEEnable stored routine creation. Levels: Global, database.
CREATE TEMPORARY TABLESEnable use of CREATE TEMPORARY TABLE. Levels: Global, database.
CREATE USEREnable use of CREATE USERDROP USERRENAME USER, and REVOKE ALL PRIVILEGES. Level: Global.
CREATE VIEWEnable views to be created or altered. Levels: Global, database, table.
DELETEEnable use of DELETE. Level: Global, database, table.
DROPEnable databases, tables, and views to be dropped. Levels: Global, database, table.
EVENTEnable use of events for the Event Scheduler. Levels: Global, database.
EXECUTEEnable the user to execute stored routines. Levels: Global, database, table.
FILEEnable the user to cause the server to read or write files. Level: Global.
GRANT OPTIONEnable privileges to be granted to or removed from other accounts. Levels: Global, database, table, procedure.
INDEXEnable indexes to be created or dropped. Levels: Global, database, table.
INSERTEnable use of INSERT. Levels: Global, database, table, column.
LOCK TABLESEnable use of LOCK TABLES on tables for which you have the SELECT privilege. Levels: Global, database.
PROCESSEnable the user to see all processes with SHOW PROCESSLIST. Level: Global.
REFERENCESNot implemented
RELOADEnable use of FLUSH operations. Level: Global.
REPLICATION CLIENTEnable the user to ask where master or slave servers are. Level: Global.
REPLICATION SLAVEEnable replication slaves to read binary log events from the master. Level: Global.
SELECTEnable use of SELECT. Levels: Global, database, table, column.
SHOW DATABASESEnable SHOW DATABASES to show all databases. Level: Global.
SHOW VIEWEnable use of SHOW CREATE VIEW. Levels: Global, database, table.
SHUTDOWNEnable use of mysqladmin shutdown. Level: Global.
SUPEREnable use of other administrative operations such as CHANGE MASTER TOKILLPURGE BINARY LOGSSET GLOBAL, and mysqladmin debug command. Level: Global.
TRIGGEREnable trigger operations. Levels: Global, database, table.
UPDATEEnable use of UPDATE. Levels: Global, database, table, column.
USAGESynonym for no privileges


// 아래 부분은 예시로 편하게 볼수 있게 정리되어있다고 판단하여 정리
//
mysql> GRANT ALL PRIVILEGES ON db_name.* TO 'monty'@'localhost'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

// 모든 호스트(%)에서 연결을 허용
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

// domain.com 도메인에 속한 모든 호스트로부터 연결 허용
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%.domain.com'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

// mysqladmin reload, mysqladmin refress, mysqladmin processlist
// 등의 명령을 실행하도록 admin 유저에게 권한 부여
mysql> GRANT RELOAD, PROCESS ON *.* TO 'admin'@'localhost';

mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';

// 현재 GRANT 된 상태 보기
mysql> SHOW GRANTS FOR 'root'@'localhost';

// 현재 연결된 사용자의 GRANT 상태 보기
mysql> SHOW GRANTS FOR CURRENT_USER;


2014년 6월 10일 화요일

MYSQL - SHOW Syntax


자주 쓰는 편인것;
13.7.5.5 SHOW COLUMNS Syntax
SHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]
    [LIKE 'pattern' | WHERE expr]

13.7.5.10 SHOW CREATE TABLE Syntax
SHOW CREATE TABLE tbl_name

13.7.5.38 SHOW VARIABLES Syntax
SHOW [GLOBAL | SESSION] VARIABLES
    [LIKE 'pattern' | WHERE expr]


http://dev.mysql.com/doc/refman/5.7/en/show.html

2014년 5월 27일 화요일

MYSQL - ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

원격지에서 mysql에 붙으려 했는데..

저 에러가 떨어졌음. -_-;

다른 여러 검색 가능한 케이스들이 있지만..


우분투 였고
/etc/hosts.allow 파일에

mysqld:ALL

넣고 퉁쳤음.


기타

grant all privileges on *.* to 'root'@'%' identified by 'root의 패스워드';
flush privileges;

위에 사항으로 처리하는 것도 있고.

my.cnf 에
bind-address           = 127.0.0.1

를 주석 치는걸로 처리하는 경우도 있음.

2014년 5월 20일 화요일

MYSQL - ERROR 1005 (errno: 150)

1. FOREIGN KEY는 PRIMARY KEY의 자료형과 동일 해야함
: PK가 Unsigned INT이고 FK가 INT이면 errno:150임

2. FOREIGN KEY와 PRIMARY KEY 둘다 INNODB 이어야만 함

3. 그렇지 않은데도 에러라면 FOREIGN KEY 사용 레퍼런스를 참조할것


FOREIGN KEY  사용에 대한 레퍼런스