← prev | next →
𝙻𝚞𝚌𝚊𝚜 𝙹𝚘𝚜𝚎 𝚆. 2022-07-25 16:19:20
computer science students at PUC in Rio de Janeiro Brazil, use this language a lot I don’t consider it difficult
𝙻𝚞𝚌𝚊𝚜 𝙹𝚘𝚜𝚎 𝚆. 2022-07-25 16:21:27
It has a kernel-level implementation on NetBSD, related to lua script, an entire development environment
𝙻𝚞𝚌𝚊𝚜 𝙹𝚘𝚜𝚎 𝚆. 2022-07-25 19:07:47
main mergesort algorithm
function mergeSort(A, p, r)
if p < r then
local q = math.floor((p + r)/2)
mergeSort(A, p, q)
mergeSort(A, q+1, r)
merge(A, p, q, r)
end
end
— merge an array split from p-q, q-r
function merge(A, p, q, r)
local n1 = q-p+1
local n2 = r-q
local left = {}
local right = {}
for i=1, n1 do
left[i] = A[p+i-1]
end
for i=1, n2 do
right[i] = A[q+i]
end
left[n1+1] = math.huge
right[n2+1] = math.huge
local i=1
local j=1
for k=p, r do
if left[i]<=right[j] then
A[k] = left[i]
i=i+1
else
A[k] = right[j]
j=j+1
end
end
end
— fill A with random numbers between 1 and 100
function randArray(A)
for i=1, 100 do
A[i] = math.random(100)
end
end
— print all the elements in the array A
function printArray(A)
for i=1,#A do
io.write(A[i] .. “, “)
end
io.write(“n”)
end
A = {}
— create the original array
randArray(A)
io.write(“Original Array n”)
printArray(A)
io.write(“n”)
— sort the array
mergeSort(A, 1, #A)
io.write(“Sorted Array n”)
printArray(A)
𝙻𝚞𝚌𝚊𝚜 𝙹𝚘𝚜𝚎 𝚆. 2022-07-25 19:08:36
a modeled lua merge algorithm
𝙻𝚞𝚌𝚊𝚜 𝙹𝚘𝚜𝚎 𝚆. 2022-07-25 19:12:01
I already wrote a code like this but with a different functionality I wanted to attack a Russian forum, I was easily successful, knowing the semantics
Shah_baaz2 2022-07-26 08:36:59
Hi
How i can install any package without adding the user entry in /etc/sudoers
marcotrosi 2022-07-26 08:48:19
Shah_baaz2 2022-07-26 08:36:59
Hi
How i can install any package without adding the user entry in /etc/sudoers
Which distro again?
Shah_baaz2 2022-07-26 08:49:47
Mostly linux oel 7.6
But it should work in all distro
watzon 2022-07-26 08:50:01
Run as root? Lol
watzon 2022-07-26 08:50:55
Are you trying to bypass sudo? Meaning you can just install any package without entering your password?
watzon 2022-07-26 08:51:13
Or are you just trying to avoid having the user be in sudoers?
marcotrosi 2022-07-26 08:51:19
I think he is referring to his earlier problem where he had to add users to sudoers in order to be able to use a installed tool
watzon 2022-07-26 08:51:39
Hmm
smol_mazunki 2022-07-26 08:51:55
Shah_baaz2 2022-07-26 08:36:59
Hi
How i can install any package without adding the user entry in /etc/sudoers
there are a couple of alternatives: either add yourself to the wheel/root/sudo group and permit it in sudoers (no need to add each user indivudually)
smol_mazunki 2022-07-26 08:52:07
you can also like doas if you don’t like sudo
smol_mazunki 2022-07-26 08:52:27
alternative you could learn to configure polkit which offers a bunch more configurability
marcotrosi 2022-07-26 08:52:27
In my opinion installation with root and then the tools should be usable
smol_mazunki 2022-07-26 08:52:41
(use pkexec to run stuff through polkit)
smol_mazunki 2022-07-26 08:53:30
installing packages as root is not /the/ best option though, instead have a user like :portage or whatever, and add the users you want to be able to install stuff to it
smol_mazunki 2022-07-26 08:53:41
portage is just one example of a package manager which supports it
smol_mazunki 2022-07-26 08:54:07
last option would be to not install stuff system-wide, but instead use a user prefix instead
smol_mazunki 2022-07-26 08:54:32
or manually placing the binaries into any directory you have access to into PATH (you can usually change PATH as a user, unless you’re in a secure shell)
smol_mazunki 2022-07-26 08:54:43
~/.local/bin is usually in PATH by default btw
smol_mazunki 2022-07-26 08:55:44
i also /think/ you can use cgroups as an alternative to polkit, which is an in-kernel module to define permissions… but i have no idea how this works
Shah_baaz2 2022-07-26 08:55:47
watzon 2022-07-26 08:50:01
Run as root? Lol
No na, requirement is any user can install our product but in installer we are calling timezone packagekit etc/etc appending some more changes in system configuration
Shah_baaz2 2022-07-26 08:56:08
smol_mazunki 2022-07-26 08:53:41
portage is just one example of a package manager which supports it
No third party tool allowed
watzon 2022-07-26 08:56:34
If your installer is adding/modifying system files it has to be run with sudo permissions
watzon 2022-07-26 08:56:39
Not a whole lot of way around that
smol_mazunki 2022-07-26 08:56:46
if you just want to deploy stuff for users instruct them to place a symlink to your binary in ~/.local/bin
watzon 2022-07-26 08:56:53
This ^
smol_mazunki 2022-07-26 08:58:30
on another note, i absolutely hate the current directive of PATH not supporting subdirectories, and how pip and friends just dumps their shit into ~/.local/bin
Shah_baaz2 2022-07-26 09:06:48
I will share all list of file for where i am getting permission denied and we can check what can be done to resolve it in reference to enable other user
neovoidtk 2022-07-26 09:35:23
is this c lang group?
neovoidtk 2022-07-26 09:35:35
i mean can i ask c related question?
marcotrosi 2022-07-26 09:38:18
neovoidtk 2022-07-26 09:35:35
i mean can i ask c related question?
you can but I can also give you a private C group
← prev | next →