====== LessCSS test ======
===== Dark mode test =====
ダークモード
縦書き
===== code file wrap test 🤔 =====
==== ケース 1 (color_term, color_mincode, mincode) ====
{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Selected Theme
// Application-level visual styling theme
"theme": "JupyterLab Dark",
}
|
{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Selected Theme
// Application-level visual styling theme
"theme": "JupyterLab Dark",
}
{
// Notebook
// @jupyterlab/notebook-extension:tracker
// Notebook settings.
// **************************************
// Code Cell Configuration
// The configuration for all code cells.
"codeCellConfig": {
"lineNumbers": true
}
}
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cgi
import mimetypes
import os
from pip._internal.download import PipSession
from pip._internal.models.link import Link
from pip._vendor.requests.models import CONTENT_CHUNK_SIZE
from pip._internal.utils.misc import splitext, consume, format_size
from pip._internal.utils.ui import DownloadProgressProvider
from pip._vendor import requests
import logging
logger = logging.getLogger(__name__)
def download_http_url(
url, # type: str
download_dir, # type: str
hashes=None, # type: Optional[Hashes]
progress_bar='on' # type: str
):
logger.debug('download_http_url("%s", "%s")', url, download_dir)
link = Link(url)
session = PipSession()
def _download_url(
resp, # type: Response
link, # type: Link
content_file, # type: IO
hashes, # type: Optional[Hashes]
progress_bar # type: str
):
# type: (...) -> None
try:
total_length = int(resp.headers['content-length'])
except (ValueError, KeyError, TypeError):
total_length = 0
cached_resp = getattr(resp, 'from_cache', False)
if cached_resp:
show_progress = False
elif total_length > (40 * 1000):
show_progress = True
elif not total_length:
show_progress = True
else:
show_progress = False
def resp_read(chunk_size):
try:
# Special case for urllib3.
for chunk in resp.raw.stream(
chunk_size,
decode_content=False):
yield chunk
except AttributeError:
# Standard file-like object.
while True:
chunk = resp.raw.read(chunk_size)
if not chunk:
break
yield chunk
def written_chunks(chunks):
for chunk in chunks:
content_file.write(chunk)
yield chunk
def _progress_indicator(iterable, *args, **kwargs):
return iterable
progress_indicator = _progress_indicator
if show_progress: # We don't show progress on cached responses
progress_indicator = DownloadProgressProvider(progress_bar,
max=total_length)
if total_length:
print('Downloading {} ({})'.format(url, format_size(total_length)))
else:
print(f'Downloading {link.url}')
elif cached_resp:
print(f'Using cached {link.url}')
else:
print(f'Downloading {link.url}')
print(f'Downloading from URL {link}')
downloaded_chunks = written_chunks(
progress_indicator(
resp_read(CONTENT_CHUNK_SIZE),
CONTENT_CHUNK_SIZE
)
)
if hashes:
hashes.check_against_chunks(downloaded_chunks)
else:
consume(downloaded_chunks)
# type: (...) -> Tuple[str, str]
"""Download link url into temp_dir using provided session"""
target_url = link.url.split('#', 1)[0]
try:
resp = session.get(
target_url,
headers={"Accept-Encoding": "identity"},
stream=True,
)
resp.raise_for_status()
except requests.HTTPError as exc:
print('HTTP error {} while getting {}'.format(exc.response.status_code, link))
raise
content_type = resp.headers.get('content-type', '')
filename = link.filename # fallback
# Have a look at the Content-Disposition header for a better guess
content_disposition = resp.headers.get('content-disposition')
if content_disposition:
# type: (str, str) -> str
def sanitize_content_filename(filename):
# type: (str) -> str
"""
Sanitize the "filename" value from a Content-Disposition header.
"""
return os.path.basename(filename)
"""
Parse the "filename" value from a Content-Disposition header, and
return the default filename if the result is empty.
"""
_type, params = cgi.parse_header(content_disposition)
filename = params.get('filename')
if filename:
# We need to sanitize the filename to prevent directory traversal
# in case the filename contains ".." path parts.
filename = sanitize_content_filename(filename)
ext = splitext(filename)[1] # type: Optional[str]
if not ext:
ext = mimetypes.guess_extension(content_type)
if ext:
filename += ext
if not ext and link.url != resp.url:
ext = os.path.splitext(resp.url)[1]
if ext:
filename += ext
file_path = os.path.join(download_dir, filename)
with open(file_path, 'wb') as content_file:
_download_url(resp, link, content_file, hashes, progress_bar)
return file_path, content_type
$ sudo /usr/local/lsws/admin/misc/admpass.sh
Please specify the user name of administrator.
This is the user name required to login the administration Web interface.
User name [admin]: tomoyan596 <- 管理者ユーザーを入力
Please specify the administrator's password.
This is the password required to login the administration Web interface.
Password: <- 管理者パスワードを入力
Retype password: <- 管理者パスワードの確認でもう一度入力
Administrator's username/password is updated successfully!
$ sudo cat /usr/local/lsws/admin/conf/htpasswd
tomoyan596:$1$2wALctqc$wIsHdEdChWRN0AmAT6L8E0
# generate password file
ENCRYPT_PASS=`$CUR_DIR/../fcgi-bin/admin_php -q $CUR_DIR/htpasswd.php $PASS_ONE`
echo "$ADMIN_USER:$ENCRYPT_PASS" > $CUR_DIR/../conf/htpasswd
$ ~/scoop/apps/scoop/current/bin/checkver.ps1
$ ~/scoop/apps/scoop/current/bin/checkver.ps1 ffmpeg -u -Dir ~/scoop/buckets/main/bucket
ffmpeg: 4.4-19 (scoop version is 4.3.2) autoupdate available
Autoupdating ffmpeg
Downloading ffmpeg-n4.4-19-g8d172d9409-win64-gpl-4.4.zip to compute hashes!
ffmpeg-n4.4-19-g8d172d9409-win64-gpl-4.4.zip (94.9 MB) [=================> ] 34%
ffmpeg-n4.4-19-g8d172d9409-win64-gpl-4.4.zip (94.9 MB) [================================================] 100%
Computed hash: ba5e6a3a29ee90c90a573a39f536f64d48e31eacce3e5b6a31ce96079ef65ac7
Writing updated ffmpeg manifest
# opkg -help
opkg: unrecognized option: h
opkg: unrecognized option: e
opkg must have one sub-command argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:
Package Manipulation:
update Update list of available packages
upgrade
# opkg -help
opkg: unrecognized option: h
opkg: unrecognized option: e
opkg must have one sub-command argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:
Package Manipulation:
update Update list of available packages
upgrade
⚠ Python environment not found.
Install using the bundled installer
or Change the default Python environment
情報枠
重要枠
警告枠
ヘルプ枠
$ diff build.sh build.sh.org
1c1
< #!/bin/sh -x
---
> #!/bin/sh
162c162
< #yum install -y epel-release
---
> yum install -y epel-release
164,166c164
< if echo $output | grep "Fedora"; then
< OSTYPE=FEDORA
< elif echo $output | grep " 7."; then
---
> if echo $output | grep " 7."; then
174,177d171
< if [ ! "${OSTYPE}" = "FEDORA" ] ; then
< yum install -y epel-release
< fi
<
193,194c187
< #elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
< elif [ "${OSTYPE}" = "FEDORA" ] || ["${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
---
> elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
$ mkdir tomoyan-app-dev && cd tomoyan-app-dev
$ firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/home/tomoyan/my_projects/tomoyan-app-dev
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter
to confirm your choices.
このディレクトリに設定する Firebase 機能はどれですか? Space を押して機能を選択し、Enter を押して選択を確定します。
(Press <space> to select, <a> to toggle all, <i> to invert selection, and <enter> to proceed)
◉ Realtime Database: Configure a security rules file for Realtime Database and (optionally) provision default
instance
◉ Firestore: Configure security rules and indexes files for Firestore
❯◉ Functions: Configure a Cloud Functions directory and its files
◉ Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
◉ Hosting: Set up GitHub Action deploys
◉ Storage: Configure a security rules file for Cloud Storage
◉ Emulators: Set up local emulators for Firebase products
◉ Remote Config: Configure a template file for Remote Config
(Move up and down to reveal more choices)
Realtime Database: Configure a security rules file for Realtime Database and
(optionally) provision default instance, Firestore: Configure security rules and indexes files for Firestore,
Functions: Configure a Cloud Functions directory and its files, Hosting: Configure files for Firebase Hosting
and (optionally) set up GitHub Action deploys, Hosting: Set up GitHub Action deploys, Storage: Configure a
security rules file for Cloud Storage, Emulators: Set up local emulators for Firebase products, Remote Config:
Configure a template file for Remote Config
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option:
Use an existing project
❯ Create a new project
Add Firebase to an existing Google Cloud Platform project
Don't set up a default project
? Please select an option: Create a new project
i If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project.
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
tomoyan-app-dev
? What would you like to call your project? (defaults to your project ID)
✔ Creating Google Cloud Platform project
✔ Adding Firebase resources to Google Cloud Platform project
🎉🎉🎉 Your Firebase project is ready! 🎉🎉🎉
Project information:
- Project ID: tomoyan-app-dev
- Project Name: tomoyan-app-dev
Firebase console is available at
https://console.firebase.google.com/project/tomoyan-app-dev/overview
i Using project tomoyan-app-dev (tomoyan-app-dev)
=== Database Setup
i database: ensuring required API firebasedatabase.googleapis.com is enabled...
⚠ database: missing required API firebasedatabase.googleapis.com. Enabling now...
✔ database: required API firebasedatabase.googleapis.com is enabled
? It seems like you haven’t initialized Realtime Database in your project yet. Do you want to set it up? Yes
? Please choose the location for your default Realtime Database instance:
us-central1
europe-west1
❯ asia-southeast1
? Please choose the location for your default Realtime Database instance: asia-southeast1
✔ Creating your default Realtime Database instance: tomoyan-app-dev-default-rtdb
Firebase Realtime Database Security Rules allow you to define how your data should be
structured and when your data can be read from and written to.
? What file should be used for Realtime Database Security Rules? (database.rules.json)
✔ Database Rules for tomoyan-app-dev-default-rtdb have been written to database.rules.json.
Future modifications to database.rules.json will update Realtime Database Security Rules when you run
firebase deploy.
? Select a default Firebase project for this directory: (Use arrow keys)
❯ tomoyan-app-dev (tomoyan-app-dev)
=== Functions Setup
Let's create a new codebase for your functions.
A directory corresponding to the codebase will be created in your project
with sample code pre-configured.
See https://firebase.google.com/docs/functions/organize-functions for
more information on organizing your functions using codebases.
Functions can be deployed with firebase deploy.
? What language would you like to use to write Cloud Functions? (Use arrow keys)
❯ JavaScript
TypeScript
? Do you want to use ESLint to catch probable bugs and enforce style? (y/N) Yes
✔ Wrote functions/package.json
✔ Wrote functions/.eslintrc.js
✔ Wrote functions/index.js
✔ Wrote functions/.gitignore
? Do you want to install dependencies with npm now? (y/N) Yes
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: undefined,
npm WARN EBADENGINE required: { node: '16' },
npm WARN EBADENGINE current: { node: 'v18.14.0', npm: '9.3.1' }
npm WARN EBADENGINE }
added 316 packages, and audited 317 packages in 57s
36 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
✔ Firebase initialization complete!
$ firebase emulators:start
000001* プログラム名 はるおわ〜るど🤤
000002* プログラムID HARUO-WORLD01
000003* バージョン 0.0.1
000004* 作成日 作成者
000005* 2022/09/01 Tomoyan
000006* 更新日 更新者 更新概要
000007* YYYY/MM/DD XXXXXXXX XXXXXXXXXX
000008
000009 IDENTIFICATION DIVISION.
000010 PROGRAM-ID. HARUO-WORLD01.
000011 ENVIRONMENT DIVISION.
000012 CONFIGURATION SECTION.
000013 INPUT-OUTPUT SECTION.
000014 DATA DIVISION.
000015 FILE SECTION.
000016 WORKING-STORAGE SECTION.
000017 01 OUTPUT-MESSAGE PIC X(30).
000018 01 RND PIC 99V9(3).
000019* Unicode 内部表現 UTF-16 1文字 4Byte🤔
000020 01 EMOJI PIC X(44)
000021 VALUE "✔😅😊🤔🤤😁😃👅👅👅😍😱".
000022 01 WK-INDEX PIC 9(2).
000023 01 CUR-DATE PIC X(21).
000024 PROCEDURE DIVISION.
000025 MAIN.
000026 MOVE "Welcome to Haruo World!" TO OUTPUT-MESSAGE.
000027
000028 DISPLAY EMOJI UPON CONSOLE
000029 PERFORM VARYING WK-INDEX FROM 1 BY 1 UNTIL WK-INDEX > 11
000030 PERFORM SHOW-RND-MESSAGE
000031 END-PERFORM.
000032
000033 STOP RUN.
000034
000035 SHOW-RND-MESSAGE SECTION.
000036 MOVE FUNCTION CURRENT-DATE TO CUR-DATE
000037 COMPUTE RND = FUNCTION RANDOM(
000038 RND + FUNCTION NUMVAL(
000039 CUR-DATE(15:2))) * 10 + 1
000040 DISPLAY
000041* CUR-DATE(15:2)" ["RND"] "
000042 "["WK-INDEX"] " FUNCTION TRIM(OUTPUT-MESSAGE)
000043 EMOJI(4 * (RND - 1) + 1:4) UPON CONSOLE
000044 END-DISPLAY
000045 EXIT.
$ sudo dietpi-drive_manager
[ INFO ] DietPi-Drive_Manager | Detecting drives, please wait... [ INFO ] DietPi-Drive_Manager | - Detected mounted physical drive: /dev/mmcblk0p2 > / [ INFO ] DietPi-Drive_Manager | - Detected mounted physical drive: /dev/mmcblk0p1 > /boot [ INFO ] DietPi-Drive_Manager | - Detected unmounted drive: /dev/zram0 [ OK ] DietPi-Drive_Manager | mv .fstab /etc/fstab [ OK ] DietPi-Drive_Manager | systemctl daemon-reload [ INFO ] DietPi-Drive_Manager | Checking for required APT packages: e2fsprogs [ OK ] DietPi-Drive_Manager | sync ---RPi Zero W (armv6l) | IP: 192.168.1.201---┌───────────────────────────────────────────────┤ DietPi-Drive_Manager ├───────────────────────────────────────────────┐ │ Please select a drive to see available options. │ │ - User data location: RootFS (/mnt/dietpi_userdata) │ │ │ │ ●─ mmcblk0 ─────────────────────────────────────────────── │ │ / : /dev/mmcblk0p2 | ext4 | Capacity: 1.7G | Used: 1.5G (90%) │ │ /boot : /dev/mmcblk0p1 | vfat | Capacity: 126M | Used: 50.7M (40%) │ │ ●─ zram0 ──────────────────────────────────────────────── │ │ /mnt/75eebb29-af8d-49e5-9973-ad5d342df36c : /dev/zram0 | swap | Not mounted │ │ ●─ Global Options ─────────────────────────────────────────● │ │ Idle Spindown : Set a global idle duration, before drives power down │ │ ●─ Add / Refresh Drives ───────────────────────────────────● │ │ Add network drive : Select to mount networked drives │ │ Refresh : Scan for recently added/removed drives │ │ │ │ │ │ <Ok> <Exit> │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘RPi Zero W (armv6l) | IP: 192.168.1.201--- [ OK ] DietPi-Drive_Manager | systemctl enable dietpi-fs_partition_resize ---┌───────────────────────────────────────────────┤ DietPi-Drive_Manager ├───────────────────────────────────────────────┐ │ Mount target: / │ │ Mount source: /dev/mmcblk0p2 │ │ Filesystem: ext4 │ │ UUID: 14fcf30d-e3ea-40e7-be42-2304f593b40e │ │ Allocation: Capacity: 1.7GiB | Used: 1.5GiB (90%) │ │ Status: Drive is online and ready for use │ │ Read only: Disabled │ │ │ │ ●─ Benchmark Options ─────────────────────────────────────● │ │ Benchmark : Test read and write speeds │ │ ●─ Userdata & Swap options ───────────────────────────────● │ │ User data : [X] | DietPi user data is currently located on this drive │ │ Swap file : [ ] | Select to transfer swapfile to this drive │ │ ●─ Advanced options ──────────────────────────────────────● │ │ Read Only : [ ] | Select to toggle RW/RO modes │ │ Reserved blocks : [79 MiB] | Space reserved for root user │ │ Check & Repair : Check and optionally repair filesystem │ │ Resize : Maximize the available filesystem size │ │ I/O Scheduler : [mq-deadline] │ │ │ │ │ │ <Ok> <Back> │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘RPi Zero W (armv6l) | IP: 192.168.1.201┌───────────────────────────────────────────────┤ DietPi-Drive_Manager ├───────────────────────────────────────────────┐ │ │ │ RootFS resize will occur on next reboot. │ │ │ │ Would you like to reboot the system now? │ │ │ │ <Ok> <Cancel> │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘