From 68f39eb867c851acb651f79604aba119ecaa9527 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 3 Jun 2025 10:30:38 -0400 Subject: Add some gentoo stuff and update cgit --- hosts/denpa/cgit/readme_in_summary.diff | 152 ---------------------- hosts/denpa/cgit/readme_in_summary_no_about.diff | 154 +++++++++++++++++++++++ hosts/denpa/git/git-config | 3 + hosts/denpa/git/git-template.zip | Bin 0 -> 2772 bytes hosts/iroha/fstab | 10 ++ hosts/iroha/new_desktop.txt | 49 ++++++++ hosts/iroha/sshd_config | 7 ++ hosts/moyo/fstab | 7 ++ hosts/moyo/samba/smb.conf | 9 +- hosts/moyo/sshd_config | 7 ++ hosts/sofue/configuration.nix | 14 +-- hosts/soy/Scripts/all.sh | 2 +- hosts/soy/Scripts/mount-code.sh | 2 - hosts/soy/Scripts/mount-samba.sh | 2 + 14 files changed, 251 insertions(+), 167 deletions(-) delete mode 100644 hosts/denpa/cgit/readme_in_summary.diff create mode 100644 hosts/denpa/cgit/readme_in_summary_no_about.diff create mode 100644 hosts/denpa/git/git-config create mode 100644 hosts/denpa/git/git-template.zip create mode 100644 hosts/iroha/fstab create mode 100644 hosts/iroha/new_desktop.txt create mode 100644 hosts/iroha/sshd_config create mode 100644 hosts/moyo/fstab create mode 100644 hosts/moyo/sshd_config delete mode 100755 hosts/soy/Scripts/mount-code.sh create mode 100755 hosts/soy/Scripts/mount-samba.sh (limited to 'hosts') diff --git a/hosts/denpa/cgit/readme_in_summary.diff b/hosts/denpa/cgit/readme_in_summary.diff deleted file mode 100644 index 33756f9..0000000 --- a/hosts/denpa/cgit/readme_in_summary.diff +++ /dev/null @@ -1,152 +0,0 @@ -diff --git a/cmd.c b/cmd.c -index 0eb75b1..be316f4 100644 ---- a/cmd.c -+++ b/cmd.c -@@ -49,7 +49,7 @@ static void about_fn(void) - cgit_redirect(redirect, true); - free(currenturl); - free(redirect); -- } else if (ctx.repo->readme.nr) -+ } else if (0) - cgit_print_repo_readme(ctx.qry.path); - else if (ctx.repo->homepage) - cgit_redirect(ctx.repo->homepage, false); -diff --git a/ui-shared.c b/ui-shared.c -index baea6f2..6b01d08 100644 ---- a/ui-shared.c -+++ b/ui-shared.c -@@ -1078,7 +1078,7 @@ void cgit_print_pageheader(void) - - html("\n"); - } - --void cgit_print_summary(void) --{ -- int columns = 3; -- -- if (ctx.repo->enable_log_filecount) -- columns++; -- if (ctx.repo->enable_log_linecount) -- columns++; -- -- cgit_print_layout_start(); -- html("
\n"); - if (ctx.env.authenticated && ctx.repo) { -- if (ctx.repo->readme.nr) -+ if (0) - reporevlink("about", "about", NULL, - hc("about"), ctx.qry.head, NULL, - NULL); -diff --git a/ui-summary.c b/ui-summary.c -index 947812a..faf943e 100644 ---- a/ui-summary.c -+++ b/ui-summary.c -@@ -40,31 +40,6 @@ static void print_url(const char *url) - html("
"); -- cgit_print_branches(ctx.cfg.summary_branches); -- htmlf("", columns); -- cgit_print_tags(ctx.cfg.summary_tags); -- if (ctx.cfg.summary_log > 0) { -- htmlf("", columns); -- cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, -- NULL, NULL, 0, 0, 0); -- } -- urls = 0; -- cgit_add_clone_urls(print_url); -- html("
 
 
"); -- cgit_print_layout_end(); --} -- - /* The caller must free the return value. */ - static char* append_readme_path(const char *filename, const char *ref, const char *path) - { -@@ -99,25 +74,11 @@ static char* append_readme_path(const char *filename, const char *ref, const cha - return full_path; - } - --void cgit_print_repo_readme(const char *path) -+static void print_readme_file(const char *path) - { -- char *filename, *ref, *mimetype; -+ char *filename, *ref; - int free_filename = 0; - -- mimetype = get_mimetype_for_filename(path); -- if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { -- ctx.page.mimetype = mimetype; -- ctx.page.charset = NULL; -- cgit_print_plain(); -- free(mimetype); -- return; -- } -- free(mimetype); -- -- cgit_print_layout_start(); -- if (ctx.repo->readme.nr == 0) -- goto done; -- - filename = ctx.repo->readme.items[0].string; - ref = ctx.repo->readme.items[0].util; - -@@ -125,7 +86,7 @@ void cgit_print_repo_readme(const char *path) - free_filename = 1; - filename = append_readme_path(filename, ref, path); - if (!filename) -- goto done; -+ return; - } - - /* Print the calculated readme, either from the git repo or from the -@@ -142,6 +103,52 @@ void cgit_print_repo_readme(const char *path) - html(""); - if (free_filename) - free(filename); -+} -+ -+void cgit_print_summary(void) -+{ -+ int columns = 3; -+ -+ if (ctx.repo->enable_log_filecount) -+ columns++; -+ if (ctx.repo->enable_log_linecount) -+ columns++; -+ -+ cgit_print_layout_start(); -+ html(""); -+ cgit_print_branches(ctx.cfg.summary_branches); -+ htmlf("", columns); -+ cgit_print_tags(ctx.cfg.summary_tags); -+ if (ctx.cfg.summary_log > 0) { -+ htmlf("", columns); -+ cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, -+ NULL, NULL, 0, 0, 0); -+ } -+ urls = 0; -+ cgit_add_clone_urls(print_url); -+ html("
 
 
"); -+ if (ctx.repo->readme.nr) -+ print_readme_file(ctx.qry.path); -+ cgit_print_layout_end(); -+} -+ -+void cgit_print_repo_readme(const char *path) -+{ -+ char *mimetype = get_mimetype_for_filename(path); -+ if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { -+ ctx.page.mimetype = mimetype; -+ ctx.page.charset = NULL; -+ cgit_print_plain(); -+ free(mimetype); -+ return; -+ } -+ free(mimetype); -+ -+ cgit_print_layout_start(); -+ if (ctx.repo->readme.nr == 0) -+ goto done; -+ -+ print_readme_file(path); - - done: - cgit_print_layout_end(); diff --git a/hosts/denpa/cgit/readme_in_summary_no_about.diff b/hosts/denpa/cgit/readme_in_summary_no_about.diff new file mode 100644 index 0000000..73267e0 --- /dev/null +++ b/hosts/denpa/cgit/readme_in_summary_no_about.diff @@ -0,0 +1,154 @@ +diff --git a/cmd.c b/cmd.c +index 0eb75b1..be316f4 100644 +--- a/cmd.c ++++ b/cmd.c +@@ -49,7 +49,7 @@ static void about_fn(void) + cgit_redirect(redirect, true); + free(currenturl); + free(redirect); +- } else if (ctx.repo->readme.nr) ++ } else if (0) + cgit_print_repo_readme(ctx.qry.path); + else if (ctx.repo->homepage) + cgit_redirect(ctx.repo->homepage, false); +diff --git a/ui-shared.c b/ui-shared.c +index 6fae72d..c5b609a 100644 +--- a/ui-shared.c ++++ b/ui-shared.c +@@ -1082,7 +1082,7 @@ void cgit_print_pageheader(void) + + html("\n"); + } + +-void cgit_print_summary(void) +-{ +- int columns = 3; +- +- if (ctx.repo->enable_log_filecount) +- columns++; +- if (ctx.repo->enable_log_linecount) +- columns++; +- +- cgit_print_layout_start(); +- html("
\n"); + if (ctx.env.authenticated && ctx.repo) { +- if (ctx.repo->readme.nr) ++ if (0) + reporevlink("about", "about", NULL, + hc("about"), ctx.qry.head, NULL, + NULL); +diff --git a/ui-summary.c b/ui-summary.c +index 947812a..23c07aa 100644 +--- a/ui-summary.c ++++ b/ui-summary.c +@@ -40,31 +40,6 @@ static void print_url(const char *url) + html("
"); +- cgit_print_branches(ctx.cfg.summary_branches); +- htmlf("", columns); +- cgit_print_tags(ctx.cfg.summary_tags); +- if (ctx.cfg.summary_log > 0) { +- htmlf("", columns); +- cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, +- NULL, NULL, 0, 0, 0); +- } +- urls = 0; +- cgit_add_clone_urls(print_url); +- html("
 
 
"); +- cgit_print_layout_end(); +-} +- + /* The caller must free the return value. */ + static char* append_readme_path(const char *filename, const char *ref, const char *path) + { +@@ -99,25 +74,11 @@ static char* append_readme_path(const char *filename, const char *ref, const cha + return full_path; + } + +-void cgit_print_repo_readme(const char *path) ++static void print_readme_file(const char *path) + { +- char *filename, *ref, *mimetype; ++ char *filename, *ref; + int free_filename = 0; + +- mimetype = get_mimetype_for_filename(path); +- if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { +- ctx.page.mimetype = mimetype; +- ctx.page.charset = NULL; +- cgit_print_plain(); +- free(mimetype); +- return; +- } +- free(mimetype); +- +- cgit_print_layout_start(); +- if (ctx.repo->readme.nr == 0) +- goto done; +- + filename = ctx.repo->readme.items[0].string; + ref = ctx.repo->readme.items[0].util; + +@@ -125,7 +86,7 @@ void cgit_print_repo_readme(const char *path) + free_filename = 1; + filename = append_readme_path(filename, ref, path); + if (!filename) +- goto done; ++ return; + } + + /* Print the calculated readme, either from the git repo or from the +@@ -142,6 +103,54 @@ void cgit_print_repo_readme(const char *path) + html(""); + if (free_filename) + free(filename); ++} ++ ++void cgit_print_summary(void) ++{ ++ int columns = 3; ++ ++ if (ctx.repo->enable_log_filecount) ++ columns++; ++ if (ctx.repo->enable_log_linecount) ++ columns++; ++ ++ cgit_print_layout_start(); ++ html(""); ++ cgit_print_branches(ctx.cfg.summary_branches); ++ htmlf("", columns); ++ cgit_print_tags(ctx.cfg.summary_tags); ++ if (ctx.cfg.summary_log > 0) { ++ htmlf("", columns); ++ cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, ++ NULL, NULL, 0, 0, 0); ++ } ++ urls = 0; ++ cgit_add_clone_urls(print_url); ++ html("
 
 
"); ++ if (ctx.repo->readme.nr) ++ print_readme_file(ctx.qry.path); ++ cgit_print_layout_end(); ++} ++ ++void cgit_print_repo_readme(const char *path) ++{ ++ char *mimetype; ++ ++ mimetype = get_mimetype_for_filename(path); ++ if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { ++ ctx.page.mimetype = mimetype; ++ ctx.page.charset = NULL; ++ cgit_print_plain(); ++ free(mimetype); ++ return; ++ } ++ free(mimetype); ++ ++ cgit_print_layout_start(); ++ if (ctx.repo->readme.nr == 0) ++ goto done; ++ ++ print_readme_file(path); + + done: + cgit_print_layout_end(); diff --git a/hosts/denpa/git/git-config b/hosts/denpa/git/git-config new file mode 100644 index 0000000..00eb9e3 --- /dev/null +++ b/hosts/denpa/git/git-config @@ -0,0 +1,3 @@ +[init] + defaultBranch = master + templatedir = /mnt/git//.git-template diff --git a/hosts/denpa/git/git-template.zip b/hosts/denpa/git/git-template.zip new file mode 100644 index 0000000..4ade69c Binary files /dev/null and b/hosts/denpa/git/git-template.zip differ diff --git a/hosts/iroha/fstab b/hosts/iroha/fstab new file mode 100644 index 0000000..3a5a64e --- /dev/null +++ b/hosts/iroha/fstab @@ -0,0 +1,10 @@ +/dev/iroha-vg0/root / ext4 noatime 0 1 +UUID="0170-0D7B" /boot vfat defaults,noatime 0 2 +/dev/iroha-vg0/swap none swap sw 0 0 + +UUID="e339ba64-d4ee-44e1-856a-80812fd72960" /mnt/hdd ext4 noatime 0 2 +UUID="88a11ddb-a1ef-4953-bc27-39e358e4c1c4" /mnt/ssd ext4 noatime 0 2 + +tmpfs /var/tmp/portage tmpfs size=16G,uid=portage,gid=portage,mode=775 0 0 + +#hugetlbfs /hugepages hugetlbfs mode=1770,gid=78 0 0 diff --git a/hosts/iroha/new_desktop.txt b/hosts/iroha/new_desktop.txt new file mode 100644 index 0000000..d492765 --- /dev/null +++ b/hosts/iroha/new_desktop.txt @@ -0,0 +1,49 @@ +== Essential Packages +dosfstools +glibc -multiarch, muslc +https://wiki.gentoo.org/wiki/Gentoo_Binary_Host_Quickstart + +== Ideas for a "Stable" Feeling System +(Ignoring the obvious factor of OS stability) +=== Hardware +Minimize USB finickery +Monitor flicker +Easy monitor source switching +HID latency +No wireless +Solid keyboard +Minimize/Eliminate fan noise +No audio noise + +=== Software +No container BS +Well kept working directory and easy backups +Seperate system for gaming + +== Notes +https://wiki.gentoo.org/wiki/LTO +https://musl.libc.org/ +https://www.intel.com/content/www/us/en/products/sku/53427/intel-core-i32120t-processor-3m-cache-2-60-ghz/specifications.html +https://community.intel.com/cipcp26785/attachments/cipcp26785/desktop-boards/876/1/DH77DF_TechProdSpec04.pdf + +== Shopping +PSU https://www.quietpcusa.com/Streacom-90W-nanoPSU-and-ACDC-adapter-block?ItemId=3398696 +Case https://www.quietpcusa.com/streacom-db1-fanless-case +SSD https://www.newegg.com/western-digital-red-sa500-500gb/p/N82E16820250122?Item=9SIAAY9KGJ2444&cm_sp=product-_-from-price-options +SSD https://www.newegg.com/samsung-500gb-870-evo-series-sata/p/N82E16820147792 + +=== Acquired +CPU https://www.ebay.com/itm/176997759085 +MB https://www.ebay.com/itm/256822587988 +Ram https://www.ebay.com/itm/226244059510 + +=== Peripherals +https://www.ebay.com/itm/335297968303 +https://www.startech.com/en-us/usb-hubs/5g4aibs-usb-hub-na +https://www.pckeyboard.com/page/product/UNI0416 +https://www.amazon.com/Realforce-Topre-Bluetooth-Mechanical-Keyboard/dp/B09VPCZWR5 +https://mechanicalkeyboards.com/products/topre-realforce-r2-ivory +https://www.amazon.co.jp/-/en/HP-A3mk2-Headphone-Amplifier-Supports-Resolution/dp/B0C2Y66NGN +https://www.amazon.co.jp/-/en/Semi-Open-Dynamic-Headphones-T60RPmk2-Diaphragm/dp/B0F4WLPD7T + +// vim: set syntax=asciidoc: diff --git a/hosts/iroha/sshd_config b/hosts/iroha/sshd_config new file mode 100644 index 0000000..91fe201 --- /dev/null +++ b/hosts/iroha/sshd_config @@ -0,0 +1,7 @@ +PermitRootLogin no +PubkeyAuthentication yes +PasswordAuthentication no +PermitEmptyPasswords no +KbdInteractiveAuthentication no +Subsystem sftp /usr/lib64/misc/sftp-server +Include "/etc/ssh/sshd_config.d/*.conf" diff --git a/hosts/moyo/fstab b/hosts/moyo/fstab new file mode 100644 index 0000000..29b6c66 --- /dev/null +++ b/hosts/moyo/fstab @@ -0,0 +1,7 @@ +/dev/moyo-vg0/root / ext4 noatime 0 1 +UUID="879D-5154" /boot vfat defaults,noatime 0 2 +/dev/moyo-vg0/swap none swap sw 0 0 + +tmpfs /var/tmp/portage tmpfs size=6G,uid=portage,gid=portage,mode=775 0 0 + +#hugetlbfs /hugepages hugetlbfs mode=1770,gid=100 0 0 diff --git a/hosts/moyo/samba/smb.conf b/hosts/moyo/samba/smb.conf index 5781f4f..8a928a0 100644 --- a/hosts/moyo/samba/smb.conf +++ b/hosts/moyo/samba/smb.conf @@ -10,21 +10,20 @@ log file = /var/log/samba/log.%m max log size = 50 passdb backend = tdbsam - allow insecure wide links = yes + allow insecure wide links = no kernel oplocks = yes - socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=32768 SO_SNDBUF=32768 getwd cache = true acl allow execute always = yes ea support = yes store dos attributes = yes [samba] - comment = code + comment = sharing with windows path = /srv/nfs/samba valid users = andrew guest ok = no browseable = yes writable = yes public = no - follow symlinks = yes - wide links = yes + follow symlinks = no + wide links = no diff --git a/hosts/moyo/sshd_config b/hosts/moyo/sshd_config new file mode 100644 index 0000000..91fe201 --- /dev/null +++ b/hosts/moyo/sshd_config @@ -0,0 +1,7 @@ +PermitRootLogin no +PubkeyAuthentication yes +PasswordAuthentication no +PermitEmptyPasswords no +KbdInteractiveAuthentication no +Subsystem sftp /usr/lib64/misc/sftp-server +Include "/etc/ssh/sshd_config.d/*.conf" diff --git a/hosts/sofue/configuration.nix b/hosts/sofue/configuration.nix index 572034e..c85e81a 100644 --- a/hosts/sofue/configuration.nix +++ b/hosts/sofue/configuration.nix @@ -11,8 +11,8 @@ in rec { ../../nix/user.nix ../../nix/bluetooth.nix ../../nix/email.nix - ../../nix/amdgpu.nix - #../../nix/intel.nix + #../../nix/amdgpu.nix + ../../nix/intel.nix ../../nix/gaming.nix ../../nix/steam.nix ../../nix/virtualisation.nix @@ -59,12 +59,12 @@ in rec { footer-offset = 0; }; monitors = { + monitor1 = "DP-2"; + monitor2 = "HDMI-A-3"; + monitor3 = "DP-1"; #monitor1 = "DP-1"; - #monitor2 = "HDMI-A-1"; - #monitor3 = "HDMI-A-3"; - monitor1 = "DP-1"; - monitor2 = "DP-2"; - monitor3 = "HDMI-A-1"; + #monitor2 = "DP-2"; + #monitor3 = "HDMI-A-1"; }; }; diff --git a/hosts/soy/Scripts/all.sh b/hosts/soy/Scripts/all.sh index b08eab1..d99e2fa 100755 --- a/hosts/soy/Scripts/all.sh +++ b/hosts/soy/Scripts/all.sh @@ -1,4 +1,4 @@ #! /usr/bin/env sh -./mount-code.sh +./mount-samba.sh ./set-keyboard.sh ./disable-keybinds.sh diff --git a/hosts/soy/Scripts/mount-code.sh b/hosts/soy/Scripts/mount-code.sh deleted file mode 100755 index 928c65e..0000000 --- a/hosts/soy/Scripts/mount-code.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -sudo mount -t nfs4 -o rw,bg,hard,fsc,proto=tcp,timeo=600,retrans=2,nfsvers=4,minorversion=2 192.168.1.206:/srv/nfs/c /home/andrew/c diff --git a/hosts/soy/Scripts/mount-samba.sh b/hosts/soy/Scripts/mount-samba.sh new file mode 100755 index 0000000..63ca111 --- /dev/null +++ b/hosts/soy/Scripts/mount-samba.sh @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +sudo mount -t nfs4 -o rw,bg,hard,fsc,rsize=32768,wsize=32768,tcp,timeo=600,nfsvers=4,minorversion=2 192.168.1.206:/srv/nfs/samba /home/andrew/samba -- cgit v1.2.3-101-g0448