sorted by: new top controversial old
18

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 2 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 2 days ago* (last edited 2 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.

14

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.

12

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

    }
}

}
[-] Rick_C137@programming.dev 2 points 1 month ago
setfacl -m m:r aFile
#re set the mask

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

-1
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 !?!?!

[-] Rick_C137@programming.dev 1 points 1 month ago* (last edited 1 month ago)

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

4
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.

[-] Rick_C137@programming.dev 1 points 1 month ago

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

19
submitted 2 months ago* (last edited 1 month 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.

[-] 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 !

32
submitted 6 months ago by Rick_C137@programming.dev to c/linux@lemmy.ml

Hi everyone,

I was wondering if you know a way to use the generated OpenPGP key created trough Thunderbird to sign PDF's ?

(Devuan distro)

Thanks.

3

Hi,

As CSS do not have a color-overlay[^1] filter.

There is some heavy work around:

https://isotropic.co/tool/hex-color-to-css-filter/

that use a combination of CSS filter to target the desired color...

Those online calculators are neat, but I would like an offline version, in case the provided one become inaccessible.

I've downloaded the zip of https://codepen.io/sosuke/pen/Pjoqqp

But it doesn't work locally.. :/

So I would like to know, if someone know one in ๐Ÿ Python ? or how can I make one then ?

Or if someone know another way to have the color-overlay[^1] effect in html\css, I'm all ears !

Thank.

[^1]: To apply like in Photoshop a color on the shape of the image (so not on the parts that have transparency.

[-] Rick_C137@programming.dev 1 points 9 months ago

@crystal@feddit.de I didn't know about GrapheneOS too bad it only work Pixel phones (that are also owned by Google ! ) So If I'm against Google for all what they do https://degooglisons-internet.org/en/ I'll certainly not give them money !

(Finding and importing a phone is something you have to do even when using the stock OS.)

True, but you will do it multiple time if the phone that your looking for doesn't have an available ROM somewhere..

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

Indeed, but in AOSP there is no GMS and that already better !

22

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

Hi,

Intro about XDA forum (skippable)

I was using a lot xda-developers.com for anything that was related to Android development and phone support. (ROM etc..)

But it became rotten -->

๐Ÿ˜ฑ

๐Ÿ˜ฑ

Current situation ton Install another ROM ~OS

As you may know, in order to install another ROM For example to get rid of Google ! ๐Ÿ‘ฟ

You need one that is specifically build for your devices for example: https://wiki.lineageos.org/devices/

This is so inefficient !

You might have heard of Treble that focus on this problem

sadly it's made by google ๐Ÿ‘ฟ and I doubt that they will release all the code. We will see.

If you don't know what is AOSP <--

The question : How to install AOSP on a "Supported device"

I've always use only google-free smartphone ! But OMG it's time consuming.

  1. Found a smartphone ( with the spec you want and in your budget )
  2. Check if you can have\import it in your "country"
  3. Check if someone already cook a ROM that support that specific model
  4. or create it by yourself (even more time consuming )
  5. Sometimes: bypass any protection that prevent to install another ROM !
  6. Finally install the ROM's, boot loader etc...

At this time, when it seem that Treble is not there yet... Do you have a quicker path\Solution ?

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 1 points 10 months ago

yes, it's been years that I'm using CMD and as I'm planning get rid of windows there is no point for me to learn it.

18
submitted 10 months ago* (last edited 10 months ago) by Rick_C137@programming.dev to c/programming@programming.dev

Hi everyone,

Before I was using SendEmail but it seem that it's not supporting TLSv1.3 :/ too bad because the SMTP server that I would like to use require it.

Do you have any solution ( Windows ) to send emails (TLSv1.3 supported) trough the CLI? Not powerShell ! but CMD

view more: next โ€บ

Rick_C137

joined 11 months ago