Skip to content

Instantly share code, notes, and snippets.

@nogajun
nogajun / docker-compose.rocm-apu.yml
Created September 6, 2024 07:41
docker compose file to use ollama and Open WebUI with APU rocm.
services:
ollama:
image: ollama/ollama:rocm
container_name: ollama
devices:
- /dev/kfd
- /dev/dri
volumes:
- ollama:/root/.ollama
environment:
@nogajun
nogajun / libreoffice_build.md
Last active August 22, 2024 13:19
libreoffice repository clone and build tips

LibreOffice Building Tips

Cloning repositories

This is about cloning LibreOffice repositories. since LibreOffice source code repositories are large and far away, you can quickly clone the source code using shallow clone from a github mirror.

git clone -o github --depth=1 --recurse-submodules --shallow-submodules https://github.com/LibreOffice/core.git libreoffice
@nogajun
nogajun / list1a.py
Created May 26, 2024 06:06
ported from MSX Graphic workbook(1984) p.69 List 1a / MSXグラフィック・ワークブックからのPython移植
# ported from MSX Graphic workbook(1984) p.69 List 1a
import pyxel
size = 255
count = 36
step = size / count
color = pyxel.COLOR_WHITE
pyxel.init(size, size)
pyxel.cls(pyxel.COLOR_PURPLE)
@nogajun
nogajun / app.py
Created December 29, 2022 10:48
Flaskでカレンダーを表示する
@app.route('/calendar')
def month_list():
dt_now = datetime.now()
month = calendar.monthcalendar(dt_now.year,dt_now.month)
return render_template("calendar.html", month = month)
@nogajun
nogajun / Dockerfile
Last active September 6, 2022 00:39
For web app creation class. used from dev container on Visual studio code.
FROM debian:bookworm
LABEL version="1.2"
LABEL maintainer="nogata@gm.himeji-du.ac.jp"
LABEL description="For web app creation class. used from dev container on Visual studio code."
# 必要なパッケージをインストール
RUN apt-get -y update && \
apt-get -y full-upgrade && \
apt-get -y install apt-utils locales sudo python3-all python3-pip python3-venv python-is-python3 python3-yaml bash-completion wget curl jq git task-japanese
@nogajun
nogajun / tmx2tsv.xsl
Last active November 19, 2022 04:33
xsltprocを使って翻訳メモリのtmxファイルをcsvに変換するXSLTファイル
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" />
<xsl:template match="/">
<xsl:text>"en-US"&#x9;"ja"</xsl:text>
<xsl:text>&#xA;</xsl:text>
<xsl:for-each select="tmx/body/tu">
<xsl:text>"</xsl:text>
<xsl:value-of select="tuv[@lang='en-US']/seg"/>
<xsl:text>"&#x9;"</xsl:text>
@nogajun
nogajun / dynamite-color.gpl
Created September 21, 2020 01:51
BTS Dynamite logo color palette for GIMP/LibreOffice
GIMP Palette
Name: Dynamite
Columns: 12
#
226 7 68
64 181 207
211 116 151
115 172 123
103 33 124
240 103 6
@nogajun
nogajun / ms_ui_strings_csv_cleanup.sh
Created December 15, 2019 03:37
MicrosoftランゲージポータルにあるUI訳語データCSVがまともなCSVじゃないのでクリーンアップしてCSVとして使えるようにするワンライナー
sed -e '1,12d' -e 's/",,"/\t/g' -e 's/^"//g' -e 's/"$//g' ja-JP-csv-Excel.csv > a.csv
@nogajun
nogajun / JYS-NS138.md
Last active March 10, 2024 17:14
JYS-NS138 Controler Instruction Sheet

Operating Instructions:

1.Mode and connection instructions

The Mode Switch:

Press Y + Home 2 seconds to enter the Bluetooth search mode, led1-led4 running horse flashes, and the LED channel corresponding to the successful connection remains on (Switching the assignment of the host organization); Synchronous state, or being paired with host connection: led1-led4 flashing horse;

Note: when the handle enters synchronization mode, it will automatically go to sleep if no synchronization is reached within 2.5 minutes.

---
- hosts: all
become: yes
vars:
user: "{{ ansible_ssh_user }}"
home_dir: "/home/{{ user }}"
fontconfig: "{{ home_dir }}/.config/fontconfig"
gtk3: "{{ home_dir }}/.config/gtk-3.0"
tasks:
- name: ロケール関係インストール