Skip to content

Instantly share code, notes, and snippets.

View WhiteCat6142's full-sized avatar
:octocat:

K.O. WhiteCat6142

:octocat:
  • Titech->U-Tokyo (master)
  • Tokyo,Japan
View GitHub Profile
@WhiteCat6142
WhiteCat6142 / Dockerfile
Last active June 17, 2024 06:07
build PyTorch from source
ARG ROOT_CONTAINER=nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
FROM $ROOT_CONTAINER
# https://gist.github.com/Birch-san/211f31f8d901dadd1025398fa1a603b8
# https://github.com/pytorch/pytorch
# https://github.com/pytorch/pytorch/issues/77939
LABEL maintainer="WhiteCat6142 <whitecat6142+git@gmail.com>"
ARG NB_USER="jovyan"
ARG NB_UID="1000"
@WhiteCat6142
WhiteCat6142 / open-interpreter.sh
Last active June 17, 2024 08:40
open-interpreter.sh
#!/bin/sh
chmod +x ./TinyLlama-1.1B
sh ./TinyLlama-1.1B -n 9999
pip install open-interpreter
interpreter --api_base "http://127.0.0.1:8080/v1" --api_key "fake_key"
#References
# 【完全無料】Google ColabでOpen InterpreterをLlama 2で動かす #Python - Qiita
# https://qiita.com/uorijie/items/68758c9a7ebf608a1cab
/*
MIT License
Copyright (c) 2024 WhiteCat6142
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@WhiteCat6142
WhiteCat6142 / Nostr-autoComplete.html
Last active July 16, 2023 03:48
Nostr-autoComplete
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Nostr補完</title>
<link rel="stylesheet"
#!/usr/bin/env python
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
from gi.repository import WebKit2
from gi.repository import GLib
# https://stackoverflow.com/questions/42174933/python-web-browser-disable-javascript
# Python Web Browser: Disable Javascript? - Stack Overflow
# https://wiki.gnome.org/Projects/Vala/WebKitSample
#!/usr/bin/python
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
Notify.init ("Hello world")
Hello = Notify.Notification.new ("Hello world","This is an example notification.","dialog-information")
Hello.show ()
# https://ideone.com/BLQ2FM
# https://blog.tmtms.net/entry/2015/12/07/mime-header-encoding
# https://docs.python.org/ja/3/library/email.message.html
from email.message import Message
from email.header import Header
msg = Message()
h = Header('MIMEヘッダエンコーディングは複雑すぎてつらい', 'utf-8',77,'Subject')
msg['Subject'] = h.encode()
print(msg.as_string())
EARLYOOM_ARGS="-r 0 -m 7,1 -s 10 --prefer '^(Web Content|Isolated Web Co)$' --avoid '^(firefox|dnf|packagekitd|gnome-shell|gnome-session-c|gnome-session-b|lightdm|sddm|sddm-helper|gdm|gdm-wayland-ses|gdm-session-wor|gdm-x-session|Xorg|Xwayland|systemd|systemd-logind|dbus-daemon|dbus-broker|cinnamon|cinnamon-sessio|kwin_x11|kwin_wayland|plasmashell|ksmserver|plasma_session|startplasma-way|xfce4-session|mate-session|marco|lxqt-session|openbox)$'"
# https://sw.kovidgoyal.net/kitty/conf/
background #464646
font_size 14.0
font_family Ubuntu Mono
Nimbus Mono PS Bold
map f4 close_window_with_confirmation
touch_scroll_multiplier 12.0
hide_window_decorations no
linux_display_server X11