19

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.

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 ?

[-] Rick_C137@programming.dev 1 points 4 days ago

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

example

adb shell ls /
[-] Rick_C137@programming.dev 1 points 4 days ago* (last edited 4 days ago)

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.

[-] Rick_C137@programming.dev 8 points 1 week ago

I've found

#container > div:not(div.barfoo)

seem to do the trick..

13
submitted 1 week ago* (last edited 1 week ago) by Rick_C137@programming.dev to c/css@programming.dev

Hi everyone,

I have something like this

<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

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

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

Any ideas ?

16

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.

5
Mozilla - Devil Incarnate (programming.dev)
submitted 3 weeks ago* (last edited 3 weeks ago) by Rick_C137@programming.dev to c/librewolf@lemmy.ml
17
submitted 3 weeks ago* (last edited 3 weeks ago) by Rick_C137@programming.dev to c/librewolf@lemmy.ml

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*

7

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 !

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 match ?
        "~^https:\/\/([\w-_\.]+\.)?example.com$" "$http_origin";
            #regex domain match
            # ~ mean I suppose the string is RegEx ?
            # Need to come with a RegEx expression that match https://anything.example.com[optional ports and Query string ?X=Y]
        "~^https:\/\/([\w-_\.]+\.)?example2.com$" "$http_origin"; #regex domain match
        }
               

    location /static {
        
        # if preflight request, we will cache it
        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Max-Age' 1728000; #20 days
            add_header 'Content-Type' 'text/plain charset=UTF-8';
            add_header 'Content-Length' 0;
            return 204; #https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 }

        if ($cors != "") {
            add_header 'Access-Control-Allow-Origin' "$cors" always; # <-- Variable $cors
            add_header 'Access-Control-Allow-Credentials' 'true' always;
            add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
            add_header 'Access-Control-Allow-Headers' 'Accept, Authorization, Cache-Control, Content-Type, DNT, If-Modified-Since, Keep-Alive, Origin, User-Agent, X-Requested-With' always;}

       # configuration lines...

    }
}

}
14

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 !

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 match ?
        "~^https:\/\/([\w-_\.]+\.)?example.com$" "$http_origin";
            #regex domain match
            # ~ mean I suppose the string is RegEx ?
            # Need to come with a RegEx expression that match https://anything.example.com[optional ports and Query string ?X=Y]
        "~^https:\/\/([\w-_\.]+\.)?example2.com$" "$http_origin"; #regex domain match
        }
               

    location /static {
        
        # if preflight request, we will cache it
        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Max-Age' 1728000; #20 days
            add_header 'Content-Type' 'text/plain charset=UTF-8';
            add_header 'Content-Length' 0;
            return 204; #https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 }

        if ($cors != "") {
            add_header 'Access-Control-Allow-Origin' "$cors" always; # <-- Variable $cors
            add_header 'Access-Control-Allow-Credentials' 'true' always;
            add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
            add_header 'Access-Control-Allow-Headers' 'Accept, Authorization, Cache-Control, Content-Type, DNT, If-Modified-Since, Keep-Alive, Origin, User-Agent, X-Requested-With' always;}

       # configuration lines...

    }
}

}
5
submitted 4 weeks ago* (last edited 4 weeks ago) by Rick_C137@programming.dev to c/webdev@programming.dev

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 !

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 match ?
        "~^https:\/\/([\w-_\.]+\.)?example.com$" "$http_origin";
            #regex domain match
            # ~ mean I suppose the string is RegEx ?
            # Need to come with a RegEx expression that match https://anything.example.com[optional ports and Query string ?X=Y]
        "~^https:\/\/([\w-_\.]+\.)?example2.com$" "$http_origin"; #regex domain match
        }
               

    location /static {
        
        # if preflight request, we will cache it
        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Max-Age' 1728000; #20 days
            add_header 'Content-Type' 'text/plain charset=UTF-8';
            add_header 'Content-Length' 0;
            return 204; #https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 }

        if ($cors != "") {
            add_header 'Access-Control-Allow-Origin' "$cors" always; # <-- Variable $cors
            add_header 'Access-Control-Allow-Credentials' 'true' always;
            add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
            add_header 'Access-Control-Allow-Headers' 'Accept, Authorization, Cache-Control, Content-Type, DNT, If-Modified-Since, Keep-Alive, Origin, User-Agent, X-Requested-With' always;}

       # configuration lines...

    }
}

}
6
submitted 1 month ago* (last edited 1 month ago) by Rick_C137@programming.dev to c/linux@lemmy.ml

Hi,

I got FileA that have 640 a getfacl FileA give me

# 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

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

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

8
FACL, Get effective: --- (programming.dev)
submitted 1 month ago by Rick_C137@programming.dev to c/linux@lemmy.ml

Hi,

I've set for a directory the following

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
# 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

stat aFile.txt

return

(0777/-rwxrwxrwx) #!!!!

is that normal !!!!???

Thanks.

21
submitted 2 months ago* (last edited 2 months ago) by Rick_C137@programming.dev to c/linux@lemmy.ml

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

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.

3
submitted 2 months ago* (last edited 2 months ago) by Rick_C137@programming.dev to c/webdev@programming.dev

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

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.

[-] Rick_C137@programming.dev 5 points 4 months ago

Something worth reading regarding Systemd https://www.devuan.org/os/announce/ Cheers.

[-] Rick_C137@programming.dev 2 points 6 months ago

I've received a lot of reactions on the original post: https://programming.dev/post/10465121

But if someone is involved with the development of Thunderbird I think this is worth reading: https://programming.dev/comment/7677398

For my part I will use the OpenPGP sigin tools for now.

Cheers.

[-] Rick_C137@programming.dev 3 points 6 months ago* (last edited 6 months ago)

Thank you all for your quick reactions !!

To summarize if I want to use the PDF built-in signing I will need to convert my OpenPGP into a X.509 cert otherwise I can simply use the OpenPGP file signing

I want to stick to the UNIX Philosophy especially:

Write programs that do one thing and do it well.

So I will use the OpenPGP signing tool :)

Thanks !

[-] Rick_C137@programming.dev 3 points 10 months ago

Has I found nothing, I've write a piece of code in Python ๐Ÿ ! and compile it for Windows..

[-] Rick_C137@programming.dev 3 points 10 months ago

Thank you @Vilian@lemmy.ca Seem great, I'll keep it for later :)

But not for what I need now, as

Mutt is a small but very powerful text-based mail client for Unix operating systems

and it's a "full" client, I need just the SMTP functionality.

[-] Rick_C137@programming.dev 3 points 10 months ago

and weirdly, I can post here...

[-] Rick_C137@programming.dev 2 points 10 months ago* (last edited 10 months ago)

@UFODivebomb@programming.dev & @ExperimentalGuy@programming.dev

Thank you for your input !

I've finally ~~used~~ been forced to use https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API and DOMParser().parseFromString()

I say forced, because so far it's only that Prehistoric JS available for the front-end, HOPEFULLY there is some coming kick-ass technology to get rid of JS --> https://brython.info โค๏ธ

[-] Rick_C137@programming.dev 3 points 11 months ago* (last edited 11 months ago)

and a True Linux ! not one that has been "infected" with parts that do not respect The Four Essential Freedoms of Free Software

So avoid Ubuntu for example..

have a look a this video https://www.fsf.org/blogs/rms/20140407-geneva-tedx-talk-free-software-free-society/

And for a Linux distrio have a look at https://www.devuan.org ๐Ÿ’“

and about windows --> https://itvision.altervista.org/why-windows-10-sucks.html

view more: next โ€บ

Rick_C137

joined 11 months ago