Skip Navigation
Posts
38
Comments
44
Joined
2 yr. ago
Web Development @programming.dev
Rick_C137 @programming.dev

Does someone know an alternative to Mozilla MDN ?

Hi,

I'm using (like a lot of us, I presume ) Mozilla MDN

But I just discover that they display advertise :'(
\

Damn that think (MDN doc) is run by committer (I did post few thing on it) and they display advertise ! f**king hell ! Can I have my cut 💵 then ?

beside jokes, do you know good (decentralized ?) alternative to mdn docs ?
\ Thanks.

  • I don't see python on your image :)

  • Python @programming.dev
    Rick_C137 @programming.dev

    PUG ( web template engine ) for Python 🐍

    Hi,

    I've discover haml and pug [^1] ( both web template engine )

    It's totally Pytonic ! ( and make even more sense to use it with python rather than JS 🤮 )

    I've look, if it exist for Python, but so far, I've found only

    The first, only convert pug into another template :/
    \ The second, didn't pass the alpha version.
    \ The third, require dependence, not maintained etc.. \

    So I didn't found a Python package that could do haml/pug to html directly, without too much dependence...

    For example:

    From

     pug
        
    html
      head title Example for Python discuss
      body
        h1 Hello world
        p This is a paragraph.
    
    
      

    To

     html
        
    <html>
      <head>
        <title>Example for Python discuss</title>
      </head>
      <body>
        <h1>Hello world</h1>
        <p>This is a paragraph.</p>
      </body>
    </htm
      
    Thunderbird @lemmy.world
    Rick_C137 @programming.dev

    How encrypt email title ? ( GnuPG )

    cross-posted from: https://programming.dev/post/21294559

    Hi,

    I'm following my previous post
    \ How encrypt email with a GnuPG public key ? [ solved ]

    So I managed to encrypt the email body with GnuPG public key.. But I don't figure how I can do the same for the title ?!
    \ ThunderBird manage it.. any idea how ?
    \ asked on Official Thunderbird forum

    Thanks.

    Python @programming.dev
    Rick_C137 @programming.dev

    How encrypt email title ? ( GnuPG )

    Hi,

    I'm following my previous post
    \ How encrypt email with a GnuPG public key ? [ solved ]

    So I managed to encrypt the email body with GnuPG public key.. But I don't figure how I can do the same for the title ?!
    \ ThunderBird manage it.. any idea how ?
    \ asked on Official Thunderbird forum

    Thanks.

  • I finally manage to encrypt the body trough ptyhon-gnupg ( warning their documentation is still in alpha stage. )

    now, remain to encrypt the subject (ThunderBird compatible) if you have any clues I'm all ears

    When time permit I will publish my code in a pastbin.

    Wubba Lubba dub-dub**

  • indeed, but a lot of Linux distribution come with it :)
    \ otherwise it's installable.

  • instead of using a library I can directly use subprocess with gnupg but in both case it seem gnupg require to import the public key to the keyring !? I don't want that.

  • Python @programming.dev
    Rick_C137 @programming.dev

    How encrypt email with a GnuPG public key ?

    Hi,

    I'm already using

     python
        
    from smtplib import SMTP_SSL
    from email.message import EmailMessage
    
    
      

    To send emails.

    Now I would like to be able to encrypt them with the public key of the recipient. ( PublicKey.asc )

    ::: spoiler an A.I provide me this

     python
        
    import smtplib
    from email.message import EmailMessage
    from cryptography.hazmat.primitives.asymmetric import ec
    from cryptography.hazmat.primitives import serialization
    from cryptography.hazmat.primitives.ciphers.aead import AESGCM
    
    # Load the ECC public key from the .asc file
    with open('recipient_public_key.asc', 'rb') as key_file:
        public_key_bytes = key_file.read()
    public_key = ec.EllipticCurvePublicKey.from_public_bytes(
        ec.SECP384R1(),
        public_key_bytes
    )
    
    # Create the email message
    msg = EmailMessage()
    msg.set_content('This is the encrypted email.')
    msg['Subject'] = 'Encrypted Email'
    msg['From'] = '[email protected]'
    msg['To'] = '[email protected]'
    
    # Encrypt the email message using the ECC public key
    
      
  • Are the File Sharing and Voice and Video Calls are E2EE ?

  • Self Hosted - Self-hosting your services. @lemmy.ml
    Rick_C137 @programming.dev

    How store a file with a timestamp in a decentralized manner?

    cross-posted from: https://programming.dev/post/19958073

    Hi,

    I'm looking for a solution to archive files in a decentralized system. that would meet those requirement:

    • FLOSS
    • date-stamp the upload of the file.
    • immutable storage ~ WORM
    • anonymous (like TOR)

    I was considering IPFS but it does not date-stamp the upload :'( you can make a description-file but this is unreliable, as you can set any date..

    I'm lost between hyphanet.org and Freenet.org ?!
    \ are those the same project ?

    According to A.I:

    Hyphanet is focused on secure, private, and efficient communication and data sharing, with an emphasis on enabling users to monetize their data while maintaining control over their data sovereignty.

    is that true ? I can't found the information on their website...

    decentralized @lemmy.ml
    Rick_C137 @programming.dev

    How store a file with a timestamp in a decentralized manner?

    Hi,

    I'm looking for a solution to archive files in a decentralized system. that would meet those requirement:

    • FLOSS
    • date-stamp the upload of the file.
    • immutable storage ~ WORM
    • anonymous (like TOR)

    I was considering IPFS but it does not date-stamp the upload :'( you can make a description-file but this is unreliable, as you can set any date..

    I'm lost between hyphanet.org and Freenet.org ?!
    \ are those the same project ?

    According to A.I:

    Hyphanet is focused on secure, private, and efficient communication and data sharing, with an emphasis on enabling users to monetize their data while maintaining control over their data sovereignty.

    is that true ? I can't found the information on their website...

  • Thanks all for your input !

    So yes /sdcard was /storage/emulated/0 and it's a real sd-card.

    That was indeed formatted as FAT, I reformatted into EXT4 (from a desktop Linux) put the SD-card back into the phone and started the phone.

    Ive tried (in the phone)

     bash
        
    su
    chmod 777 /storage/emulated/0 #yes it's still mounted as emulated !
    stat /storage/emulated/0
    #...
    #Access: (0771)
    #....
    
      

    So I'm still blocked... any ideas ?

    Thanks.

  • Android @lemmy.world
    Rick_C137 @programming.dev

    chown on a sdcard directory impossible...

    Hi,

    I would like to change the owner of a directory on the sdcard /sdcard/aDirectory

    I have a terminal installed on my Android 10 (LineageOS 17) com.android.terminal

    sudo is not present so I use su and it works.

     bash
        
    su
    #Terminal was granted Superuser rights
    
    cd /sdcard
    chown 10:10 aDirectory
    #I don't get any error message.
    
    stat aDirectory
    #Uid (0/root)
    
    
      

    So the owner stay root no matter what I'm doing, any ideas ?

  • I've found the most simple way (for my case) adb shell 'a command'

    example

     bash
        
    adb shell ls /
    
      
  • Thank you all for your input.. but it seem my question is still not fully answered...

    let me rephrase, I'm not looking to have a GUI to transfer files, but I would like to execute terminal command remotely (from my computer) to my android phone. Like SSH .

    So I've read that I can install a SSH server on my android phone.. (If you know some's (FLOSS), I'm all ears) Or if you know a better way than SSH I'm all ears too.

    Thanks.

  • I've found

     css
        
    #container > div:not(div.barfoo)
    
    
      

    seem to do the trick..

  • CSS @programming.dev
    Rick_C137 @programming.dev

    CSS, select an element that have div:not(something) possible ?

    Hi everyone,

    I have something like this

     html
        
    <div id="container">
    
        <div>
            <div class="foobar"></div>
        </div>
    
        <div>
            <div class="foobar"></div>
        </div>
    
        <div>
            <div class="foobar"></div>
            <div class="barfoo"></div>
        </div>
    
        <div>
            <div class="foobar"></div>
        </div>
    
        <div>
            <div class="foobar"></div>
        </div>
    
    <div>
    
      

    I would like to select all the #container > div (the childs of container)

    that do not have a div.barfoo in their childs.

    is it possible with CSS ?

    I'm at

     css
        
    #container> div :not(div.barfoo) {} 
    
    
      

    but this is not working, and will select anyway #container > div > div

    Any ideas ?

    Android @lemmy.world
    Rick_C137 @programming.dev

    How terminal in, on Android

    Hi,

    I created another user on my custom rom Android (aka Multiple users)

    Unfortunately when doing so the system do not adapt the permission of the sdcard and some other directory, thus the new user can't access them :/

    So I wanted to "remote" terminal into my android device from my computer.

    How are you achieving this ? ( without 3thparty apps please ! )

    Thanks.

    LibreWolf @lemmy.ml
    Rick_C137 @programming.dev

    Mozilla - Devil Incarnate

    LibreWolf @lemmy.ml
    Rick_C137 @programming.dev

    Is there a list of all the tweaks, changes between Firefox and LibreWolf ?

    Hi everyone,

    Is there somewhere a list of all the changes made compared to Firefox ?

    edit:

    Sorry if it's been already asked over here, but it seem that Lemmy do not provide a search within a Community 😮

    no, actually we can, there isn't a shortcut to make such a search. and no ability to limit the search to the titles..

    Wubba Lubba dub-dub

    Self-hosting @slrpnk.net
    Rick_C137 @programming.dev

    Nginx how enable CORS for multi origins ?

    cross-posted from: https://programming.dev/post/18360806

    Hi everyone,

    I would like to enable Cross-Origin Resource Sharing on my Nginx server. for few origins (cors requestor)/domains.

    I've found this article https://www.juannicolas.eu/how-to-set-up-nginx-cors-multiple-origins that is nice, but not complete and on my browser seem really hard to read due to the layout 🤮

    So I've opened a CodeBerg git repository for the good soul that want to perfect this piece of code the allow the most of use to use CORS with Nginx.

    https://codeberg.org/R1ckSanchez_C137/BestOfxxx/src/branch/main/Nginx/CORS_MultiDomains.py

    If you don't want to create an account on codeberg feel free to post your code here !

     nginx
        
    server {
        # Server
    
        map "$http_origin" $cors { # map in Nginx is somewhat like a switch case in a programming language.
            default ''; #Seem to set $cors to '' empty string if n
      
    Self Hosted - Self-hosting your services. @lemmy.ml
    Rick_C137 @programming.dev

    Nginx how enable CORS for multi origins ?

    cross-posted from: https://programming.dev/post/18360806

    Hi everyone,

    I would like to enable Cross-Origin Resource Sharing on my Nginx server. for few origins (cors requestor)/domains.

    I've found this article https://www.juannicolas.eu/how-to-set-up-nginx-cors-multiple-origins that is nice, but not complete and on my browser seem really hard to read due to the layout 🤮

    So I've opened a CodeBerg git repository for the good soul that want to perfect this piece of code the allow the most of use to use CORS with Nginx.

    https://codeberg.org/R1ckSanchez_C137/BestOfxxx/src/branch/main/Nginx/CORS_MultiDomains.py

    If you don't want to create an account on codeberg feel free to post your code here !

     nginx
        
    server {
        # Server
    
        map "$http_origin" $cors { # map in Nginx is somewhat like a switch case in a programming language.
            default ''; #Seem to set $cors to '' empty string if n
      
    Web Development @programming.dev
    Rick_C137 @programming.dev

    Nginx how enable CORS for multi origins ?

    Hi everyone,

    I would like to enable Cross-Origin Resource Sharing on my Nginx server. for few origins (cors requestor)/domains.

    I've found this article https://www.juannicolas.eu/how-to-set-up-nginx-cors-multiple-origins that is nice, but not complete and on my browser seem really hard to read due to the layout 🤮

    So I've opened a CodeBerg git repository for the good soul that want to perfect this piece of code the allow the most of use to use CORS with Nginx.

    https://codeberg.org/R1ckSanchez_C137/BestOfxxx/src/branch/main/Nginx/CORS_MultiDomains.py
    \ and
    \ https://codeberg.org/R1ckSanchez_C137/BestOfxxx/issues \

    If you don't want to create an account on codeberg feel free to post your code here !

     nginx
        
    server {
        # Server
    
        map "$http_origin" $cors { # map in Nginx is somewhat like a switch case in a programming language.
            default ''; #Seem to set $cors to '' empty string if none of the follwing rexeg matc
      
  •  bash
        
    setfacl -m m:r aFile
    #re set the mask
    
    
      

    solve the problem, but the question is: why the F**** this is happening !?

  • Linux @lemmy.ml
    Rick_C137 @programming.dev

    FACL, lost in it's behavior..

    Hi,

    I got FileA that have 640 a getfacl FileA give me

     txt
        
    # file: FileA
    # owner: me
    # group: me
    user::rw-
    user:aUser:r--
    group::r-x			#effective:r--
    mask::r--
    other::---
    
    
      

    So it's give me the expected...

    but when I do

     bash
        
    chmod 600 aFile
    getfacl aFile
    
    
      
     txt
        
    ...
    user:aUser:r--		#effective:---
    ...
    mask::---
    ...
    
    
      

    Why suddenly aUser lost his ability to read the file !?!?!

  • Update, this is only happening when I copy files from a ~SMB share... :'(
    \ Otherwise it's correct...

  • Linux @lemmy.ml
    Rick_C137 @programming.dev

    FACL, Get effective: ---

    Hi,

    I've set for a directory the following

     bash
        
    setfacl -dm u:aUser:r aDirectory
    #set new files to be readable by aUser
    
    cp ~/Desktop/aFile.txt /xx/xx/xx/aDirectory
    
    getfacl aFile.txt #the copied one
    
    
      
     txt
        
    # file: aFile.txt
    # owner: me
    # group: me
    user::rwx
    user:aUser:r--
    group::r-x
    mask::rwx
    other::rwx
    
    
      

    So indeed we see the aUser got r--

    but

     bash
        
    stat aFile.txt
    
    
      

    return

     txt
        
    (0777/-rwxrwxrwx) #!!!!
    
    
      

    is that normal !!!!???

    Thanks.

  • Thank you all !

    Indeed setting execute perm on example, sub1, sub2, static

    The program/user have now access to the directory.

    In order words all the parents directory need at least execute in order to have access in the targeted directory...

    Now I gave 751 for static. Meaning than others (here nginx) cannot list the files within. But never the less it works
    \ the static files are appearing when requested (HTTP) but forbidding nginx to list the directory is changing something ? (performance/security)

    Thanks

  • Linux @lemmy.ml
    Rick_C137 @programming.dev

    Recursive execute(x) required to enable nginx to read a directory !??

    Hi,

    I've noticed something quite odd, but I don't know if the problem come from Linux itself or nginx..

    In order to grant nginx access to a directory let say your static see: https://stackoverflow.com/questions/16808813/nginx-serve-static-file-and-got-403-forbidden

    These parent directories "/", "/root", "/root/downloads" should give the execute(x) permission to 'www-data' or 'nobody'. i.e.

    but it seem not only the direct parent need to be given XX5 but all the chain

    for example

     bash
        
    example
    └── sub1
        └── sub2
            └── static
    
    
      

    it seem you need to set allow others to read and execute 5 all the parents example, sub1, sub2 Why is that !?? I've found it so akward and unsecure ! is there a workaround ?

    Thanks.

  • I wanted to have a default server that catch ~wrong DNS query to the server

  • The full working code:

     nginx
        
    server {
        listen 443 ssl;
        server_name _;
        ssl_certificate /etc/nginx/ssl/catchall.crt;
        ssl_certificate_key /etc/nginx/ssl/catchall.key;
    
        error_page 404 /404_CatchAll.html;
    
        # Everything is a 404
        location / {
            return 404;
        }
    
        location /404_CatchAll.html {root /var/www/html/;}
    }
    
      
  • ok I've found something that ~works !

     nginx
        
        server {
            listen 443 ssl;
            server_name _;
            ssl_certificate /etc/nginx/ssl/catchall.crt;
            ssl_certificate_key /etc/nginx/ssl/catchall.key;
    
            error_page 404 /404.html; #at /var/www/html/
    
            location /404.html {internal;}
    
            return 404;
        }
    
    
      

    so i get the default 404 html from nginx. but not the one that I specified error_page 404 /404.html; any ideas ?

  • line 5 you mean ?

     nginx
        
    error_page 404 /404.html; #this one ?
    
      
  • Web Development @programming.dev
    Rick_C137 @programming.dev

    nginx, Default server do not works !

    Hi,

    You might be aware that if a DNS request point your nginx server.

    and this later do not have a server rule for it , nginx will server anyway the first server found in your config file, WTF !

    So I've found https://stackoverflow.com/a/23281442

     nginx
        
    server {
      listen       80 default_server;
      server_name  everythingelse;
    
      error_page 404 /404.html;
    
      # Everything is a 404
      location / {
        return 404; #return the code 404
      }
    
      # link the code to the file
      location = /404.html {
        #EDIT this line to make it match the folder where there is your errors page
        #Dont forget to create 404.html in this folder
        root  /var/www/nginx/errors/;
      }
    }
    
      

    But this is not working !

    I made one of my domain pointing to this nginx server, and he still server another site aka server For httpS for http nothing appear..

    Thanks.

    Stallman Was Right @lemmy.ml
    Rick_C137 @programming.dev

    Is owning websites for private individuals become forbidden by our governments ?

    cross-posted from: https://programming.dev/post/13465911

    Hi,

    I'm confuse about those mandatory legal notices that governments impose for websites..

    Before going further I invite you to read:
    \ A Declaration of the Independence of Cyberspace
    \ and
    \ Discourse on Voluntary Servitude[^1] \

    From all the articles[2] that I read about *the mandatory notice to display for website* none of them reference the URL of their claim !! / of the legal text !! WTF[links]

    Internet is by essence world wide, and when reading all those legal requirement it's seem that you should display notices for EVERY country !

    it's seem also that if you own a private website, just for your own or family use, like for example a web file hosting services. (NextCloud etc..) You should comply with the same requirement that are asked for company ! again... WTF !

    Also I don't understand, why make mandatory those notices...(beside the

  • I've gave a longer trial to gpg4win and it's very power full and easy to use ! Of course it's pointless to use such a nice tool on a none air-gaped Windows..

    For the others there is Gnu-Linux :)