This guide uses the domain your-domain.tld
and its www.
prefixed version.
It starts the rocket application on 127.0.0.1:1337
and as the user www-data
. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { google } from 'googleapis'; | |
import * as fs from 'fs'; | |
function authGoogleApi() { | |
let auth = new google.auth.GoogleAuth({ | |
keyFile: './service-account.json', | |
scopes: [ | |
'https://www.googleapis.com/auth/drive.readonly', | |
], | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from os import walk | |
list_file = "img_paths.txt" | |
for (_, _, filenames) in walk("img"): | |
with open(list_file, "w") as f: | |
f.writelines(map(lambda name: f"file img/{name}\n", filenames)) | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
from datetime import datetime, timedelta | |
import time | |
tm = datetime(2020, 8, 5, 22, 00) # 이 시점부터 과거로 가면서 얻음. | |
while True: | |
tm_str = tm.strftime("%Y%m%d%H%M") | |
url = f"https://www.weather.go.kr/w/cgi-bin/rdr_new/nph-rdr_sat_lgt_img_v3?tm={tm_str}&sat=ir1&rdr=lng&map=HC&size=640&zoom_level=0&zoom_x=0000000&zoom_y=0000000&fog=0" | |
print(tm_str) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Threading; | |
using System.Net; | |
using System.IO; | |
using Google.Apis.Auth.OAuth2; | |
using Newtonsoft.Json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import datetime | |
head_len = 4 | |
station_cnt = 265 # 원래는 s 파일에서 얻어와야할 정보. | |
time_offset = 1000 | |
time = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(milliseconds=time_offset) | |
bin_time = time.strftime('%Y%m%d%H%M%S') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use ggez::{ | |
audio::{self, SoundSource}, | |
conf::{WindowSetup, WindowMode}, | |
error::GameError, | |
event, graphics, | |
input::keyboard, | |
graphics::DrawParam, | |
Context, GameResult, | |
}; | |
use rodio::Source; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::iter::FromIterator; | |
/// A rule for repositioning characters in a string. | |
struct Rule(Vec<usize>); | |
impl Rule { | |
/// Applies this rule to the input and returns the result. | |
/// | |
/// # Examples | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
using System.Threading; | |
using System.Net.Http; | |
using System.Net; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
<title>Anime4K</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1'> | |
<link rel='stylesheet' type='text/css' media='screen' href='main.css'> | |
<script src='main.js'></script> | |
</head> |
NewerOlder