[Discord Bot] 미세먼지 시각화로 보여주기
[Discord Bot] 미세먼지 시각화로 보여주기
2020.03.29const request = require('request-promise'); const Pageres = require('pageres'); const fs = require('fs-extra'); const path = require('path'); const { RichEmbed } = require('discord.js'); async function capture() { await new Pageres({delay: 2, filename: 'dust'}) .src('https://earth.nullschool.net/#current/particulates/surface/level/overlay=pm10/orthographic=127.53,39.09,2196/loc=127.333,37.782', ..
[Discord Bot] 네이버 실시간 급상승 Top20
[Discord Bot] 네이버 실시간 급상승 Top20
2020.02.08const request = require('request-promise'); const cheerio = require('cheerio'); const { RichEmbed } = require('discord.js'); async function getRank(args) { let url = 'http://rank.search.naver.com/rank.js'; let html; try { html = await request(url); } catch (e) { console.log("error"); return "Error"; } let json = JSON.parse(html); let jsonData = json.data[0].data const Rank_List = []; for (const ..
[Discord Bot] 롤 전적 검색기
[Discord Bot] 롤 전적 검색기
2020.02.08const request = require('request-promise'); const cheerio = require('cheerio'); const { RichEmbed } = require('discord.js'); async function getStat(args) { if (args.length < 2) { return '`!롤 ` 형식으로 부탁'; } // console.log(args); const search = args.slice(1, args.length).join(' '); // console.log(search); let url = 'https://www.op.gg/summoner/userName=' + encodeURIComponent(search); let options = {..
[Ubuntu] Reverse Proxy(역방향프록시) 설정
[Ubuntu] Reverse Proxy(역방향프록시) 설정
2020.01.27# apt-get update # apt-get install apache2 -y # cd /etc/apache2/site-available # vi [도메인주소].conf ex) vi pental.system32.kr.conf ProxyPreserveHost On ProxyPass / http://localhost:[port]/ ProxyPassReverse / http://localhost:[port]/ ServerName [도메인주소] # a2enmod proxy # a2enmod proxy_http # a2ensite [도메인주소].conf # service apache2 restart
[Ubuntu] phpmyadmin 설치
[Ubuntu] phpmyadmin 설치
2020.01.22필자의 환경 Ubuntu 16.04 (Vmware) # apt-get update # apt-get install phpmyadmin phpmyadmin 패키지를 설치해준다. # vi /etc/apache2/apache2.conf Include /etc/phpmyadmin/apache.conf 마지막줄에 위 Include 부분을 추가해 준다. # service apache2 restart 아파치 재시작. http://localhost/phpmyadmin 위 사이트를 들어가 사용한다.
[Ubuntu] Cloud9 설치하기
[Ubuntu] Cloud9 설치하기
2020.01.21Ubuntu에 Cloud9 설치하기. 필자의 조건 Ubuntu 16.04 # apt-get update # apt-get upgrade # apt-get install git Git 설치 # git clone https://github.com/c9/core.git [저장폴더] ex) git clone https://github.com/c9/core.git c9sdk Git 으로 Github에서 Git을 받아옴. # cd c9sdk # apt-get install nodejs-legacy # cd scripts # ./install-sdk.sh 설치 끝. # node server.js -w [WorkStation 경로] -a [ID]:[Password] -p [Port] ex) node server.js ..
[Ubuntu] 포트포워딩 방법
[Ubuntu] 포트포워딩 방법
2020.01.21sudo iptables -A INPUT -s 0.0.0.0/0 -p tcp --dport 5000 -j ACCEPT 메모장 @reboot node /home/pental/c9sdk/server.js -l 0.0.0.0 -p 3333 -a id:pw -w /home/pental