Ubuntu, TigerVNC

Setup VNC via ssh on Ubuntu Desktop. Install TigerVNC. # Ubuntu 18.04 sudo apt install tigervnc-scraping-server # Ubuntu 16.04 sudo apt install tigervncserver Set password. vncpasswd startVNC.sh #!/bin/bash x0tigervncserver PasswordFile=~/.vnc/passwd Display=:0 configure LocalForward LOCALPORT localhost:5900 in ~/.ssh/config. TigerVNCのクライアントはあんまり機能が多くない RealVNC社のクライアントはWindows, Linux, Mac, Mobileにリリースされてて便利 https://www.realvnc.com/en/connect/download/viewer/ つまずかない!?TigerVNCでリモートデスクトップ - Qiita

2020年3月18日 · aoirint

tar 圧縮

解凍tar -xfはよく使うので覚えるけど、圧縮のほうが覚えられん.. [Linux]ファイルの圧縮、解凍方法 - Qiita tar.gz tar -zcf compressed.tar.gz FILES extractとcompressかな おまけ zip zip -r compressed.zip DIR unzip compressed.zip

2020年3月17日 · aoirint

Flask, sqlalchemy

Flask ウェブアプリケーションフレームワーク Flask を使ってみる - Qiita Flaskで任意のデータを引数として受け取る方法 - Qiita python - redirect while passing arguments - Stack Overflow #url_for API — Flask 0.10.1 documentation python - How to serve static files in Flask - Stack Overflow python - Unable to retrieve files from send_from_directory() in flask - Stack Overflow python - Flaskで変数を文字列ではなくHTMLのタグとして読み込ませたい - スタック・オーバーフロー sqlalchemy 【PythonのORM】SQLAlchemyで基本的なSQLクエリまとめ - Qiita Object Relational Tutorial — SQLAlchemy 1.3 Documentation Python: SQLAlchemy + mysqlclient (MySQLdb) でマルチバイト文字を扱う - CUBE SUGAR CONTAINER Transactions and Connection Management — SQLAlchemy 1.3 Documentation Object Relational Tutorial — SQLAlchemy 1.3 Documentation SQLAlchemy で Delete するには? - Qiita Basic Relationship Patterns — SQLAlchemy 1.3 Documentation python - How to remove all items from many-to-many collection in SqlAlchemy? - Stack Overflow python - Flask-SQLAlchemy - model has no attribute ‘foreign_keys’ - Stack Overflow python - sqlalchemy dynamic filtering - Stack Overflow tagify Tagify - demo python-markdown Library Reference — Python-Markdown 3.2.1 documentation Extensions — Python-Markdown 3.2.1 documentation MathJax Getting Started — MathJax 2.7 documentation Combined Configurations — MathJax 2.7 documentation highlight.js How to use highlight.js highlight.js demo highlight.js/src/styles at master · highlightjs/highlight.js highlightjs-line-numbers.js - cdnjs.com - The best FOSS CDN for web related libraries to speed up your websites! wcoder/highlightjs-line-numbers.js: Line numbering plugin for Highlight.js Ace Editor Ace - The High Performance Code Editor for the Web ace/lib/ace/theme at master · ajaxorg/ace javascript - How do I get value from ACE editor? - Stack Overflow Unique/Random ID [Python] UUIDを生成するuuid.uuid4()はどうやってUUIDを生成しているのか? | Developers.IO #os.urandom os — 雑多なオペレーティングシステムインタフェース — Python 3.8.2 ドキュメント os.urandom(NUM_BYTES).hex()

2020年3月16日 · aoirint

Python Dockerfile

FROM python:3 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt

2020年3月16日 · aoirint

Install Docker on Ubuntu

Get Docker Engine - Community for Ubuntu | Docker Documentation

2020年3月16日 · aoirint

Ubuntu, add user to group

usermod -aG GROUP USER adduser USER GROUP https://qiita.com/orangain/items/056db6ffc16d765a8187

2020年3月15日 · aoirint

OGP / Open Graph Protocol, favicon

<meta property="og:locale" content="ja_JP"> <meta property="og:type" content="website"> <meta property="og:title" content="TITLE"> <meta property="og:description" content="DESCRIPTION"> <meta property="og:image" content="IMAGE_FULL_URL"> Card Validator | Twitter Developers https://qiita.com/kana-t/items/f058f29ddd93e062761c https://qiita.com/kogache/items/9e49c94758be8c1c4d77 <link rel="shortcut icon" href="FAVICON_URL"> https://qiita.com/uraranbon/items/a143d215b7baa3e9d1a0

2020年3月15日 · aoirint

github.io

URL:USERNAME.github.io リポジトリ:USERNAME.github.io ブランチ:master 通常のGitHub Pagesと違ってmasterブランチが使われる https://qiita.com/ryokosuge/items/f929821ba5ae9ba2c32b

2020年3月15日 · aoirint

git, markdown python

Git https://qiita.com/TakesxiSximada/items/ea778bb98b8c057ffd07 https://gitpython.readthedocs.io/en/stable/tutorial.html Markdown convert https://python-markdown.github.io/ https://qiita.com/masakuni-ito/items/593b9d753c44da61937b

2020年3月15日 · aoirint

pydub numpy

from pydub import * import numpy as np import time # https://own-search-and-study.xyz/2017/11/19/numpy%E3%81%AEarray%E3%81%8B%E3%82%89pydub%E3%81%AEaudiosegment%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B/ # https://maoudamashii.jokersounds.com/archives/song_kouichi_the_milky_way.html path = 'song_kouichi_the_milky_way.m4a' # https://github.com/jiaaro/pydub/blob/master/API.markdown#audiosegmentfrom_file sound = AudioSegment.from_file(path, format='m4a') # give format explicitly samples = np.array(sound.get_array_of_samples()) print(path) print('Sample width (Num of bytes of a sample):', sound.sample_width) print('Frame rate (Num of samples per second):', sound.frame_rate) print('Channels (Stereo/Mono):', sound.channels) print('Shape (Length):', samples.shape) print('Type:', samples.dtype) print('Min/Max:', samples.min(), samples.max()) output = AudioSegment( samples.astype('int32').tobytes(), sample_width=4, frame_rate=44100, channels=2, ) ts = time.time() output.export('output.m4a') elapsed = time.time() - ts print('Exported as m4a: %f s' % elapsed) ts = time.time() output.export('output.mp3') elapsed = time.time() - ts print('Exported as mp3: %f s' % elapsed) ts = time.time() output.export('output.wav') elapsed = time.time() - ts print('Exported as wav: %f s' % elapsed) song_kouichi_the_milky_way.m4a Sample width (Num of bytes of a sample): 2 Frame rate (Num of samples per second): 44100 Channels (Stereo/Mono): 2 Shape (Length): (22339584,) Type: int16 Min/Max: -32768 32767 Exported as m4a: 6.288757 s Exported as mp3: 6.194534 s Exported as wav: 6.064215 s 出力時間はフォーマットによって変わらない(誤差の範囲)

2020年3月14日 · aoirint