Compare commits

..

21 Commits

Author SHA1 Message Date
edba41bf6e Presledek ... 2022-12-11 22:35:49 +01:00
47d6240cea Nov članek. 2022-12-11 22:03:15 +01:00
faa7db1187 Popravek imena datoteke. 2022-10-26 22:16:59 +02:00
80c9f7d27e Nov članek. 2022-10-26 22:13:00 +02:00
7980634f2c New admin cert fingerprint. 2022-10-26 20:55:12 +02:00
2c35ef19f9 Debugging fingerprint ... 2022-10-26 20:52:09 +02:00
62cb21a580 Nov članek. 2022-10-26 19:52:59 +02:00
Matjaz
c6c403b69c Lepotni popravki. 2022-03-18 22:27:42 +01:00
Matjaz
a21fa69a72 Popravki imen datotek. 2022-03-09 22:02:13 +01:00
Matjaz
afb5061a51 Nov članek. 2022-03-09 21:54:49 +01:00
Matjaz
92d2aa4166 New Article. 2022-01-26 21:06:11 +01:00
Matjaz
11ff3a8c54 Fix file extension. 2022-01-26 20:48:12 +01:00
Matjaz
56a8260739 Typo. 2022-01-15 22:49:35 +01:00
Matjaz
9932dca148 New Article. 2022-01-15 22:46:38 +01:00
Matjaz
fb344d9939 Uploading of articles. 2022-01-10 22:53:06 +01:00
Matjaz
e52d5652c5 Fix content beginning for titan content. 2022-01-10 22:32:31 +01:00
Matjaz
f43d8e2722 Add admin route. 2022-01-10 22:05:54 +01:00
Matjaz
d220986b3d Add "Home" link to Articles page. 2022-01-08 22:26:22 +01:00
Matjaz
4c615a2a44 Fix semicolon. 2022-01-08 22:10:36 +01:00
Matjaz
8a3d07b228 Fix error with articles page. 2022-01-08 22:09:20 +01:00
Matjaz
a7ad340283 Error handling for filesystem reads. 2022-01-08 22:03:47 +01:00
11 changed files with 118 additions and 27 deletions

View File

@ -0,0 +1,7 @@
# It is Weekend Again
I tried to compile Firebird SQL DBMS on OmniOS. Last time I was able to acomplish this was probably version 3 alpha or maybe beta. Definitly not with final release.
Now version 4.0.1 is here. And Solaris is not really a very atractive platform. And there was quite a lot of refactoring and clanup in Firebird's codebase, so it looks like it is not going to work without major investment in time. Is it worth it? Probably not. I can run Firebird just fine under linux emulation in a Solaris Zone. But it would be nice to run it natively. Let's see if I can get it to work.
So why would I like to use Firebird. I could just use SQLite or Postgres. I know, but Firebird has a bit of nostalgy for me. I used it before and I like it. It was one of my first database engines. Not really rational, I know.

View File

@ -0,0 +1,11 @@
# Sometimes You Just Need To Let Go
Sometimes things do not work out. This time I could not get Firebird to compile. I tried for more then a week.
=> gemini://uplink.si/articles/2022-01-15_000-firebird.gmi Firebird
It compiles fine in linux, it works well on my Raspberry Pi works nicely in linux zone on Omnios ... But for life of me, I cannot get it to finish line natively on Omnios.
I still kind of like it. But if I can't play with it ... there is no fun in that.
Anyway, next project ...

View File

@ -0,0 +1,9 @@
# Never Feel Sorry
> Never feel sorry for raising
> dragon slayers in a time where
> there are actual dragons.
Some people feel resentful towards the world in which we live in. They think it is not wise to bring new children into it.
I think we were brought to this world by our parents who failed to understand the path this world is on. A path of destruction and suffering. Climate, wars, economy... There are too few people who actually understand how to change it, too few. Luckily we, our generation, are aware of the problem. It is our task to bring up a new generation that will be equipped with everything, needed to fix it. To slay our dragons.

View File

@ -0,0 +1,7 @@
# Pa smo tam
To, da je naša družba že dobri dve leti bolj ali manj podvržena Covid-19, je najbrž že vsem jasno. Nič novega, nič presenetljivega. No, po več kot dveh letih uspešnega izmikanja, je zadelo tudi mene. Test je pozitiven. Za zdaj ni še nič posebnega, občasno čutim, da se mi bo vnela nosna sluznica, ampak se za zdaj še ni. Mogoče čutim malo utrujenosti v mišicah, ampak to bi lahko bilo tudi kaj drugega na primer utrujenost od vikenda, ko sem sestavljal pohištvo.
S Simono sva oba pozitivna. Umaknila sva se v Šiško, da ne bo okužbe pobral še kdo. Covid menda te dni traja okoli deset dni. Danes je drugi dan. Držimo pesti, da mine brez simptomov, brez zapletov.
Kaj pa zdaj? Jah … delo od doma za ves teden, počitek, čaj, vitamini …

View File

@ -0,0 +1,9 @@
# Zabavni dnevi
Danes je bil spet en tak zabaven dan. Čakamo dojenčka. Prvega. Zamuja. Vsak dan je dan, ko bi se lahko rodil. Pa se še kar ni. Hja, malo bo treba še počakat.
Sodelavci so skoraj bolj nestrpni kot jaz. Vsak dan jih nekaj preveri, kako stojijo stvari. Samo danes so me trije kolegi vprašali, ali se že kaj dogaja. Ne samo ožji sodelavci, zdaj se je novica razširila tudi v spodnje nadtropje. Nič ni narobe s tem, presenečen sem bil nad pozornostjo, ampak se mi pa zdi lepo.
Vsem povem, da še čakamo, drugih novic pa ni. Bomo videli. Po tem sledi skoraj obvezna njihova izkušnja. Nekateri so dobili otroke še pred rokom, nekateri so se rodili tudi čisto prezgodaj, nedonošeni. Drugi pravijo, da so tudi njihovi otroci zamujali. teden, tudi dva. Nič skrbet, pravijo.
Tako je. Dojenček se bo že odločil, kdaj bo imel dovolj trebušnega podnajemništva in se bo prikazal na ta svet.

View File

@ -0,0 +1,15 @@
# Human nature of punitive law
There is an idea out there that we should allow automatic systems for traffic control. The radar camera image should be automatically processed by automatic number plate recognition software, a misdemeanour fee should be calculated automatically based on speed, ticket should be created and sent to the offender automatically, without human interaction. Welcome to the future. Autonomous systems taking over.
Efficient? Maybe. But do we really want it? Take away the human nature of punishment and human offenders are reduced to slaves to the technology. Not just offenders but rather all of us. Technology is rarely wrong. Almost never. Actually, never. If the system says you were going over the speed limit, you were going over the speed limit. Is appeal even worth it? Should appeal even be allowed? The human decision-making process when deciding on punishment of traffic rules offenders is rarely so streamlined as its computerised counterpart. Doesnt this driver look kind of like my mom? Oh, he got kids with him… There is a truck right beside him… There are a million things we consider when deciding on punishment. And not all of them are rational there are a lot of emotions in the process as well. Simple AI we have got nowadays cannot handle that yet. Will it ever? Will it want to? Do we want it to?
I think the punitive law should remain a domain of human. Decisions should be result of emotions, of legal reasoning based on a thousand years of human legal philosophy, with all its flaws and weaknesses. A philosophy that started out in Mesopotamia, ancient Greece, Rome and Constantinople. Philosophy that survived through the Dark Ages and made Enlightment what it was. It is a philosophy, that makes it imperfect. We know that we do not know.
Human decision making is full of mistakes. And is a subject to appeal. Mistakes are what makes our legal system and our legal thought to evolve, and this evolution makes it ever more humane.
What are computers good at? Optimisation. They are good at figuring out rules based on input data. Finding shortcuts from where we are to where the programmer thought we should end up or wherever the input data extrapolation will take us. Need to find a new cure for cancer or which gene is responsible for the colour of hair? AI is perfect. Automatic driving? Maybe.
When left to the mercy of humans and machines we know there will be none with the latter. And mercy is exactly what we need in our punitive law. No mistakes, no appeal and no mercy make the system cruel, cold and unforgiving. Like a slave owner.
Automation of the speeding ticket system is only but the first step on this path. The one we should not have taken.

View File

@ -3,6 +3,7 @@ var uplinkGemini = require('./uplink-gemini');
var index = require('./routes/index');
var articles = require('./routes/articles').articles;
var articles_item = require('./routes/articles').articles_item;
var admin = require('./routes/admin');
const app = new uplinkGemini.App();
const gemini = new uplinkGemini.Gemini();
@ -10,5 +11,6 @@ const gemini = new uplinkGemini.Gemini();
gemini.router.use('/', index);
gemini.router.use('/articles/', articles);
gemini.router.use('/articles/:item', articles_item);
gemini.router.use('/admin/', admin);
gemini.listen();

26
routes/admin.js Normal file
View File

@ -0,0 +1,26 @@
var fs = require('fs');
/* GET home page. */
function admin(req, res) {
if(req.protocol == 'titan:') {
console.log(req.content.toString());
var title = '';
var lines = req.content.toString().split('\n');
for(var i = 0; i < lines.length; i++) {
if(lines[i].startsWith('# ')) {
title = lines[i].replace('# ', '').trim().replace(/ /g, '-').toLowerCase().replace(/č/g,'c').replace(/š/g, 's').replace(/ž/g, 'z') + '.gmi';
console.log(title);
break;
}
}
try {
fs.writeFileSync('articles/' + title, req.content.toString());
} catch (error) {
res.error(51);
return;
}
}
res.send(`20 text/gemini\r\n\r\nHello Admin\r\n\r\n=> titan://localhost/admin/ Upload new article\r\n\r\n=> /articles/ 📓Articles\r\n=> / 🏡Home\r\n`)
}
module.exports = admin;

View File

@ -8,29 +8,31 @@ function toTitleCase(str) {
/* GET home page. */
function articles(request, response) {
var articleList = fs.readdirSync('./articles');
articleList.reverse();
var contents = '';
articleList.forEach(function(item) {
var title = item.replace('.gmi', '').replace(/\-/g, ' ');
title = toTitleCase(title);
contents += `=> /articles/${item} ${title}\r\n`;
});
response.send(`20 text/gemini\r\n
# Articles by Uplink:SI
List of Articles:
${contents}
`);
try {
var articleList = fs.readdirSync('./articles');
articleList.reverse();
var contents = '';
articleList.forEach(function(item) {
var title = item.replace('.gmi', '').replace(/\-/g, ' ');
title = toTitleCase(title);
contents += `=> /articles/${item} ${title}\r\n`;
});
var articlesPage = `20 text/gemini\r\n\r\n# Articles by Uplink:SI\r\n=> / Home\r\nList of Articles:\r\n${contents}\r\n`;
response.send(articlesPage);
} catch (error) {
response.error(51);
}
}
function articles_item(request, response) {
var article = fs.readFileSync('./articles/' + request.params.item);
response.send(`20 text/gemini\r\n
${article}
=> /articles/ 📓Articles
=> / 🏡Home
`);
try {
var article = fs.readFileSync('./articles/' + request.params.item);
var articlePage = `20 text/gemini\r\n\r\n${article}\r\n\r\n=> /articles/ 📓Articles\r\n=> / 🏡Home\r\n`;
response.send(articlePage);
} catch (error) {
response.error(51);
}
}
module.exports.articles = articles;

View File

@ -1,9 +1,11 @@
/* GET home page. */
function index(request, response) {
var adminBlock = "";
if(request.clientCert.fingerprint == '96:19:A6:91:57:AF:E2:D3:E0:80:FC:35:4E:BD:2A:46:C9:2D:CB:53') {
adminBlock = '## Administration\r\n=> /admin Administration';
}
if(request.clientCert.fingerprint == '06:D2:06:C8:C3:8B:B7:86:FA:81:F9:A7:C4:18:56:C8:9A:2C:AD:EB') { //my certificate fingerprint
adminBlock = '## Administration\r\n=> /admin/ Administration';
} /*else {
adminBlock = '## Certificat Fingerprint\r\n'+request.clientCert.fingerprint;
}*/
response.send(`20 text/gemini\r\n
\`\`\` Uplink:SI Logo
_ _ ____ _ _ _ _ _ _ ____ _
@ -13,7 +15,8 @@ response.send(`20 text/gemini\r\n
-=Est. 2021=-
\`\`\`
Uplink is my conection to the Gemini Space. It is to become a great site. At this moment I will be publishing my own articles, my own content.
# 📡Uplink:SI
# 📡 Uplink:SI
## 🖥 About this server
Uplink.si started about ten years ago. A long time in Internet time. First it was running on free dynamic domains but at some point Uplink.si was registered. The server was always running HTTP and Gopher servers. I was always fascinated by old technologies, primarily because they were simple to understand fully. Back then I wrote a small gopher+ server and client. Now Gemini came along. Gemini is similar to Gopher in that fascinating simplicity. I was able to write a server in about 100 lines of JavaScript and it worked.
@ -29,10 +32,10 @@ As mentioned, there is also a Gopher+ server somewhere around here.
=> gopher://uplink.si/ Uplink Gopher Server
## Articles
=> /articles/ 📓Articles
=> /articles/ 📓 Articles
## Links to other hosts
=> gemini://geminispace.info/ 🔎Search Engine
=> gemini://geminispace.info/ 🔎 Search Engine
\`\`\`
,___,

View File

@ -45,7 +45,7 @@ module.exports = class Request {
this.path = decodeURIComponent(geminiUrl.pathname);
this.search = geminiUrl.search.substring(1); //remove '?' from string
if(this.protocol === 'titan:') {
this.content = this.rawRequest.slice(this.rawRequest.indexOf('\r\n') + 3);
this.content = this.rawRequest.slice(this.rawRequest.indexOf('\r\n') + 2);
}
} catch(err) {
console.log(err);