2017년 8월 20일 일요일

마리아 DB 사용자 추가 및 설정


C:\Windows\system32>mysql -u root -p  -- root 계정으로 접속합니다.
Enter password: ****  -- root 게정 비밀번호를 입력합니다.
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.19-MariaDB mariadb.org binary distribution
 
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> create database demo;  -- demo 라는 명을 가지는 데이터베이스를 생성합니다.
Query OK, 1 row affected (0.00 sec)
 
MariaDB [(none)]> show databases;  -- 데이터베이스 목록을 확인합니다.
+--------------------+
| Database           |
+--------------------+
| demo               |  -- 생성완료
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)
 
MariaDB [(none)]>



-- demo 라는 명을 가지는 데이터베이스를 삭제합니다.
MariaDB [(none)]> drop database demo; 

로컬 호스트만 접속
create user 'tester'@'localhost' identified by '1111';

아무데서나 접속 가능
create user 'username'@'%' identified by 'password';


-- tester 계정에게 demo 데이터베이스의 모든 사용권한을 부여한다.
-- '%' 대신 localhost를 사용할 경우 외부에서 접속 불가
grant all privileges on demo.* to tester@'%';


사용자 비빌 번호 변경

use mysql;

update user set password=PASSWORD('변경할비밀번호') where user = '사용자계정';
flush privileges;




disk 추가 방법 debian storage add


fdisk -l

mkfs.ext4 /dev/sdb

blkid 

show this line
/dev/sda1: UUID="559004bc-d5c6-4cc8-b915-2613e6bb6900" TYPE="ext4" PARTUUID="1b8377b5-01"


add /etc/fstab

/
UUID=cf7c496f-5f91-4aab-98e0-76d3de32a66c /opt ext4 discard,defaults,nofail 0 2



google cloud vm instance linux emerge mode recovery




 구글 클라우 드 인스턴스 비상 복구 방법
이방법은 스넵샷으로 복구하는 방법이 아니라.
직접 serial port 로 접속 하여 발생된 문제에 대해서 해결하는 방법이다. 
 
 
 
 vm instance serial connection enable
 
 gcloud compute instances add-metadata [INSTANCE_NAME] --metadata=serial-port-enable=1 
 
 
connecting serial console 
 

2017년 8월 15일 화요일

기본적인 HTML 태그들

기본적인 HTML 태그들

HTML에는 수십가지 태그가 있고, 각 태그는 서로 다른 속성을 가지기 때문에 이 모든 것을 한번에 모두 익히기는 어렵습니다. 이 문서는 자주 쓰이는 몇 가지 태그들과 속성을 간략히 소개합니다.

텍스트 레벨 태그들 - a, em, strong

요소들:
  • a 요소: HTML에서 가장 중요한 태그를 하나만 꼽자면 문서 사이의 하이퍼링크를 표시할 때 사용하는 a 태그를 꼽을 수 있습니다
  • em 요소: 문장의 일부분을 강조(emphasis)할 때 사용합니다
  • strong 요소: 강한 강조(strong emphasis)
예시:

  HTML
Hypertext Markup Language의 약자입니다. href="http://www.w3.org/People/Berners-Lee/">Tim Berners-Lee가 최초로 고안하였습니다.

단락과 소제목 - p, h1, h2, h3, h4, h5, h6

요소들:
예시:

HTML 자습서

준비물 준비물은 어쩌고 저쩌고...

HTML HTML은 웹 페이지를 만들 때 사용되는 문서 형식입니다.

CSS CSS는 HTML 등의 마크업 언어로 작성된 문서를 꾸미기 위해 사용합니다.

목록 - ul, ol, li

요소들:
  • ul 요소: 순서 없는 목록(unordered list)
  • ol 요소: 순서 있는 목록(ordered list)
  • li 요소: 목록 안에 담기는 각 항목들
예시:
점식에 뭐 먹을까?
  • 짜장면
  • 탕수육
  • 짬뽕 좋아하는 음식 순서는?
    1. 탕수육
    2. 짜장면
    3. 짬뽕

      표 - table, thead, tbody, tr, th, td

      요소들:
      예시:
      제목
      저자 나의 한국 현대사 유시민 What is History E. H. Carr

      미디어 - img, video, audio

      요소:
      예시:
      
        문장 중간에
        
          src="http://www.w3.org/Press/Stock/Berners-Lee/2001-europaeum-eighth.jpg"
          width="100" height="60"
          alt="Tim Berners-Lee 얼굴">
        이미지를 넣어보아요.
      

      2017년 8월 13일 일요일

      nox adb run batch script







      nox adb run batch script

      first nox setting root mode




      start CMD

      cd C:\Program Files (x86)\Nox\bin\

      nox_adb.exe connect 127.0.0.1:62001

      wait

      2017년 8월 12일 토요일

      안드로이드 개인키 공개키 생성 방법


      등록키 정보 확인
       keytool -list -v -keystore key.jks

      개인키 생성
      java -jar pepk.jar --keystore=key.jks --alias=key0 --output=privatekey.pem 
      --encryptionkey=*****************************833b6*********9d****e6*



      공개키 생성

      keytool -export -rfc -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000
      -alias key0 -file _publickey.pem


      생성된 키를 업로드 하는것은 다들 알고 있으니 생략

      2017년 8월 11일 금요일

      Pacman Tips

      Improve download and database access speed

      Ranking mirrors

      This command will rank your mirrors by speed and will filter the out of date mirrors.
      pacman-mirrors -g
      
      • You should sync the database after running this command by using: pacman -Syy

      Fasttrack your mirrorlist

      From v4 this command will return a number of up-to-date and responsive mirrors
       pacman-mirrors -f 5
      
      • Check your version with pacman-mirrors -v
      • You should sync the database after running this command by using: pacman -Syy

      Optimize the database access speed

      For full benefit, run this command after syncing the database.
      pacman-optimize && sync
      
      Attention: This command defragments Pacman's database, which boosts performance on slow hard drives but is harmful on SSDs. So, do not use this command on SSDs!

      Syncing and Updating

      Sync the database

      pacman -Sy
      
      • You can force sync the database using the following command. It means, the database will be synced even if it's up to date. This is useful when you changed something repository related and want to have the changes take effect.
      pacman -Syy
      

      Updating

      Pacman can update your system with only one command:
      pacman -Su
      
      Although, it is usually better to sync your repo database first:
      pacman -Syu
      
      This command was recommend:
      pacman -Syyu
      

      Update & ignore a package
      • The following changes take place in pacman's configuration file: /etc/pacman.conf
      IgnorePkg=package_name
      

      Update & ignore a package group
      IgnoreGroup=package_group
      
      • Examples:
      IgnoreGroup=gnome
      
      IgnoreGroup=kde
      

      Installing Packages

      • It is always best to have the repo databases synchronized & then all packages installed on your system up to date before you install any new packages.
      pacman -Syyu
      

      Install a package
      pacman -S package_name
      
      • If for example you are using the testing repo, & you have that repo listed below your other repos in /etc/pacman.conf which should mean that an older package will take priority over the younger one in the testing repo, you should use pacman like this:
      pacman -S testing/package_name
      

      Install packages as a group
      pacman -S gnome
      pacman -S kde
      

      Force the installation of a package. Attention: Only for advanced users.
      pacman -S --force package_name
      

      Download a package without installation
      pacman -Sw package_name
      

      Install a downloaded or a local package
      pacman -U /package_path/package_name.pkg.tar.xz
      
      • You can also use the URL:
      pacman -U http://www.examplepackage/repo/examplepkg.tar.xz
      

      Reinstall all packages
      pacman -S $(pacman -Qqen)
      

      To search which packages has been installed in a group
      pacman -Sg gnome
      pacman -Sg kde
      

      Get a full package list with versions. This will create a file called pacman.laptop in your home folder.
      pacman -Q > ~/pacman.laptop
      

      Removing Packages

      Remove a package
      pacman -R package_name
      

      Remove a package with dependencies that are not being used by other packages
      pacman -Rs package_name
      

      Remove a package with all dependencies. Attention: The -c flag can remove needed dependencies, too. Only for advanced users.
      pacman -Rsc package_name
      
      • Remove a package and its configuration files too:
      pacman -Rn package_name
      

      Forcefully remove a dependency without removing any other package. Attention: Only for advanced users.
      pacman -Rdd package_name
      


      Cleaning Packages

      See Maintaining /var/cache/pacman/pkg for System Safety for an in depth view on this topic.

      Cleaning the cache
      • Leaves packages in your cache only for those packages which are currently installed on your system. Attention: This eliminates the possibility to Using Downgrade.
      pacman -Sc
      
      • Clean cache completely and remove all packages. Attention: This eliminates the possibility to Using Downgrade.
      pacman -Scc
      
      • A safer way to remove old package cache files is to remove all packages except for the latest three package versions:
      paccache -rvk3
      


      Cleaning orphan packages from the system. Also read Orphan Package Removal for further information.
      pacman -Rsn $(pacman -Qdtq)
      
      If you get this error, don't worry: it means you don't have orphaned packages to remove!
      error: no targets specified (use -h for help)
      

      Searching for Packages


      Provides a description of searched for package & associated packages
      pacman -Ss package_name
      

      Provides a description of previously installed package
      pacman -Qs package_name
      

      Provides detailed summary of a package
      pacman -Si package_name
      
      • Modified summary:
      pacman -Qi package_name
      
      • with 'ii' you can see the backup files and the date that the package has been changed.
      pacman -Qii package_name
      

      Get a list of installed packages
      pacman -Q
      

      Find out which package owns a file
      pacman -Qo /file_path
      

      List all orphan packages with no dependencies
      pacman -Qdt
      

      List all installed packages from the AUR
      pacman -Qem
      

      View package dependencies. Use one of the following commands:
      pactree package_name
      
      pactree -c package_name
      
      pactree -s -c package_name
      


      AUR (Arch User Repository)

      Following is info on three popular options for using the AUR, for a detailed list of their commands please look at their man pages:


      Yaourt

      Yaourt comes pre-installed with Manjaro so you normally won't have to install it. If you have removed it, this is how you install it again:
      pacman -S base-devel yaourt
      
      • To use Yaourt to upgrade both official repos & AUR (only if new PKGBUILD files are available) use the following command:
      yaourt -Syua
      
      • To use Yaourt to download and rebuild the latest AUR packages from their source (regardless of PKGBUILD files):
      yaourt -Syua --devel
      

      You can use all Pacman commands mentioned on this Wiki page with Yaourt, too. One command is different:
      • Removing orphaned packages is easier and more intuitive with Yaourt:
      yaourt -Qdt
      


      Packer

      • Uses some of the same commands as pacman but differs in that it checks both the official repos & AUR.
      yaourt -S packer
      
      • Having installed 'packer' then you can run:
      packer -S package_name
      
      • This will upgrade from both official repos & AUR:
      packer -Syu