freamon

joined 1 year ago
MODERATOR OF
1
Remote Post 2 (17:44) (self.test_local)
submitted 8 months ago by freamon to c/[email protected]
[–] freamon 1 points 8 months ago

Reply 4 from remote (16:53)

[–] freamon 1 points 8 months ago

Reply 3 from remote (16:47)

[–] freamon 1 points 8 months ago

Reply 2 from remote (16:39)

1
Remote Post 1 (16:24) (self.test_local)
submitted 8 months ago by freamon to c/[email protected]
[–] freamon 1 points 8 months ago

Reply 1 from remote (16:22)

1
New Post 2024-03-17 10:34 (self.playground)
submitted 8 months ago by freamon to c/[email protected]
[–] freamon 2 points 8 months ago* (last edited 8 months ago)

print('single-line of code')

2
submitted 8 months ago* (last edited 8 months ago) by freamon to c/[email protected]
 
if working is not None:
    print('the thing works')
else:
    print('the thing does not work')
[–] freamon 1 points 8 months ago

fenced-code-blocks on

(is confused by a [] after the three backticks)

if this
then
that
else
other_thing
endif
[–] freamon 1 points 8 months ago

Code Block (no lang): [4 spaces and an escaped newline]

if this [4 spaces and an escaped newline]    
then [4 spaces and an escaped newline]    
that
else
the_other_thing [4 spaces and an escaped newline]    
endif

(no spaces before newlines for next block)

fenced-code-blocks off

[–] freamon 1 points 8 months ago

Code Block (no lang): [4 spaces and an escaped newline]

if this [4 spaces and an escaped newline]    
then [4 spaces and an escaped newline]    
that
else
the_other_thing [4 spaces and an escaped newline]    
endif

(no spaces before newlines for next block)

fenced-code-blocks on

[–] freamon 1 points 8 months ago

Code Block (no lang): [4 spaces and an escaped newline]

if this [4 spaces and an escaped newline]    
then [4 spaces and an escaped newline]    
that
else
the_other_thing [4 spaces and an escaped newline]    
endif

(no spaces before newlines for next block)

[–] freamon 1 points 8 months ago

Single line of code: [4 spaces and an escaped newline]
return [4 spaces and an escaped newline]
New paragraph [2 escaped newlines]

Code Block (no lang): [4 spaces and an escaped newline]

if this [4 spaces and an escaped newline]    
then [4 spaces and an escaped newline]    
that
else
the_other_thing [4 spaces and an escaped newline]    
endif

(no spaces before newlines for next block)

Code Block (python):

if this is not None:
    that
else:
    other_thing
[–] freamon 1 points 8 months ago

Assume follow worked

[–] freamon 1 points 8 months ago
{
  "actor": "https://programming.dev/c/test",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": {
    "id": "https://programming.dev/activities/create/5a782f4a-c892-4eeb-abca-05127db50929",
    "actor": "https://endlesstalk.org/u/freamon",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "object": {
      "type": "Page",
      "id": "https://endlesstalk.org/post/27782033",
      "attributedTo": "https://endlesstalk.org/u/freamon",
      "to": [
        "https://programming.dev/c/test",
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "name": "Code Blocks",
      "cc": [],
      "content": "<p>Single line of code: [4 spaces and an escaped newline]<br />\n<code>return</code> [4 spaces and an escaped newline]<br />\nNew paragraph [2 escaped newlines]</p>\n<p>Code Block (no lang): [4 spaces and an escaped newline]</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">if this [4 spaces and an escaped newline]    \n</span><span style=\"color:#323232;\">then [4 spaces and an escaped newline]    \n</span><span style=\"color:#323232;\">that\n</span><span style=\"color:#323232;\">else\n</span><span style=\"color:#323232;\">the_other_thing [4 spaces and an escaped newline]    \n</span><span style=\"color:#323232;\">endif\n</span></pre>\n<p>(no spaces before newlines for next block)</p>\n<p>Code Block (python):</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"font-weight:bold;color:#a71d5d;\">if </span><span style=\"color:#323232;\">this </span><span style=\"font-weight:bold;color:#a71d5d;\">is not </span><span style=\"color:#0086b3;\">None</span><span style=\"color:#323232;\">:\n</span><span style=\"color:#323232;\">    that\n</span><span style=\"font-weight:bold;color:#a71d5d;\">else</span><span style=\"color:#323232;\">:\n</span><span style=\"color:#323232;\">    other_thing\n</span></pre>\n",
      "mediaType": "text/html",
      "source": {
        "content": "Single line of code: [4 spaces and an escaped newline]    \n`return` [4 spaces and an escaped newline]     \nNew paragraph [2 escaped newlines]\n\nCode Block (no lang): [4 spaces and an escaped newline]    \n```  [4 spaces and an escaped newline]    \nif this [4 spaces and an escaped newline]    \nthen [4 spaces and an escaped newline]    \nthat\nelse\nthe_other_thing [4 spaces and an escaped newline]    \nendif\n``` \n\n(no spaces before newlines for next block)\n\nCode Block (python):\n```Python\nif this is not None:\n    that\nelse:\n    other_thing\n```",
        "mediaType": "text/markdown"
      },
      "attachment": [],
      "commentsEnabled": true,
      "sensitive": false,
      "published": "2024-03-17T07:49:13.596948Z",
      "language": {
        "identifier": "en",
        "name": "English"
      },
      "audience": "https://programming.dev/c/test"
    },
    "cc": [
      "https://programming.dev/c/test"
    ],
    "type": "Create",
    "audience": "https://programming.dev/c/test"
  },
  "cc": [
    "https://programming.dev/c/test/followers"
  ],
  "type": "Announce",
  "id": "https://programming.dev/activities/announce/create/1047a16d-6393-4c2f-a5cc-9eeba4eb43db"
}
1
Code Blocks (self.test)
submitted 8 months ago by freamon to c/[email protected]
 

Single line of code: [4 spaces and an escaped newline]
return [4 spaces and an escaped newline]
New paragraph [2 escaped newlines]

Code Block (no lang): [4 spaces and an escaped newline]

if this [4 spaces and an escaped newline]    
then [4 spaces and an escaped newline]    
that
else
the_other_thing [4 spaces and an escaped newline]    
endif

(no spaces before newlines for next block)

Code Block (python):

if this is not None:
    that
else:
    other_thing
 
 

am i even subscribed

0
submitted 8 months ago* (last edited 8 months ago) by freamon to c/[email protected]
 
if image is not None:
   pass
5
submitted 8 months ago* (last edited 8 months ago) by freamon to c/[email protected]
 

This is probably just me, but I found INSTALL.md to be a bit confusing.

So, for a fresh install of Ubuntu in a Windows Hyper-V VM, this is the list of steps I took to get something that at least looks like it might be the right thing:

remove unattended-upgrades, and clean up after OS install

(nothing to do with PieFed, just some necessary Ubuntu weirdness)

sudo systemctl stop unattended-upgrades
sudo apt-get purge unattended-upgrades
sudo apt autoremove

install postgresql 16

sudo apt install ca-certificates pkg-config
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt update
sudo apt install libpq-dev postgresql

install python libs

sudo apt install python3-pip python3-venv python3-dev python3-psycopg2

install redis server

sudo apt install redis-server

install git

sudo apt install git

set up database

sudo -iu postgres psql -c "CREATE USER pyfedi WITH PASSWORD 'pyfedi';"
sudo -iu postgres psql -c "CREATE DATABASE pyfedi WITH OWNER pyfedi;"

clone PieFed

git clone https://codeberg.org/rimu/pyfedi.git

cd into pyfedi, set up and enter virtual environment

cd pyfedi
python3 -m venv ./venv
source venv/bin/activate

use pip to install requirements

pip install wheel
pip install -r requirements.txt

edit .env file

cp env.sample .env
nano .env (change SECRET_KEY to some random sequence of numbers and letters)

initialise database, and set up admin account

flask init-db

run the app

flask run
(open web browser at http://127.0.0.1:5000)
(log in with username and password from admin account)

Maybe this will help someone else (or maybe someone has spotted something that I missed - like I say: it looks right when loaded in a browser, but I'm not 100% sure)

 
1
Test Post (self.test)
submitted 9 months ago by freamon to c/[email protected]
view more: ‹ prev next ›