QNAP

Retaining mounted USB-disk locations on QNAP reboot
https://forum.qnap.com/viewtopic.php?f=25&p=636810#p636810

raid 5 failed after disk swap
https://forum.qnap.com/viewtopic.php?f=25&t=135753

Drive failure while rebuilding
https://forum.qnap.com/viewtopic.php?f=25&t=122300

Changing shell prompt and title of PuTTY
.profile
export PS1=”\[\e]2;\u@\H:\w\a\[\e[32;1m\][\W #] \[\e[0m\]”

My posts:
https://forum.qnap.com/search.php?author_id=190665&sr=posts

PHP

How to Convert MySQL to MySQLi PHP Code to Upgrade to PHP7 Doing the PHP MySQL MySQLi Migration

https://www.phpclasses.org/blog/package/9199/post/3-Smoothly-Migrate-your-PHP-Code-using-the-Old-MySQL-extension-to-MySQLi.html

This is my (very rough) method, search and replace in all .php and .inc files using Perl. To re-use my code, you HAVE to make modifications and take a backup of every .php and .inc file in case somwthing goes wrong.

I converted one project at a time, these commands were used for my Amiga user’s database, so some commands will reflect specific changes/searches I did in the code to find lines to change, I also did some mistakes and corrected those. Read the commands before you try these on your code:

find . -type f -name '*.php' -exec grep -l mysql_numrows {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_numrows|mysqli_num_rows|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_num_rows|mysqli_num_rows|g' {} \;

find . -type f -name '*.php' -exec perl -pi -e 's|mysql_selectdb|mysqli_select_db|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_select_db|mysqli_select_db|g' {} \;
find . -type f -name '*.php' -exec grep mysqli_select_db {} \;
#
# Change to match your database name and the MySQL connection link (db name and calling parameters found above)
# Using mysql_select_db, the MySQL link identifier was optional, and sent as the second parameter
#  with mysqli_select_db it is required as a first parameter
#
find . -type f -name '*.php' -exec grep 'db("minimig_reg",\$link' {} \;
find . -type f -name '*.php' -exec grep 'db("minimig_reg")' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|db\("minimig_reg",\$link|db\(\$link,"minimig_reg"|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|db\("minimig_reg"\)|db\(\$link,"minimig_reg"\)|g' {} \;

#
# mysqli_connect returns the link identifier and also requires the database name as the fourth parameter, add it manually after this replacement
#
find . -type f -name '*.php' -exec grep mysql_connect {} \; 
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_connect|mysqli_connect|g' {} \;  

find . -type f -name '*.php' -exec grep mysql_error {} \;    
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_error()|mysqli_error(\$link)|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysqli_error\(\$link\)\(\)|mysqli_error\(\$link\)|g' {} \;

find . -type f -name '*.php' -exec grep mysql_insert {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_insert_id\(\)|mysqli_insert_id\(\$link\)|g' {} \;

find . -type f -name '*.php' -exec grep mysql_query {} \;  
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_query\(|mysqli_query\(\$link,|g' {} \;

find . -type f -name '*.php' -exec perl -pi -e 's|mysql_fetch_assoc|mysqli_fetch_assoc|g' {} \;

find . -type f -name '*.php' -exec grep mysql_fetch_array {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_fetch_array\(\$result\)|mysqli_fetch_array\(\$result,MYSQLI_BOTH\)|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_fetch_array\(\$result_migs\)|mysqli_fetch_array\(\$result_migs,MYSQLI_BOTH\)|g' {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_fetch_array\(\$result_info\)|mysqli_fetch_array\(\$result_info,MYSQLI_BOTH\)|g' {} \;

find . -type f -name '*.php' -exec grep mysql_real_escape_string {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_real_escape_string\(|mysqli_real_escape_string\(\$link,|g' {} \;

find . -type f -name '*.php' -exec grep mysql_affected_rows {} \;
find . -type f -name '*.php' -exec perl -pi -e 's|mysql_affected_rows\(\)|mysqli_affected_rows\(\$link\)|g' {} \;

The include files (mostly the same command lines):

find . -type f -name '*.inc' -exec grep -l mysql_numrows {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_numrows|mysqli_num_rows|g' {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_num_rows|mysqli_num_rows|g' {} \;

find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_selectdb|mysqli_select_db|g' {} \;
find . -type f -name '*.inc' -exec grep '"minimig_reg",\$link' {} \;   
find . -type f -name '*.inc' -exec perl -pi -e 's|"minimig_reg",\$link|\$link,"minimig_reg"|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_connect {} \; 
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_connect|mysqli_connect|g' {} \;  

find . -type f -name '*.inc' -exec grep mysql_error {} \;    
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_error\(\)|mysqli_error\(\$link\)|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_insert {} \;  
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_insert_id\(\)|mysqli_insert_id\(\$link\)|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_query {} \;  
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_query\(|mysqli_query\(\$link,|g' {} \;

find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_fetch_assoc|mysqli_fetch_assoc|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_fetch_array {} \;  
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_fetch_array\(\$result\)|mysqli_fetch_array\(\$result,MYSQLI_BOTH\)|g' {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_fetch_array\(\$result_migs\)|mysqli_fetch_array\(\$result_migs,MYSQLI_BOTH\)|g' {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_fetch_array\(\$result_info\)|mysqli_fetch_array\(\$result_info,MYSQLI_BOTH\)|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_real_escape_string {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_real_escape_string\(|mysqli_real_escape_string\(\$link,|g' {} \;

find . -type f -name '*.inc' -exec grep mysql_affected_rows {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_affected_rows\(\)|mysqli_affected_rows\(\$link\)|g' {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|mysql_result|mysqli_result|g' {} \;

find . -type f -name '*.inc' -exec grep split {} \;
find . -type f -name '*.inc' -exec perl -pi -e 's|split\(|explode\(|g' {} \;
find . -type f -name '*.php' -exec grep split {} \;

Missing function mysqli_result (to replace mysql_result)

function mysqli_result($res,$row=0,$col=0){
    $numrows = mysqli_num_rows($res);
    if ($numrows && $row <= ($numrows-1) && $row >=0){
        mysqli_data_seek($res,$row);
        $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
        if (isset($resrow[$col])){
            return $resrow[$col];
        }
    }
    return false;
}

Amiga repairs and hardware hacks

Recapping the Amiga

Badcaps.net
Recapping the Amiga (John Hertell)
Who does your recapping? (AmigaWorld.net)
Amiga capacitor list
Commodore Amiga Recap Maps & Capacitor lists (tsb.space)

Amiga memory expansions, repairs and hardware mods

Amiga RAM Expansion A501 RTC Battery Replacement (Read desription first!)


Google search for 'amiga+500+1Mb+on+motherboard'
A500 rev6a chipRAM mods (1MB on motherboard)

Amiga CD32 – Trash to Treasure (RetroManCave)



GadgetUK

Commodore Amiga CD32 Pickup – Repair Part 1 (Not Reading Discs, Disc Not Spinning)

Solder Tutorial (Keith Noneya)

Amiga 500 With Battery Corroded RAM Card, how to replace corroded copper









Amiga floppy repairs

Amiga floppy repair (YouTube search)
Amiga 500 Plus – Trasig diskettstation?

Other links

Reusing the Amiga 2000 case for an Amiga 1200
Amiga 500 rev 3 teardown

Buffalo LS220 – BAMP – Buffalo Apache MySQL PHP

Apache (med PHP-stöd) och MySQL på Buffalo (LS220)

Fullt möjligt, men inte så snabbt.
Jag har på en av mina Buffalos även testat köra WordPress på LS220n, funkar fram till 5.1.1 med förinstallerad version av PHP. Från version 5.2 krävs PHP version 5.6 (jag kommer undersöka om det går att uppdatera php-cgi på Buffalon)

En förutsättning för att få det att fungera är att den är patchad för att tillåta root-inloggning via SSH:
Buffalo LS220 – root access och andra modifieringar

Nästa steg är att få igång en egen virtualhost på den förinstallerade (och tok-felkonfigurerade) Apache 2.2.14 som finns där:
Buffalo LS220 – apache web server
Apache får sitt PHP-stöd genom php-cgi, PHP versionen som är tillgänglig är 5.3.23

Sedan MySQL:
Buffalo LS220 – MySQL server

Övrig Buffalo information

Buffalo forum

Firmware uppdatering

Nyaste firmwaren finns här. Version 1.70 kom i slutet på januari 2018. I början på december 2019 varnade mina LS220s att det finns en ny firmware. 1.73 hade släppts, och timestamp på innehållet i arkivet är 2019-11-19. Mina NASar (och NASNavigator) har slutat att indikera att det finns ny firmware att installera, och jag kör 2020-01-01 fortfarande på 1.70.

Senaste firmware för LS220
Installationen är enkel. Ladda ner senaste versionen, packa upp och starta LSUpdater.exe
Programmet hittar själv de Buffalosar på ditt nät som behöver uppdateras.
Var beredd på att innehåll i /root kommer gå förlorat, likaså allt som är modifierat i filer som följer med systemet (många av modifieringarna nedan).

TFTP-återställning av LS220D

Ifall något går helt snett, eller om båda diskarna byts. Med tanke på hur kasst BuffaloOS är, så kanske det inte ens går byta en disk utan att återställa den.
Completely revocering from a bricked Buffalo Linkstation LS200

Källor

Den flersidiga tråden med de av andras och mina inlägg är källan till alla mina Buffalo-artiklar
Hacka Buffalo Linkstation LS220D (LS200, LS400)

Buffalo LS220 – MySQL server

MySQL server på Buffalo LS220

Testad upp till firmware 1.70 (14 sepember 2018)

En del av Buffalo LS220 – BAMP – Buffalo Apache MySQL PHP

Första gången (efter root-patchning)

MySQL 5.1.63 är förinstallerat med firmware 1.67 (säkert samma på äldre) men används inte till något (vad jag känner till).
För att databaserna inte ska gå förlorade är det en bra idé att lägga dom under ‘/mnt/array1’.

Börja med att kopiera konfigurationsfilen för MySQL från /usr/share/mysql:

cp /usr/share/mysql/my-small.cnf /etc/my.cnf

Lägg till ‘datadir’ och ‘pid-file’ under [mysqld] i /etc/my.cnf:

...
[mysqld]
port           = 3306
socket         = /tmp/mysql.sock
pid-file       = /tmp/mysql.pid
datadir        = /var/lib/mysql
...

Skapa uppdateringssäker lagringsplats för databaserna och länka

mkdir /mnt/array1/mysql
ln -s /mnt/array1/mysql /var/lib

Skapa grupp och användare för MySQL

addgroup -S mysql
adduser -S -s /bin/false  -G mysql -g "MySQL Server" -h /var/lib/mysql mysql

Skapa systemdatabas i /mnt/array1/mysql och sätt rootlösenord

mysql_install_db --user=mysql --datadir=/mnt/array1/mysql
/usr/share/mysql/mysql.server start
/usr/bin/mysqladmin -u root password 'new-password'

Kolla att det fungerar, och länka sen in start/stoppscripten

ln -s /usr/share/mysql/mysql.server /etc/rc.d/extensions.d/S70_mysql.server
ln -s /usr/share/mysql/mysql.server /etc/rc.d/extensions.d/K70_mysql.server

Efter uppdatering av firmware

/etc/passwd och /etc/group oförstörda (alltid nåt, det innebär att mysql-användaren finns kvar)

Kopiera /usr/share/mysql/my-small.cnf till /etc

cp /usr/share/mysql/my-small.cnf /etc/my.cnf

Lägg in ‘datadir’ och ‘pid-file’ i /etc/my.cnf

[mysqld]
port           = 3306
socket         = /tmp/mysql.sock
pid-file       = /tmp/mysql.pid
datadir        = /var/lib/mysql

Länka till /var/lib/mysql

ln -s /mnt/array1/mysql /var/lib

Starta:

/usr/share/mysql/mysql.server start

Länka in start/stoppscripten:

ln -s /usr/share/mysql/mysql.server /etc/rc.d/extensions.d/S70_mysql.server
ln -s /usr/share/mysql/mysql.server /etc/rc.d/extensions.d/K70_mysql.server

Buffalo LS220 – apache web server och PHP

Apache httpd och PHP på Buffalo LS220

Testad upp till firmware 1.70 (14 sepember 2018)

En del av Buffalo LS220 – BAMP – Buffalo Apache MySQL PHP

Apache httpd kommer förinstallerad på LS220. Riktigt kasst konfigurerad, och är tänkt att bara användas för webguiet. Bl.a. ligger en hel del av konfigurationen innästlad i ett <VirtualHost>-block, så aktiverar man de extra konfigurationsfilerna kommer det bli virtualhosts inne i virtualhost-blocket, vilket inte funkar särskilt bra.

Från root-patchad till httpd på en till port

HIttade en hel del i mitt grävande i filstrukturen på den när man väl följt instruktionerna för att kunna ta sig in på den via SSH

* Apache httpd (2.2) finns där för WebAccess. Konfiguration, binärfiler och innehåll ligger i en struktur under /usr/local/webaxs
* Under webaxs/bin finns en del blandade gamla binärer, bl.a en äldre version av perl
* Under webaxs/www ligger WebAccess guiet
* /var/www/webui innehåller det aktuella webbaserade admin-gränssnittet för konfiguration
* PHP 5.3.23 finns installerad, /usr/bin/php-cgi, konfiguration /etc/php.ini
* /www innehåller en hel del rester från Buffalos gamla webadmin (kanske nåt som används också, allt i helt normal Buffalo-stil)

Idén jag ville prova var att starta en PHP-hanterande webserver på port 8000. Har med vissa ful-lösningar runt Buffalos konstigheter fått igång den nu, och ser att den PHP-binär som finns där har rätt så mycket inkompilerat, bl.a stöd för curl, iconv och mysql, så den är inte helt oanvändbar.

Har stött på ett antal problem som jag gått runt:
* i Buffalos httpd.conf för WebAccess har dom lagt in konfigurationen för port 9000 där WebAccess körs direkt i httpd.conf, och dessutom på ett galet sätt – en stor del av huvudkonfigurationen har dom nästlat in i direktivet, så det går inte aktivera inkluderingen av “extra/httpd-vhosts.conf” då det isåfall skulle innebära en <VirtualHost> inne i <VirtualHost>
* Alternativet att lägga in include-raden i slutet på httpd.conf fungerar – men bara tills man ändrar på nåt i konfigurationen via webadmin – för då återställs httpd.conf till den vanliga, trasiga (och det innebär att det inte är nån idé att bygga den på rätt sätt heller), och httpd för WebAccess startas om (så vhosten slutar fungera direkt)

Så här gjorde jag (minimalt för att få det att fungera)

WebAccess måste aktiveras från Buffalons startsida eller “File sharing / Web Access” på den vanliga konfigurationen (det är den del som förstör konfigurationsfilen så att även include hamnar inuti ett virtualhost-block).
Skapa /mnt/array1/web på lämpligt sätt (alltså en share med namnet “web”), och ställ delning och rättigheter som du vill ha det
Skapa ”vhost1” inne i ”web” på valfritt sätt.
Skapa ”logs” inne i ”web” på valfritt sätt (för loggfiler, vi vill inte ha dom åtkomliga för en besökare från utsidan)

Gör en minimal PHP-fil för att kunna testa att det fungerar:
/mnt/array1/web/vhost1/index.php
En minimal testfil som visar information om PHP och allt som är konfigurerat där

<?php
phpinfo();
?>

httpd-vhosts.conf
För att göra så lite fel som möjligt, så lägger jag min virtualhost, port 8000 i “httpd-vhosts.conf”
Jag sparar filen i ‘/mnt/array1/web’ för att den inte ska gå förlorad vid en uppdatering av firmware.

Listen 8000
NameVirtualHost *:8000

<VirtualHost *:8000>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/mnt/array1/web/vhost1"
ServerName vhost1.example.com
DirectoryIndex index.php index.html

ErrorLog "/mnt/array1/web/logs/vhost1-error.log"
CustomLog "/mnt/array1/web/logs/vhost1-access.log" common

ScriptAlias /local-bin /usr/bin
AddHandler application/x-httpd-php5 php
Action application/x-httpd-php5 /local-bin/php-cgi
</VirtualHost>

Ta bort skräp-httpd-vhosts.conf (default, med exempel), länka in den nya

rm /usr/local/webaxs/apache/conf/extra/httpd-vhosts.conf
ln -s /mnt/array1/web/httpd-vhosts.conf /usr/local/webaxs/apache/conf/extra/

Lägg till följande rad sist i httpd.conf
Include conf/extra/httpd-vhosts.conf

echo >>/usr/local/webaxs/apache/conf/httpd.conf "Include conf/extra/httpd-vhosts.conf"

Starta om webservern

/usr/local/webaxs/apache/bin/apachectl restart

Prova om det funkar
Skriv in din NASs IP-adress i URL-rutan i webläsaren, port 8000 (:8000 på slutet)

Förbered för enklare återställning vid uppdatering:
/mnt/array1/web/link-httpd-vhost-conf.sh (chmod 700)

#!/bin/sh
rm /usr/local/webaxs/apache/conf/extra/httpd-vhosts.conf
ln -s /mnt/array1/web/httpd-vhosts.conf /usr/local/webaxs/apache/conf/extra/
/usr/local/webaxs/apache/bin/apachectl restart

Lägg till i /mnt/array1/buffalo_fix.sh

# check that configuration has not been reset
if ! cat /usr/local/webaxs/apache/conf/httpd.conf | grep '^Include conf/extra/httpd-vhosts.conf' > /dev/null 2>&1; then
  echo >>/usr/local/webaxs/apache/conf/httpd.conf "Include conf/extra/httpd-vhosts.conf"
fi

# Restart Apache if not listening to port 8000
exec 6<>/dev/tcp/127.0.0.1/8000 2>&1>/dev/null || /usr/local/webaxs/apache/bin/apachectl restart

Scriptet kollar om det finns en rad i httpd.conf som börjar med “Include conf/extra…”. Ifall raden är borta, så läggs den dit igen och httpd startas om.
På det här sättet blir det ett avbrott på högst 5 minuter efter det att konfigurationen skrivs över..

Efter att ha uppdaterat firmware

Efter en firmware-uppdatering så förstörs en del av konfigurationen i sedvanlig Buffalo-stil.

Länka tillbaks ‘httpd-vhosts.conf’ från ‘/mnt/array1/web’ genom att köra scriptet som skapades för det:

/mnt/array1/web/link-httpd-vhost-conf.sh

Lägg tillbaks include-raden i httpd.conf

echo >>/usr/local/webaxs/apache/conf/httpd.conf "Include conf/extra/httpd-vhosts.conf"

Starta om webservern

/usr/local/webaxs/apache/bin/apachectl restart

Kolla att det fungerar.

Scriptet som är inlagt i cron-jobbet sedan tidigare ska både lägga till vhost konfiguration och starta om httpd ifall det behövs. Har du gjort enligt mina tidigare instruktioner är det enda som behöver göras efter uppdatering att länka tillbaka din httpd-vhosts.conf till ‘/usr/local/webaxs/apache/conf/extra/’.

Buffalo LS220 – root access och andra modifieringar

Hur man fixar root-access på Buffalo LS220D

Testad upp till firmware 1.78 (18 januari 2022)

En del av Buffalo LS220 – BAMP – Buffalo Apache MySQL PHP
Om acp_commander vägrar fungera – stäng temporärt av brandväggen på datorn som används att patcha med:

Starting authentication procedure...
Sending Discover packet...
A SocketTimeoutException usually indicates bad firewall settings.
Check especially for *UDP* port 22936 and make sure that the connection to your LS is working.
ERROR: Exception: SocketTimeoutException (Receive timed out) [ACP Send/Receive (Packet:8020 = ACP_Discover)]

Från ny till root-access

Starta och ställ in lösenord för ‘admin’
Uppdatera firmware om det finns någon ny
Aktivera default-sharen “share” (‘advanced’ från startsidan, sedan ‘folder setup’, read/write och stäng av ‘folder restrictions’ att börja med)
Du behöver fungerande java installerat på datorn som patchningen ska ske från (java-kommandot i path eller inte, bara du vet var det är).

Nytt för i år är att nas-central.org är trasigt. Har du gjort det här tidigare, så kanske du har filerna nedladdade och sparade nånstans. Annars kan du ta mina sparade filer…
https://tech.webit.nu/Buffalo/

ACP_commander är det javaprogram som används för patchningen, finns att hämta på acp_commander.jar

Från datorn att patcha ifrån:

java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "(echo newrootpass;echo newrootpass)|passwd"
java -jar acp_commander.jar -t 192.168.0.10 -o -addons
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "sed -i 's/SFTP=0/SFTP=1/g' /etc/nas_feature"
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "sed -i 's/#PermitRootLogin/PermitRootLogin/g' /etc/sshd_config"
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "/etc/init.d/sshd.sh restart"

Om det av någon anledning efter detta inte fungerar att logga in via SSH, kolla att du i kommandona ovan ersatt “Password” med ditt admin-lösenord, “newrootpass” med det lösenord du vill använda för root användaren och IP-adressen 192.168.0.10 med IP till din LS220.

Skulle det ändå inte fungera, ladda ner addons.tar, lägg filen i samma låda som acp_commander ligger i. Kör sedan alla kommandona på nytt.

Behålla root-access efter omstart

Detta görs inloggad som ‘root’ på Buffalon. Medföljande texteditor är ‘vi’.

Eftersom Buffalons operativsystem är så trasigt som det är, så förstör den inställningarna vid omstart, eller om man ändrar i konfigurationen via web-gui, eller om man kopplar in en USB-disk eller ett USB-minne i den.

Lösningen är att köra ett script som lagar de inställningar BuffaloOS har sönder av kända och okända anledningar. Skapa files /mnt/array1/buffalo_fix.sh med följande innehåll:

#!/bin/sh
root_entry='ROOT-LINE-FROM-ETC-SHADOW'

# make sure root password has not changed
if ! cat /etc/shadow | grep $root_entry > /dev/null 2>&1; then
  sed -i 's|root:.*::::::|'"$root_entry"'|' /etc/shadow
fi

# reset SUPPORT_SFTP if need to
if ! cat /etc/nas_feature | grep SFTP=1 > /dev/null 2>&1; then
  sed -i 's/SFTP=0/SFTP=1/g' /etc/nas_feature
fi

# Restart sshd if broken (which it will be after mounting/unmounting USB, or changning anything in web admin
exec 6<>/dev/tcp/127.0.0.1/22 2>&1>/dev/null || /etc/init.d/sshd.sh restart

Glöm inte att ersätta ‘ROOT-LINE-FROM-ETC-SHADOW’ med root-raden i /etc/shadow och sedan köra chmod 700 på scriptet.

Jag har grävt fram det ställe jag tyckte det passade minst dåligt att köra scriptet ifrån:
/etc/init.d/syslog_user_setup.sh som körs var 5:e minut av /etc/cron/cron.d/logrotate via cron.

Lägg in som rad 2 i /etc/init.d/syslog_user_setup.sh (alltså på den tomma raden, gör en ny tom under om du vill):

/mnt/array1/buffalo_fix.sh

Början av filen ska efter modifiering se ut så här:

#!/bin/sh
/mnt/array1/buffalo_fix.sh

. /etc/melco/info
. /etc/nas_feature
. /usr/local/lib/libsys

TARGET_LOGS="linkstation.log file.smb xferlog"
LOG_FOLDER_NAME="system_log"
LOG_FOLDER=${syslog_user_folder}/${LOG_FOLDER_NAME}

Om du inte missat nånting nu, så ska du kunna testa att scriptet gör det det ska genom att ändra lösenord för ‘root’.
Kolla att klockan inte är för nära en jämn 5-minut först, så du får tid att testa.
Då du ändrat lösenordet, logga in som ‘root’ med det nya lösenordet i ett annat terminalfönster.
Vänta tills 5-minuten inträffat och gör ett till försök med det tidigare satta lösenordet.

Från uppdaterad till root-access

Efter en uppdatering slutar inloggningen via SSH att fungera. Du kommer också förlora eventuella filer sparade i /root, så låt bli att göra det. Saker du är rädd om ska alltid läggas på lämpligt ställe (någon share) under /mnt/array1.
Vill du ändå riskera inställningar och ev förlorad root-access så görs det fortfarande (aug 2023) nya versioner av firmware att ladda ner:
https://www.buffalotech.com/support/downloads/linkstation-200-series

Från datorn att patcha ifrån:

java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "(echo newrootpass;echo newrootpass)|passwd"
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "sed -i 's/SFTP=0/SFTP=1/g' /etc/nas_feature"
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "sed -i 's/#PermitRootLogin/PermitRootLogin/g' /etc/sshd_config"
java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw Password -c "/etc/init.d/sshd.sh restart"

(dvs. allt behöver göras om utom raden med ‘-addons’)

Efter det här ska det gå logga in som ‘root’ för att göra ändringen i /etc/init.d/syslog_user_setup.sh
Som tidigare, lägg bara till ‘/mnt/array1/buffalo_fix.sh’ på den tomma rad 2 i filen, så ska det inte bli något längre avbrott på åtkomsten än 5 minuter.

Om det inte fungerar (connection refused)

Skulle det inte fungera att SSH:a in efter att du följt guiden, prova då köra ‘sshd.sh restart’ en gång till.
Jag har några gånger fått det här svaret från acp_commander:

Using random connID value = CEDA5122F200
Using target:   BUFFALO-1/192.168.0.241
Starting authentication procedure...
Sending Discover packet...
Found:  BUFFALO-1 (/192.168.0.241)      LS220D(SANJO) (ID=004813)       mac: 74:03:BD:0C:80:C7  Firmware=  1.670        Key=37BA1BC0
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
A SocketTimeoutException usually indicates bad firewall settings.
Check especially for *UDP* port 22936 and make sure that the connection to your LS is working.
ERROR: Exception: SocketTimeoutException (Receive timed out) [ACP Send/Receive (Packet:8A10 = ACP_CMD)]

‘sshd.sh restart’ ska, om det fungerar ge ett svar liknande det här:

Using random connID value = B0EC8F0D4B6D
Using target:   BUFFALO-1/192.168.0.241
Starting authentication procedure...
Sending Discover packet...
Found:  BUFFALO-1 (/192.168.0.241)      LS220D(SANJO) (ID=004813)       mac: 74:03:BD:0C:80:C7  Firmware=  1.670        Key=747CA520
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>/etc/init.d/sshd.sh restart
load_info ItemValue = off
LoadConfFileStringEx:key=[ad_dns] not found in /etc/melco/info.
LoadConfFileOnOffEx:key=[info_visible] not found in /etc/melco/info.
LoadConfFileOnOffEx:key=[recycle_admin] not found in /etc/melco/info.
file:/etc/sftponly_config
userinfo finished
groupname guest
groupname admin
groupname hdusers
file:/etc/pam.d/sshd

Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

Jag har vid den senaste uppdateringen av alla mina LS220 upptäct att “sshd restart” fungerar först på 3e försöket.

Amiga (and other) misc links and videos

Amiga News

Amiga Distro Watch (french or something, some news/changelogs on english)

Amiga Emulation

SAE (Scripted Amiga Emulator)
Amiga emulator written 100% in HTML5 and Javascript
https://github.com/naTmeg/ScriptedAmigaEmulator
https://scriptedamigaemulator.net/
https://web.archive.org/web/20231029104551/https://amiga.oszx.co/

Amiga Blogs

There are millions.. Here are just a few I have added after closing some open tabs..

Lyonsden Blog

Upgrading my Amiga A500 to 1MB Chip RAM (1MB Chip RAM Mod)
My Vampire Card has arrived!
Installing the Vampire V500 V2+ in my Amiga 500
Adding an SD Card Slot and HDMI port to an Amiga 500
Installing Amiga OS 3.1.4 – Part 1 (Obtaining the Disks)
Installing Amiga OS 3.1.4 – Part 2 (Fitting a CF Card & Kickstart 3.1.4 ROMS)
My Amiga Setup

retrohax.net

Amiga 500 – mods
Installing a Vampire inside Amiga 500

Amiga Videos

http://amigavideo.net/
Youtube: AmigaStuffVids
Amiga Longplays (Recorded Amiga Games) click the Backup link!

Amiga 1000



KickWork thread on amiga.org

Amiga PD collections

Page with links to indexes of many PD series
Archived page about Fred Fish

Retro systems file archives

Retro Computer Scene (searchengine for retro files and more)
http://arnold.c64.org/

https://computerarchive.org/ (dead site)
http://192.168.0.246:8000/files/ (my local mirror, web/vhost1/computerarchive.org, 302GB)

the-eye.eu:/books/computerarchive.org (most of magazines from /files/computer/magazines/)

http://archive.computer/ (dead site)
Synology: /share/archive.computer/Amiga (my local mirror of most of the Amiga folder, 390GB)

https://amiga.archive.computer (dead site)
Synology: /homes/peo/archive.computer 2020 (my local mirror of what it looked like when it was resurrected – complete mirror of Amiga stuff, 152GB)

Google search, “site:archive.computer”

The Amiga-section of the-eye.eu

Retrocomputing Archive

Amiga Magazines

Total Amiga
Amiga Guiden (“#amiga guide magazine”) / AmigaMAD (Aminet – Freeware magazines)
AmigaGuiden (NO) / AmigaMAD (EN)
Komoda & Amiga plus
C&A Fan
K&A Plus (Zine menu for PDF back issues)

Recensioner av Commodore VIC20, VIC64, C128, PC10 och Amiga från Radio & Television/Elektronikvärlden
https://www.softwolves.pp.se/cbm/rt-ev-recension/

Books and documents

Amiga Source Preservation
Amiga Source Preservation – project page
Amiga Source Preservation – file repository

Retro Commodore – High quality scans of magazines and manuals for Commodore computers

Amiga 1000 origins (serial number question)
Amiga Book gallery
AmigaOS Hidden Messages
Big Book of Amiga Hardware

Amiga History

http://theamigamuseum.com/

Commodore History

Commodore: A Brief History (commodore.ca)

Commodore History series

The 8-Bit Guy







Amiga: The Quantum Leap

Part 1.1 – Before the Amiga Years

Part 1.2 – Designing the Amiga

Part 1.3 – Building the Amiga

Part 1.4 – Releasing the Amiga

Amiga Story | Nostalgia Nerd

Amiga Story Part 2 (The 90s) | Nostalgia Nerd

BBC Micro Live (1985) – Commodore Amiga Debut

Amiga History – Launch of Amiga
Interview with Bob Pariseau
Story of Commodore from the Computer Engineers’ Perspective

Vintage Computer Festival East (v9.1)

Part 1: Chuck Peddle
Part 2: Bil Herd Part 1 Part 2 Part 3
Part 3: The Amiga Years (Dave Haynie)

Bil Herd
Bill Herd and Leonard Tramiel (CommVEx v11 2015)
Interview with Bil Herd for Scene World Magazine

Vintage Computer Festival Midwest (VCFMW) 11 (2016)
Bil Herd: Tales From Inside Commodore (Life at Commodore, act II)

Chuck Peddle
Interview with Chuck Peddle for Scene World Magaine
Lecture and Presentation of the Victor 9000 Computer, by Chuck Peddle
VCF East 4.0: History of Commodore, Pt 1: Chuck Peddle (2007)
Oral History of Chuck Peddle, Computer History Museum (2014)

6502 CPU
History of MOS 6502 – Jason Dagit
Reverse Engineering the MOS 6502 CPU (en)

Jim Sachs
Jim Sachs (Amiga Graphics Archive)
Jim Sachs (Matt Chat 318-320)




Castle On The Cheap

Akreal8 (AmiKit 8 for real Amiga computers)


http://real.amiga.sk/

Podcasts

Retrodatorer – Ny podcast (bjoremanmelin)

https://www.retrodatorer.se/ny-podcast-pratar-amiga-beos-med-mera/
https://www.bjoremanmelin.se/podcast/avsnitt-1-alla-borde-ha-en-amiga/
https://www.bjoremanmelin.se/

Everything Amiga – podcast and more

https://www.everythingamiga.com/
https://www.everythingamiga.com/2018/02/amigos-podcast-episode-reference.html
https://ggather.com/boatofcar/amigospodcast
https://player.fm/series/amigos-everything-amiga-podcast/
https://anchor.fm/s/ee9137c/podcast/rss
Articles
Adventures with the Amiga 1000
Checkmate A1500 Plus – A500+ Build – Part 1
Checkmate A1500 Plus – A500+ Build – Part 2
Checkmate A1500 Plus – A500+ Build – Part 3
Amiga 2000
Amiga Successes: The story of the Amiga 2000
Amiga 2000 Weird Mouse Issues
Amiga 2000 with Gotek Floppy Drive Emulator and Second Floppy Disk Drive Installation
Multi Select ROM Amiga 2000
Another interesting Amiga 2000 to check out
Amiga 2000 Resurrection
Beige Beasts – Amiga 2000 Upgrades
Amiga 2000 Hard Drive Failure. Where to from here…
The Amiga 2000 Receives a New Hard Drive Controller and more
The Amiga 2000 gets a brand new CPU socket
Amiga 2000 Weird Booting Issue – What Could the Problem Be?

The Retro Hour – podcast

https://theretrohour.com/
https://theretrohour.com/amiga-megademos-and-parties-with-psychobudbrain-the-retro-hour-ep65/

Commodore / Amiga Users Ireland – podcast and more

http://amigausers.ie/

AMIGArama – podcast and more

https://amigarama.com/
AMIGArama at archive.org

Retropodden (norsk)

Floppy Days podcast

http://floppydays.libsyn.com/
https://player.fm/series/floppydays-vintage-computing-podcast/floppy-days-71-brian-bagnall-commodore-a-company-on-the-edge

10 Minute Amiga Retro Cast, videos
10 Minute Amiga Retro Cast, home page

Internet History Podcast

http://www.internethistorypodcast.com/

Indie Retro News
http://www.indieretronews.com/
Giana Sisters SE
http://www.indieretronews.com/2018/07/giana-sisters-special-edition-amiga.html

Amiga 1500

The Amiga 1500 Story | Commodore Vs Checkmate Digital
Amiga 1500 (2017-2018)

Amiga TOSEC, ADF, floppys and archiving in general

Floppy labels for Amiga OS and other software
(original site gone, link to archive.org copy)
GameBase Amiga 2.0 (EAB forum)
EAB file server (EAB forum)

Bamiga Sector One – The ADF collection

TOSEC

TOSEC forum
Google search – checking iso tosec without unpacking
SabreTools – DAT management tool with advanced editing and sorting features
Check if your .adf exists in TOSEC (uses steffest/ADF-reader and lclevy/ADFlib)
No-Intro

Extracting TOSEC archives

...-02/Collections# find . -type f -exec echo "rm '{}'" \; >cleanup
...-02/Collections# more cleanup
rm './C64CD'96/Commodore C64 - Collections - C64CD'96 (TOSEC-v2016-06-11_CM).zip'
rm './Tadpole/Commodore C64 - Collections - Tadpole (TOSEC-v2016-06-11_CM).zip'
rm './cleanup'
rm './Hornet/Commodore C64 - Collections - Hornet (TOSEC-v2014-10-01_CM).zip'
...
find . -type d -exec sh -c "cd '{}'; /opt/bin/unzip *zip" \;
...
sh ./cleanup

ROM-managers, how to check against TOSEC database

Why I don’t like RomVault (TOSEC Forum)
RomVault How To

Data preservation and forensics

Digital Archaeology and/or Forensics: Working with Floppy Disks from the 1980s
Born-Digital Bootcamp manual
EWF Tools

BitCurator

BitCurator
Getting started
BitCurator Quickstart
Releases on GitHub
Videos
ercm015 bitcurator accessioning disk images

KryoFlux

KryoFlux home
KryoFlux support forum
Installing KryoFlux in Windows 8 / 10
IMG file to write to FDD
Stream backup quality of 3,5″ drives
The Archivist’s Guide to KryoFlux [review] [github]
Project KryoFlux (guide)
Floppy Disk Format Identifer Tool
How to convert Kryoflux Stream Image (raw) to .scp
Floppy-Disk-Archiving

FluxEngine

http://cowlark.com/fluxengine/doc/building.html
https://github.com/davidgiven/fluxengine

Amiga Floppy readers

Using Arduino to read/write Amiga floppies

https://www.google.se/search?q=reading+amiga+floppy+arduino
https://www.google.se/search?q=+USB+Serial+ftdi+Converter+breakout+board
https://hackaday.com/2017/07/21/read-amiga-floppies-using-an-arduino/
http://amiga.robsmithdev.co.uk/

Greaseweazle

https://github.com/keirf/Greaseweazle

GoTek Floppy emulator (USB-stick)

Gotek manufacturer’s home
My Gotek page
GoTek SFR1M44-U100K USB Floppy Disk Emulator Review
Google search , SFR1M44-U100K + Amiga

Forum threads about GoTek and Amiga

EAB: FlashFloppy – new firmware for Gotek drives, open source
EAB: Gotek’s SELECTOR.ADF replacement
EAB: Best Gotek Firmware
EAB: Gotek Floppy emulators and Amiga computers now working together! 🙂
EAB: Gotek With HxC Firmware And File Selector – Truncation

FlashFloppy and related

Howto: flash a Gotek with no programmer
Keirf FlashFloppy
Keirf Disk-Utilities

GoTek with Cortex firmware

Transform the Gotek Floppy Emulator into an Amiga Floppy emulator
GOTEK Flashing (ikod.se)

GoTek with HxC2001 firmware

HxC Floppy Emulator download page (USB HxC Floppy Emulator)
https://hxc2001.free.fr/floppy_drive_emulator/index.html#Download_HxCFirmwareForGotek
Software store
HxC firmware for Gotek drive instructions
Create savedisk / Saving ADF/HFE on Gotek with HXC Firmware?
EAB: Gotek HxC and what to do?

Amiga ADF and file system info

The .ADF (Amiga Disk File) format FAQ
Amiga filesystems overview
Rob Northen – Amiga PDOS copy protection
Best way to archive Amiga floppies (amiga.org)
Amiga floppy imaging
EAB – Mounting ADF files on Amiga
ADFView – Accessing, creating and modifying content in AFDs on windows
adfExplorer: Import from and Export to Amiga Disk Files
Google search – Mount ADF on Linux
ADFScan – Virus scanner for ADF files

Floppy disk compression and transparent file compression

xDMS (decompress Amiga DMS disk files), multi-platform (Amiga, win, Linux, source)
How to get 980k on Amiga floppies (diskspare.device, http://aminet.net/package.php?package=disk/misc/Diskspr3.lha)
Google search – Amiga Nuke library
XPK libraries
XPK (NUKE, and other compression libraries) (part of Amiga FAQ)

Archiving and preserving contents of hard drives

Harddrive archiving:
I usually use ‘dd’ or ‘ddrescue’ on a Linux computer, with the Amiga harddrive attached.
Some controllers give you a byte-swapped image. Check with hexdump -C that the image is dumped with the bytes in correct order. For Amiga disks, it should start with “RDSK” and contain a readable manufacturer and model of the drive. If the bytes are in incorrect order, byteswap the whole image with the “swab” option to dd.

Copy all contents of an Amiga harddrive to a PC
https://superuser.com/questions/433076/copy-all-contents-of-an-amiga-harddrive-to-a-pc