Ubuntu 22.04に最新のdockerをインストールする
$ sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg $ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null $ sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y && sudo docker version $ sudo usermod -aG docker <your-user> $ sudo reboot
Ubuntu 22.04でapt install時のdaemon/kernel 再起動確認ダイアログを出さない方法
needrestartというツールの設定になるので、confファイルを作って設定を書いておいてあげると勝手にrestartしてくれる。
$ echo "\$nrconf{restart} = 'a';" | sudo tee /etc/needrestart/conf.d/50local.conf
$ echo "\$nrconf{kernelhints} = '0';" | sudo tee -a /etc/needrestart/conf.d/50local.conf
以上。
aptでchromeをインストールする
毎回ぐぐってる気がする。
# リポジトリ追加 sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' # 公開鍵 sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - # install sudo apt update sudo apt install google-chrome-stable
コピペ用
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \ sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && \ sudo apt update && sudo apt install google-chrome-stable && \ google-chrome --version
asdfのnodejsでchrome-extention-cliを使う。
$ asdf install nodejs 16.15.0 $ asdf global nodejs 16.15.0 $ npm install -g chrome-extension-cli $ asdf reshim nodejs $ chrome-extension-cli my-extension
以上。
streamlitでdataframeをサーバーからユーザーのクリップボードにコピーする方法
調べてもほとんど出てこなかった。 こんな感じ。
$ python -m pip install bokeh $ python -m pip instal streamlit-bokeh-events
def copy_dataframe_button(df): from bokeh.models.widgets import Button from bokeh.models import CustomJS from streamlit_bokeh_events import streamlit_bokeh_events copy_button = Button(label="コピー") copy_button.js_on_event( "button_click", CustomJS( args=dict(df=df.to_csv(sep="\t", index=False, header=False)), code=""" navigator.clipboard.writeText(df); """, ), ) no_event = streamlit_bokeh_events( copy_button, events="GET_TEXT", key="get_text", refresh_on_update=True, override_height=75, debounce_time=0, )