#unix
1 messages · Page 7 of 1
I mean, is there a distinction between the set of all characters available in unix-like systems and the set of all characters that have a unicode representation?
Hm. Well, Unix filesystem paths don't need to be valid UTF-8 strings, which might sort of be what you're asking about
Other than that, I guess it might depend on what you mean by "available"...
I'll read up on UTF-8, that'll get me started. Thank you!
file paths on unix-like systems are blobs of bytes with no particular file encoding.
unicode is an abstract system of representing text as a sequence of "code points", so it's not really relevant to things that are blobs of bytes (nor is there a clearly defined idea of a "character" in unicode).
there are several systems for representing unicode in a string of bytes. these are called encodings. the most preferred encoding for general use is UTF-8, but you'll also see UTF-16 and its ancestor UCS-2 occasionally (notably in Javascript), and internally some systems (like Python) use UTF-32 because it has certain desirable characteristics. in 2023, most webpages and "text" files on your computer should be encoded in UTF-8. ideally the same is true for file paths, but there's no strict requirement that it be true. this is what godlygeek was talking about.
see here for an interesting discussion https://dwheeler.com/essays/fixing-unix-linux-filenames.html
This article will try to convince you that adding some limitations on legal Unix/Linux/POSIX filenames would be an improvement. Many programs already presume these limitations, the POSIX standard already permits such limitations, and many Unix/Linux filesystems already embed such limitations so it'd be better to make these (reasonable) assumptio...
These are important clarifications, thank you very much! I'll get on reading the link you linked.
I don't know what "unix-interpretable" characters are, but I think unicode can represent any character including 8-bit ASCII
unicode is intended to be able to represent all of human writing yes
it's basically 1 number per "code point", but the notion of a visible character is more like what unicode calls an "extended grapheme cluster"
and yes the lowest numbers correspond exactly with ascii, and very closely (but not exactly) with latin-1, iso-8859-1, windows cp-1252, et al
that is, ascii character 1 is unicode code point 1, ascii character 2 is unicode code point 2, etc. the "basic latin" block of unicode is the set of ascii characters.
the lowest 256 code points of Unicode correspond exactly to latin-1 (aka iso-8859-1)
the "basic latin" block of Unicode comes directly from ISO-8859-1
!e print(all(chr(i) == bytes([i]).decode("latin1") for i in range(256)))
@summer trail :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
i wasn't sure about that, thanks for clarifying
maybe windows cp-1252 is the one that's slightly incompatible with unicode? i can't remember
yeah, cp-1252 overlaps a lot with latin1, but not entirely
i am getting this permision error even though i am giving the the permission to the user pcmcom with chown -cR pcmcom:pcmcom but still i nginx can't access the file. what permisson should i give and to whom?
2023/08/13 10:42:04 [crit] 11578#11578: *11 stat() "/home/pcmcom/paymall_frontend/web-build/index.html" failed (13: Permission denied), client: 47.29.161.81, server: domain.com, request: "GET / HTTP/1.1", host: "domain.com"
Your nginx is running under the user pcmcom? It usually runs as www-data AFAIR
hello
I run ubuntu on Oracle vmware
today had an error while starting: failed to send host log message
can anyone help me?
I googled it for you. https://www.remembertheusers.com/2022/08/0853-failed-to-send-host-log-message.html
The ongoing challenge of using free/libre software.
I'm new to programming
But you'll find lots of other people suggesting lots of other things so just keep at it
Well found nothing fancy
oracle vmware? what's that?
VMWare - a Virtual Machine controller (a la virtualbox)
I get the "failed to send host log message" all the time; it doesn't appear to mean much - nothing nasty has happened whenever I get it, at least ;)
VirtualBox isn't VMware, they are competitors. It was clear that you probably meant VirtualBox.
But anyway, like I said, there are plenty of potential solutions to that warning a web search away.
I didn't say they were. I said "a la virtualbox" - i.e. in the same mannter that virtualbox is
Yeah, I'm just trying the blacklist option
Yes but what is "oracle vmware"?
VMWare is made by Oracle
fwiw, it seems there's an issue in the vmwgfx driver - there was an addition to send a log message from the driver to (afaict) the hypervisor. But virtualbox (and presumably VMWare) don't have anywhere to receive that message. Hence the error.
I had misunderstood dowcet's post as saying that the vmwgfx driver wasn't needed if you were using VMSVGA. This isn't the case - it is needed. After putting the blacklist in place, and then updating initramfs to exclude the module, the machine rebooted, but I couldn't use X (oddly I could get the DM selector up, but then got a blank screen with no WM)
Here's the virtualbox "bug" repport on it: https://www.virtualbox.org/ticket/19168#comment:4
I cannot run the linux
thats the problem
ARE YOU SURE?
Yes
I don't think that's the problem, you should be able to treat it as a warning rather than an error.
When you see that, are you able to get to another tty (ctrl-alt-F2, for tty2, say)?
Oracle is a company, and VMware is a company. Those are two different companies, and AFAIK one didn't bought another.
Ah - Oracle provides a VMWare service
Interesting. I'll swear I've seen Oracle branding for more than just a VMWare hosting service. (Which is also what I assume the OP has seen)
VirtualBox is by Oracle
Broadcom owns (or intends to own) VMware; Oracle is separate
Does unix have no such thing as global (OS wide) (named) mutex?
not sure. If such a thing existed, it'd almost certainly live in the file system.
I actually don't remember exactly what a "mutex" is but perhaps POSIX semaphores would help you do whatever you need -- https://www.gnu.org/software/libc/manual/html_node/Semaphores.html
Semaphores (The GNU C Library)
Yep anything like that would be under POSIX…
Hi, don't know if it's the right server to me asking in, but i've got two tarballs, control.tar.gz and data.tar.gz and would like to make it into a debian file. It used to be in a .deb file but i extracted it to do some edits on the control file, but now i can't figure out how to make it into a deb file again
I think this should work:
echo 2.0 > debian-binary
ar r outputfile.deb debian-binary control.tar.gz data.tar.gz
But if at all possible, try to build it with dpkg-deb instead.
I don't know what the input to dpkg-deb is, but you can just concatenate two (unzipped) tarballs directly
Hi guys,
Got a problem.
Scenario -
I'm trying to install python 3.8 or higher to goDaddy shared hosting.
Got some nice stuff in this blog - https://www.godaddy.com/resources/skills/how-to-install-and-configure-python-on-a-hosted-server
The 3.4 version is working fine.
But when I try to compile the 3.8.
There is always an pip SSL error.
Here is a link which I was following to resolve the issue - https://jhooq.com/pip-install-connection-error/
I have tried everything in the blog.
Tried asking ChatGPT too.
The answer was to add --with-ssl at the time of configure.
It throws an error that this flag is not defined.
I'm stuck with it.
Any help will be appreciated.
The vast majority of Python-based apps will run just fine with Python 2.6.x or 2.7.x.
LOL, no... this article is from 2015.
What version(s) of Python does your server actually have? What OS?
I've never used QTile and I don't know if anyone here does, but that's what r/unixporn is for.
as this is unix channel, i think asking here abt qtile config file and discussing abt it is legal
as qtile doesnt use script lang, but python.
Legal, yes. Fruitful? I guess we'll see...
I do use qtile, but my config is just the basic stuff from the site. There's a qtile server…
https://discord.gg/pfGSmRfC
Let's see if it's whitelisted… :D
They have a #showcase channel
KDE vs GNOME3 for 1920x1080 display?
Whichever you prefer
oh, i didnt even knew they had a disxord server
thank u :3
for display it doeant really matter, but if i had to choose between the two, i would def pick out kde
both are super bloated, but at least kde have smth going on for it
I definitely feel that Gnome is heavier/clunkier/slower than KDE. That is just a feeling from trying it a few times in the past, though. I haven't installed Gnome in a while.
I gave up on "linux on the desktop" long ago.
Hello
Please don't spam so many channels. Just ask your question, or make your statement, in the channel that's relevant.
This is more of a linux question but I am working on a python project with a shell script to streamline the dev process.
My project consists of a virtual env and the source files. I want the script to activate the venv, cd in the source files and then run the program. Once the code is done I want to exit. I've been trying to create a subshell with (), but once the script exists the directory is still changed and the venv is still active. I often ctrl-c out of the program so a quick cd back and deactivate command won't cut it here.
I have a simple script
#!/bin/bash
start() (
. .venv/bin/activate;
cd src;
python main.py $@;
)
start
How can I make sure the changes I make in the start function are not carried into my terminal?
I'm not sure I follow exactly what you're trying to do but seems like using subprocess in Python instead of Bash could make this fairly simple?
I want the venv to not be active and the directory to be src/.. once the python script has exited. Currently the terminal has the changes that were done within the script
u can run scripts from venv without its activation
venv/bin/python3 script_file.py 😉
This looks like monstrocity 🙈 u a doing smth wrong. Why did u write it
Are you trying to solve your Path path discovery problems?
https://github.com/sde1000/python-wayland/blob/master/wayland/client.py#L62
so Python Wayland doesn't have any dependencies. it communicates through the wire protocol, my only question is how the socket knows what to do? (XDG_RUNTIME_DIR)?
same with libei(emulated input for wayland)
wayland/client.py line 62
xdg_runtime_dir = os.getenv('XDG_RUNTIME_DIR')```
its literally sending a bunch of byte streams.
The server starts a libeis context (which can be integrated with flatpak
portals) and uses the libeis file descriptor to monitor for
client requests.
ah god
im really stupid.
in python-wayland
Doesn't wrap libwayland, instead reads Wayland protocol description XML files and speaks the Wayland wire protocol directly.
is it something that automatically going to work under the hood? but then why libeis is needed and sometimes its not(python-wayland)?
I just don't understand how a bunch of byte streams make any sense to a socket which is 'XDG_RUNTIME_DIR', I can't believe that the only requirement is to use wayland as a display server.
yes i want to run my program within my project folder but have my code in the src dir within it. i didn’t think about the first message tho lmao
path_to_venv/bin/python3 src/main.py 😉
and no hacks are required.
issue there is my paths are incorrect. i remember changing the pythonpath env but that had an affect that i don’t remember and i’m not at my desk
i recommend running as path_to_venv/bin/python3 -m src.main though (and having __init__.py file in src folder)
then u can use absolute imports like
from src import asd
and importing any other folder u have in project
u must never change pythonpath env. this is path to doom
it’s in a .env file in my project and it works with that
😬 rethink your life choices. this is really bad approach in python
messing up pythonpath leads to only suffering
i set pythonpath in my projects but i know exactly what i'm doing and it's largely a workaround for institutional inertia
personally i'd rather python -m build and copy the wheel into my docker image, but instead of copy the src/ dir and set pythonpath to src
it's not that bad in general if you have a well-organized project and you don't want to involve pip or wheels
Well... But, if u start setting multiple paths into pythonpath, then all hell breaks loose for sure 😁
its possible, but again requires discipline
e.g. we have scripts/ and source/, the former being for things that we only use in the repo for dev stuff, and the latter being the app code
both are added to pythonpath, then we add tests/ (via the pytest option, not in the env var) to run the tests
so scripts/generate_test_data/ is a module with several files and we can invoke it as python -m generate_test_data
that said, it's the kind of thing where if you have to ask whether you need it, you don't need it or shouldn't try to use it
what you should almost certainly never do @echo tinsel is set it and forget where you set it
it's like PATH itself, it's your responsibility to manage it
oh yeah you can just put it in a .env file within the head of the repo (for the purpose i had)
why will not having as all of them as just packages 🙈 (with __init__.py inside)
and running code as python3 -m script.generate_test_data
then u can sanely importing in absolute paths code between all of those folders
i don't want scripts/__init__.py, some of the scripts aren't python
(it works even without the init file, as a namespace package, but imo that's just goofy)
why not, it is just to make scripts launchable, and having proper accesability to source code via absolute paths
it is not like it is going to be bundled into package deployed. there is a choice to select what is deployed
partly because i don't think it's any better than setting PYTHONPATH, and partly because it's abusing the namespace package functionality to do a job that it's not meant to do
obviously this is all kind of ad-hoc and you should use whatever you like. but this works well for me and i don't dislike it
but without PYTHONPATH u can have your project working in dev env and unit testable without any additional problems
or at least with less problems
it serves more dev friendly configuration discovery for other devs (or to you in a year later 😄 )
the source code is still in src/ like you'd expect
and we tend to wrap things in a shell script or makefile anyway, that's just the house style
i'll draw a card of person that setups project configuartions, automating, CI code and deploys apps
I would honestly hate such additional problems
there is enough problems to deal as it is in any project
i do some of that, but never for other people's projects
i'm sure things would be different in a bigger organization
Speaking of awesome settings. Pydantic has settings module 😄
from . import types
from pydantic import BaseModel
from pydantic_settings import BaseSettings, SettingsConfigDict
class SettingsB(BaseModel):
debug: bool = False
celery_redis_host: types.RedisHostAddress = types.RedisHostAddress("redis://localhost:6379/0")
discord_channel_health: types.DiscordWebhookUrl
discord_channel_news: types.DiscordWebhookUrl
telegram_bot_token: types.TelegramBotToken
telegram_channel_health: types.TelegramChannelID
telegram_channel_news: types.TelegramChannelID
log_level: types.LogLevel = types.LogLev.DEBUG
test_mode: bool
class Settings(BaseSettings, SettingsB):
model_config = SettingsConfigDict(env_prefix='', case_sensitive=False,)
i love it.
e.g. another option would be to make it all pip installable so you could pip install -e . and get all scripts, app code, etc. in your enironment under a single namespace package
yeah we use that extensively
pydantic has certainly grown on me, despite several annoyances
why split settings into two classes, instead of inheriting from BaseSettings directly?
i haven't used pydantic 2.0 yet so i'm not sure if that's a 2.0 idiom
probably should remove such complication 😄 not really having major impact though
fair enough
the 2.0 migration is going to hurt a bit. we have a lot of small apps using BaseSettings, several of which have custom validators and other hooks into pydantic behavior
i thought there will be time i will need Settings without ability to get settings from env. (apperently i did not)
you can disable it, at least in 1.0 you could with MySettings(_env_file=None, **kwargs) or something like that
obviously not pretty
Does android count as unix
unix-like probably, since it uses a modified Linux kernel
what does "count as" mean?
Does it count as a unix operating system
Is it
A
Unix
Operating
System
Or
A
Unix
Like
Operating
System
Do
You
Understand
Now?
Andoid it not a UNIX
However, Android is based on the Linux kernel, which is a Unix-like operating system
no I don't understand
since I don't know what those terms mean, precisely, and neither do you
it is and it isn't.
is MacOS Unix?
is Windows with WSL Unix?
until you define what "Unix' means to you, it's impossible to answer.
Does it have to have the famous hierarchical file system? (I actually don't know if Android does.)
Does it have to be multi-user?
Does it have to have a shell and a C compiler?
Does it have to share code with the original implementation from Bell Labs?
Yes
It does
ah now we're getting somewhere
like I said: I honestly don't know if Android does.
my point is: "is it unix" is impossibly vague; but those questions I listed above are at least answerable.
I understand
so come up with a list of questions of your own, that define what "unix" means to you, and see what the answers are for Android.
Android is Linux. If you consider Linux to be Unix, then Android is as well.
Ok, now I know to avoid Flatpak! I will try to steer clear of Wayland today and hopefully I can get my setup working again.
My vnc is, not happy. Used tiger vnc previously but after upgrade to ubuntu 22 it has been fighting against me. Anyone else with vnc experience/opinions?
"fighting against me" is pretty vague so your guess is better than ours. If the problem is server side, check the logs for errors. (Not sure if the client has a log or not)
My understanding is that Android once had the linux kernel, but it has been changed so much over time that it really can't be considered "linux"
still has the linux kernel, but I tend to agree with the rest of what you said
The Ship of Theseus is a thought experiment about whether an object which has had all of its original components replaced remains the same object. According to legend, Theseus, the mythical Greek founder-king of Athens, rescued the children of Athens from King Minos after slaying the minotaur and then escaped onto a ship going to Delos. Each yea...
What about Linux has been changed in Android? It literally ships an (AFAIK unmodified) kernel, in my case it's 4.19.269 (Settings->About phone->Android version).
The Linux Foundation maintains the Linux kernel. Google maintains the Android kernel. I have not looked at the source code for either but I would be shocked if they were identical.
They add patches that are "relevant to Android", and then they have some stuff on top, it seems. https://source.android.com/docs/core/architecture/kernel
Looks like the GKI builds are a cut-down version of an LTS kernel which then allows modular additions for vendor-specific drivers and the like
Considering they continuously merge Linux kernel changes into Android, there's no Ship of Theseus situation. You could use the Ship of Theseus to argue about whether macOS is really BSD, but not whether Android is really Linux. It's not a hard fork, they continue to contribute to Linux kernel development, and continue to pick up new kernel versions and new modules.
well, I meant they've only got the kernel, and little or none of the userspace -- to me, Linux is more than just the kernel.
sounds like you're referring to Stallman's "GNU+Linux" 😂
“Unix” has two meanings:
- A legal trademark
- An informal term for a set of traditions about how an OS is supposed to work.
I'm trying to figure out what to put in my xstartup, but if I put something incorrect it seems like I botk some state and have to reboot my machine to get back to a clean slate.
I'm using tigervnc. I will see if I can find some logs
Oddly appropriate essay
https://utcc.utoronto.ca/~cks/space/blog/unix/UnixTechnologyAndIdea
You shouldn't need to reboot - at least not if you're using something like startx to get your GUI up and running (after which you can migrate to a DM which handles that at boot). You can use a second tty if the first locks out because of changes to the GUI setup.
Android's lower-level components are Unix-like. Being Unix-like is inheriting features and functionalities from the original Unix operating system. Android's user space is not Unix.
What do you mean? Migrate?
As in don't use the DM until you've got it working without. first
I did that earlier:
You will often hear Linux described as a “Unix-like” operating system, or a “Unix clone”, and “not real Unix”. Sometimes people will point to the BSD derivatives and claim that they are “real Unix”. ...
I have my regular default Ubuntu 22.04 setup with gnome and Wayland (I think) working. And I'm happy with that. Can I get that same environment working over vnc?
Probably. I have managed to cobble together a tigervnc setup that seemed to work, but it took me a lot of wrangling and reading of online howtos - several of which I'm not sure were necessary :|
Let me see - I did start doing my own write-up of what I did to get my company PDE to talk nicely over VNC
That would be greatly helpful, thank you.
Looks like https://www.tecmint.com/install-vnc-server-on-rhel-8/ was the guide I used to get mine up and running. I know it's for RHEL, but all the same things should apply where it's not RHEL-specific
There are some changes I make to ~/.vnc/xstartup, too - to specify which user gets which port :5=user to map port 5905 to be used by user user (remote port is 5900 + the display identifier used here)
Aha. Looks like the session (DE) is selected by adding a session=... line to /etc/tigervnc/vncserver-config-defaults. I'm sure there's more, but my notes are more just a command history atm - I was trying to flesh them out, but ran out of impetus ;)
Thanks! Could you share your xstartup script?
how is the loopback device (localhost/127.0.0.1) virtualized? is it treated by the OS as a standalone I/O device?
IIRC, the loopback address is special cased in the kernel's IP stack
as in, it's not treated as an I/O device at all
any packets to that address are routed directly
noted, thanks for the help!
It really just has bash :5=user
Depends on the app, but basically, you search the web for a copy
what is "an app"?
you can go to the app's website and get the required version
bash auto completion: what could be the reason I lose autocompletion after git in some shells? Does anyone know how to troubleshoot bash autocopmpletion?
Where is it working and where is it not?
Maybe relevant: https://stackoverflow.com/questions/36795816/git-auto-complete-not-working-in-bash
It works in my first shell, but not if I from that one launch a subshell, see: https://unix.stackexchange.com/questions/755147/how-to-troubleshoot-bash-completion-for-git-not-working-in-subshell
I tried to build Pytorch from source and got this error. Can anyone help?
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.18 or higher is required. You are running version 3.3.2
(base) notooth@localhost:pytorch$ cmake -version
cmake version 3.26.4```
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.18 or higher is required. You are running version 3.3.2
perhaps cmake-gui uses a different cmake version somehow; try updating it or using cmake directly
I set USE_CUDA=1 in setup.py before running python setup.py develop, but I still got this error. How can I fix it?
AssertionError: Torch not compiled with CUDA enabled
You mean the complete settings? I find they’re more trouble than they’re worth.
Maybe. What does complete settings mean? I'm talking about pressing TAB to auto-complete the prompt in bash.
did you export USE_CUDA after setting it?
Yes, I did.
dunno how relevant this is but does anyone know how to make the ubuntu wsl look like the debian one? the white ubuntu text is just kinda bland
but i dont wanna change everything i just wanna change the root@MSI and the ~
looks to me just a matter of installing different console. 😅 try Terminator
i use personally Konsole
i think you just need to set PS1?
do echo $PS1 in your debain one and copy and paste that and set PS1 accordingly in your WSL ubuntu 🤷
also ubuntu's default is the same as debain as far as i know (for regular user), it's just that root's bash is "unthemed", you will get the same experience if you make a regular user
howwwww do i make a regular user?
or switch to a regular one?
oh there we go
hath fixeth thanks
Without using third party libraries in Python, what's a nice way, if any, to read a file in another namespace?
In my case, I'd like to get the mac address of a network interface in another namespace. I'd like to avoid using a subprocess if possible, but my current solution is a subprocess that runs ip netns exec ... cat /sys/...
What is namespace
A network namespace
he seems to refer to network namespaces in Linux, dunno how it relates to files
As in the namespaces feature in linux
and how it relates to files?
I can get the mac address of an interface by reading a file e.g. /sys/class/net/eth0/address
But if my python process is not executed in the same network ns as the interface for which I need the mac address, the file won't exist. My python script needs to manage interfaces in different namespaces so executing the entire script in a different ns is not an option.
Namespaces was created for isolation.
If you are running Python process in isolation, you cannot do that. Unless you are superuser or unless you have another process being run outside of isolation.
Hmm yeah I suppose I have to use a subprocess
All forked processes will be isolated as well.
If I use something like python-nsenter even that seems like it requires a subprocess within the context
Maybe not. I'm not too familiar with how setns propagates. If could just setns and then open a file that would be great.
But there's not a convenient way to call setns to begin with. Unless I use ctypes or third party lib
How do I add the process ID to the string format? sh ./venv/bin/python main.py force \ 1> >(ts "[%F %T]" >> cron/stdout.log) \ 2> >(ts "[%F %T]" >> cron/stderr.log) & I'm using ts "[%F %T]" >> cron/stdout.log to prepend timestamps to every stdout line, i.e. py print("Starting up a new instance.") produces: ```
[2023-09-02 05:30:07] Starting up a new instance.
I would _like_ to include the process ID in this format, like: ```
[1509][2023-09-02 05:30:07] Starting up a new instance.
``` where `1509` is the process ID
how do I do that? I've tried sh ./venv/bin/python main.py force \ 1> >(ts "${$$} [%F %T]" >> cron/stdout.log) \ 2> >(ts "${$$} [%F %T]" >> cron/stderr.log) & but I get bash: ${$$}: bad substitution
oh, it's just "[$$][%F %T]"
I just thought of a cool/boring visualization I would like to do. A partial filetree where the folders with the most git activity is listed, and the less touched files are filtered - so that it all fits on one page. So similar to git-heat-map but perhaps as a compare/weighting function to [broot] (https://github.com/Canop/broot)
What do you think, does it exist?
Visualise a git repository by diff activity. Contribute to jmforsythe/Git-Heat-Map development by creating an account on GitHub.
A new way to see and navigate directory trees : https://dystroy.org/broot - GitHub - Canop/broot: A new way to see and navigate directory trees : https://dystroy.org/broot
i think the version with braces is ${$} i.e. the parameter is named $
ah, that makes sense
change your shell to zsh and install oh-my-zsh 😄
oh... it was old messages i was seeing.
nothing new
blech, i am a long time zsh user but those plugin frameworks are nothing but trouble
yeah but its easy to add a "plugin" manually, you source the .plugin.zsh and add its functions/ dir to fpath
it's two lines of code!
ofc you get error handling etc
its just that its too tempting to add a ton of poorly maintained plugins and you get a slow messy shell config
and at least as of when i last used omz, it was very poorly curated
Hi, i have a old surface pro tablet still works great but it has a corruption in one block of memory.i know which address it is.is there a way to prevent os to access that block?
no
@main olive Well, for Windows you can limit maximum available memory via msconfig params. For Linux kernel you can do a similar thing booting it with mem= param. But you should be lucky, and the failed memory addresses should be at the end not at the beginning. And in the first place you should somehow modify those params on a failing hardware.
I found out windows has bcdedit tool to prevent acess memory page
Trying it
msconfig is the same
But this time i only block 4kb
4kb page of memory
I have only 1 corrupt memory
Address*
Sometimes i have bsod
Should be removed last 3 digit
I will make bashscript to automate this because this solution is not permanent
I need to fetch memory list from memtest86 report
tf does this has to do with unix
Is there any book covering the modules like os and subprocess?
Python Expert Programming has chapter regarding parallelism 🤔
may be there is more detailed regarding parallelism
Otherwise there is always an option to read official docs https://docs.python.org/3/library/subprocess.html
Is anyone taking a Unix class in college?
No. But if you have a question you should just ask
i downloaded the whole official docs with httrack, those and the pep-s are probably the best source of information about anything python related
PEPs forever.
Can the same driver be compiled for different minor releases of the kernel?
I took programming, we were just assumed to have all unix knowledge or magically learn it. 👀😨
Hm, I was into linux before i got into programming. Really linux is the reason why i started programming at all.
This was how I learned it https://wiki.lib.sun.ac.za/images/c/ca/TLCL-13.07.pdf
"The Linux Command Line" -- you can find a free copy of it yourself if you dont trust that domain,
you don't need to finish the book really. You can go as far with it as you want to.
@primal sierra
sorry for the mention
so how can i do that
hello?
so the problem is im not able to download linux
"not able to"?
You should already be in an operating system in order to download anything…
"boot into Linux", did you mean?
nah nah
i want just to dual boot
but install linux first
because i dont know how
linux didnt want to install when i tried
Right, so you need some sort of installation media…
tell me what do you mean so i can tell you if i have done it or nah
How did you try to install Linux?
i installed it on a usb which was 4gb but it was mint linux and it was able to be downloaded in it by the use of rufus app and then i tried to open boot manager on the old laptop to open the usb but it didnt recognize it so i opened the boot menu to enable the legacy thing and secure boot as my old laptop is legacy boot thing but the weird thing i didnt find them and till now i dont know what to do like most of my boot menu is empty (i dont know how it is a boot menu XD)
So when you put the USB stick in, and boot the PC, you don't see it booting from the USB stick?
i didnt even see the usb stick name appearing or any
i checked if its recognized on windows and it was
What does happen when you boot with the USB stick in?
nothing it just shows me the normal list of boot menu and i choose the boot manager to see the usb but all i see is a hardware and cd and both when i clicked them boot me to windows
OK, you may need to enable booting from USB in the BIOS
didnt find it
fr my bios is weird
i have been trying all the solutions on yt for hours and i didnt find any
the bios is empty
like it has few options
which are useless
is it possible to boot the usb from windows?
cuz this bios wont help me ig
No, you'll have to find the option in your BIOS to boot from a USB, or write a CD and boot from that - but that would mean it's a very old BIOS.
Some BIOS have an "advanced" mode that you need to enable…but that should be an obvious option
i5 2nd gen 4gb ram (I added 2gb )
i just wanna revive it for normal use and linux would be enough for that
i tried to search about the name of the laptop and its bios and got no video
fr its empty i dont know where to find that
What BIOS is it? (I'm not sure how much further I can help, tbh, but that may point me towards some details of what you might need to do)
Probably not. Doesn't the BIOS screen give a name?
The motherboard details could help, I guess
okay wait lemme search the motherboard name
where can i find the full name of the laptop
and its motherboard name?
In Windows you should find that in the system info
i opened the dxdiag thing and it says the bios name is
InsydeH20 Version 03.61.0 1F. 42
its name from dxdiag the bios
i dont have the info of legacy bios
and secure boot
thats the issue im facing
is the only chance is to boot from windows?
the problem is its the same bios as mine
:/
when I installed linux I recall having trouble with UEFI vs legacy boot
iirc the issue was that windows10, which I dualbooted with, only supports UEFI, which was somehow nontrivial to install linux mint with?
ye my device is the opposite actually so thats why im facing a problem but i dont know what to do actually
use Rufus
it makes USB automatically friendly to all those systems 🙂
did that
¯_(ツ)_/¯
oh? Most modern distros expect UEFI, I thought. it's usually a lack of UEFI support in the hard/firmware that causes issues (although I do recall Mint being odd) But the Insyde website suggests the BIOS should support UEFI
ye
is it possible to just boot from windows
or any of that
Have you tried using a different USB port?
I no longer remember what the issue was, maybe I had to disable secure boot
nah
(one of the other suggestions from that link)
Yeah, disabling secure boot is probably a necessity
i dont even have that option and thats why im confused
(I have to switch between secure and non-secure for my dualboot setup)
is this laptop a mad one or sth?
If you don't have the option it probably means it's not an issue
but ofc there is a solution and i believe in that
(i.e it's not capable of secure boot, anyway)
I'm sure you're just missing something in the BIOS settings…but not being able to poke around in it myself sort of limits how much more help I can be (plus it's bed time!)
ik your tried to help as good as possible and i appreciate that
your a good man
maybe i will try to see more vids or sth xd
Gn
You're more likely to find answers on things like stagkoverflow or hardware-specific bulletin boards, I imagine
okay ima see that then
yo again
i did it man!
this laptop is so buggy in bios and so old
so thats why you keep dragging the usb option up to the top cuz there is no usb enable or disable
and thats it you try to open bios manager again
i kept trying for so long xd
disabling secure boot part 1 of why I don't dual boot anymore. Part 2 is the ease of virtualization.
thats just an old laptop anyways so ye
i wanted to see if it will be fast on it
but tbh linux was doing good well on it
the linux mint
@woven trench you can tell by looking. ls -l includes a header line
Im running a linux box in runlevel 3 and i need to make the screen blank work bcs the monitor wont shut off. Anyone know how to enable that ?
Maybe try these suggestions? https://askubuntu.com/questions/62858/turn-off-monitor-using-command-line
I would probably just unplug the thing though 🤣
I really thought about that😄
Assuming you use systemd, it's sudo systemd-resolve --flush-caches
messing with path is fun
oh wow discord did a silly
apparently that conversation is from like a long time ago
it showed it as the most recent conversation until i sent the message, then it decided to load a bunch more stuff in between
Does installing a screensaver work? I'm pretty sure xscreensaver has a "blank" option if you actually want a blank screen (although I doubt it saves any power over running some of the simple screensavers)
run the toasters!
A fleet of 3d space-age jet-powered flying toasters (and toast!) Inspired by the ancient Berkeley Systems After Dark flying toasters.
http://en.wikipedia.org/wiki/After_Dark_(software)#Flying_Toasters
Written by Jamie Zawinski and Devon Dossett; 2003.
XScreenSaver is a collection of hundreds of free screen savers for X11, MacOS and iOS. D...
There are so many good screensavers in xscreensaver :)
Oh I give up. was almost there looking down /etc/X11 paths for how it boostraps and found that yes there is a mate-screensaver-preferences but it only does the window manager. So ill just use runlevel 5 😄
Ah, I didn't twig RL3 was non-graphical…it's been a while since I used numeric runlevels (although not that long!)
guys... I need some help
using virtual env, why keyring doesn't save password?
my virtual env is selected using source.. but when I use keyring library
I can't make it save password
SOLVED
my keyringrc.cfg file had a bad default.. keyring.backends.empty
I added SecretService and now it saves keyrings credentials
I cant imagine what it would have been like to use linux desktop in 2003.
i didn't install linux until like 2013, and i didn't become a power user until about 2017.
I always hated it tbh
I'm pretty sure I had used linux in the sense that I used web servers as early as 2001 but I didnt admin or fully understand them.
I bought my first Mac in 2005
I adamantly hated mac in that time period, but it wasn't exactly an informed opinion. Back then I didn't have problems with Windows and did not consider using alternatives at all.
Anyone well versed in pop o.s and Msi?
Don't ask to ask, just ask
You are correct, thank you for the advice. I solved the issue.
I couldn't figure out why security features on my new motherboard were locked. I figured out the issue was not having an admin password set. Once it was set, the secure boot could be disabled. Installation of Linux was possible.
disabling secure boot in 2023 = L
whats so bad about running fastapi with sudo (besides that the packages are annoyingly installed in a non normal place) when you want it to be https and read .pem files? im not a linux pro, is there a safer way? I don't want to give up on running fastapi as https, I'm thinking there's something smarter to do with the file permissions
it's pem files certbot put in /etc/letsencrypt
The easiest way would be having a reverse proxy (e.g. nginx, Caddy) that runs on port 443 which then hands the traffic to FastAPI running on some higher port. You can also delegate the https stuff to the proxy then.
oh, so I can configure nginx itself to have the pem files? ill have to try that I think that might fix another problem I'm having with needing to expose the fastapi port
Even better, you can configure it to get the certificates for you. With Caddy that is even the default.
Can anyone here assit me with a Samba share configuration issue on a linux machine?
hey im using freebsd machine and when entering command df i get 1k blocks but i want to change it to 512 byte blocks. anyone know how i can do that?
df --help should show you the various options
failing that, try man df
I don't have a freeBSD machine handy so I can't do it for you
you might also have "GNU df" available as gdf. If you do, it does the same stuff, but with fancier options.
DF(1) FreeBSD General Commands Manual DF(1)
NAME
df – display free disk space
SYNOPSIS
df [--libxo] [-b | -g | -H | -h | -k | -m | -P] [-acilnT] [-,] [-t type]
[file | filesystem ...]
DESCRIPTION
The df utility displays statistics about the amount of free disk space on
the specified mounted file system or on the file system of which file is
a part. By default block counts are displayed with an assumed block size
of 512 bytes. If neither a file or a file system operand is specified,
statistics for all mounted file systems are displayed (subject to the -t
option below).
The following options are available:
--libxo
Generate output via libxo(3) in a selection of different human
and machine readable formats. See xo_parse_args(3) for details
on command line arguments.
i searched it up
well I'm not gonna read it for you 🙂
ik but i couldnt find a command that would change the bytes
so it says it shows 512-byte blocks by default.
Maybe your df is actually an alias to df -k or something.
its 1k blocks
I'm not following you.
i want to change it to 512 byte blocks
yes I understand.
but i cant find the command to do that
yes, I understsand.
try /bin/df instead of just df; see if it does anything different.
that's quite puzzling, since the man page clearly says
By default block counts are displayed with an assumed block size of 512 bytes
Are you sure it's displaying 1k blocks?
yes
no offense, but ... how do you know?
thats why i want to change it to 512 bytes. because thats what it outputs lol
yes I understand that
i found this online df -k | awk 'NR == 1 { print $1, "512-byte blocks" } NR > 1 { printf "%-20s %10d\n", $1, $2 * 2 }'
I don't understand why you're showing me that
yeah that awk stuff looks like it's just multiplying the output by two, which is reasonable
I have a dual boot system, I'm using Fedora with Nvidia and Wayland. Electron apps such as Discord and vscode are laggy what do you guys recommend? Should I go with pycharm instead, any ideas?
I use neovim directly in the terminal
i have no issues with electron apps performance-wise on Xorg, resource-wise they are a joke though, i use vim as well
sublime text, kate, lots of options
yeah, pycharm / clion / intellij / etc are all the same core application as far as i know
I mean they are working fine, I can't really use electron apps, I have to open discord from the browser.
well if you like pycharm then there's nothing wrong with it
"If you like your IDE, you can keep your IDE"
President Obama
"Stop making up quotes I didn't say"
- President Obama
hm i wonder why you cant open electron apps tho.
I have nostalgia for kate sometimes, since that is what I learned to program in before i knew what i was doing. It's a decent editor if you're working from a true piece of junk but you still want something graphical. It's eventually apparent how many features you're missing out on by using it but if you're learning to program you wont miss that stuff anyway
hello
What to practice in linux os
practice finding out which programs are using up all your CPU or memory
Can I ask for help here with a shell script I'm trying to run that has a problem?
don't see why not
Can anyone here help me figure out a problem with a shell script I have? I have a script to download subtitles for a movie but it doesn't work for some reason because the path has a space and special characters in it. I have no idea why and I've been unable to figure it out for a long time: https://paste.pythondiscord.com/4CTQ
I get this output ```sh
$ bash ./opensubtitles-dl.sh -n "Jarhead 2005" -l eng -o "/media/jb/T7/Movies/movies/Jarhead (2005)/Subtitles/eng"
/media/jb/T7/Movies/movies/Jarhead\ (2005)/Subtitles/eng
/usr/bin/curl https://dl.opensubtitles.org/en/download/sub/{6073089} -o /media/jb/T7/Movies/movies/Jarhead\ (2005)/Subtitles/eng/6073089.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Warning: Failed to open the file /media/jb/T7/Movies/movies/Jarhead\
Warning: (2005)/Subtitles/eng/6073089.zip: No such file or directory
2 46960 2 1360 0 0 3004 0 0:00:15 --:--:-- 0:00:15 3008
curl: (23) Failure writing output to destination
the command it echoes /usr/bin/curl https://dl.opensubtitles.org/en/download/sub/{6073089} -o /media/jb/T7/Movies/movies/Jarhead\ \(2005\)/Subtitles works perfectly fine when run in the terminal
this function specifically contains the problem with curl ```sh
download_subtitle() {
# $1: subtitle id
while read -r id; do
echo $_OUTPUT_FOLDER
echo "$_CURL" "$_DOWNLOAD_URL{$id}" -o "$_OUTPUT_FOLDER/${id}.zip"
"$_CURL" "$_DOWNLOAD_URL{$id}" -o "$_OUTPUT_FOLDER/${id}.zip"
"$_UNZIP" -o "$_OUTPUT_FOLDER/${id}.zip" -x "*.nfo" -d "$_OUTPUT_FOLDER"
rm -f "$_OUTPUT_FOLDER/${id}.zip"
done <<< "$1"
}
it seems that it's interpreting the path as two different paths when it's the same except there's a space in the path but it's escaped so I don't understand why it thinks there are two
I fixed it, I added a bunch of eval commands. I don't think it's the cleanest solution but it works. I'd still like an explanation for me to understand why the initial function above didn't work? sh eval $(echo "$_CURL" "$_DOWNLOAD_URL{$id}" -o "$_OUTPUT_FOLDER/${id}.zip") eval $(echo "$_UNZIP" -o "$_OUTPUT_FOLDER/${id}.zip" -x "*.nfo" -d "$_OUTPUT_FOLDER") eval $(echo rm -f "$_OUTPUT_FOLDER/${id}.zip") }
All I can say is that on the rare occasion that I do bash scripting, I just try to keep my paths clean without spaces and such because escaping properly is often frustrating
all I can say is that: if my bash script grows to more than maybe five lines, I rewrite it in python
The error message makes it look like a whitespace problem, look at where it's trying to write to
You forgot to quote a parameter expansion somewhere
Although I don't see an actual place where that would occur
The evals should definitely not be necessary
Try using set -eux
-eu for safety, -x for a trace of executed commands
You do forget to quote the command substitution in set_args but that's not likely to be a problem
However i think you're confused about how escaping works
x='a\ b' ; $x expands to a\ and b
that's why the eval fixed your problem... the slash escape only works when the shell commands are parsed
same is true in python strings, you can't write "\" + "n" and expect to get a linefeed character... that's kind of what you're doing here
actually i might be totally wrong about that... huh
no nvm i was right
heh
everything salt rock says is why I prefer python to shell
waaaay easier to understand
Has anyone encountered this bug when running an Ubuntu ISO from USB? The ISO runs but there is no mouse cursor, although i can move it and click
I imagine it greatly depends on your hardware 😦
it's actually one instance of the shell behaving exactly like any other programming language
🤷
x='a\ b' ; $xexpands toa\andb
I'd say that's a weird shell idiosyncracy. Off the top of my head, I can't think of any other language that has anything analogous to shell's "word splitting", where a variable's value is parsed as a string at the point where it's interpolated to decide how many strings it should produce. I can't think of another language off the top of my head where a string regularly gets implicitly treated as an array of strings without any explicit call to eval or the like
I am trying to install Linux
But it will show me input output error 5
I googled it for you, but as the comments here explain, we can't give you the solution without more context: https://askubuntu.com/questions/1333763/error-5-input-output-error
This is not the place to go further, look for support based on the specific distro you're trying to install
I used same distro ubantu before this
But I accidentally format whole ssd drive
When I am trying to reinstall it then it occurs this kind of error
Based on a quick read through the comments on the link I provided it sounds like a problem either with the target drive or possibly your installation disk. You'll need to troubleshoot. I would probably start with fsck or another disk check utility
fair, but the way the escaping works i think is consistent with other programming languages
the way i like to think of shell script is that every command is actually just a string, and every usage of a variable is actually a string interpolation into that string
i believe tcl has similar quirks, but i haven't used it myself
I was going to mention tcl...but it's so long since I used it. I think it's also the first time I really encountered multi-level string interpolation, so possibly tainted memories!
quick question, is it possible to encrypt a password for example on python and decrypt on powershell?
everything is possible :/ although easiest choice to do that will be just running in powershell python3 -c "python code to descrpt password; print(result)" 😅
The thing is im on a linux vm right where i have a python script which also contains a powershell script with in it. I am sending this powershell script to another vm through pywinrm. Within this powershell script i am passing the credentials containing the password.
I need to make sure that the password is encrypted before passing it through
I am confused 😕🤔
What is this target deployment vm
What is its OS
its a windows
target is windows source is linux
so in windows os, im going to be running a powershell script
which will be sent through the python script i have on the linux system
Are u admin of this widows, and capable to do everything there?
What is your real intended goal with those encrypting shenanigans
i need those credentials to access a server on the windows machine
You rang?
The main problem is to pass those credentials encrypted
Can't u just put not encrypted credentials and send it?
What stops u from doing that
becauese then its not encrypted
and its not secure
if i send the password through on the powershell script
if not is there a secure string thing in unix?
Your pywinrm should be already creating encrypted connection
What is the point to encrypt twice 🙂
And what is the point to encrypt it in this situation, if u a going to decrypt it at the end anyway
So... with transit already encrypted, it looks like already enough of encryptions to me
If you want to apply AES encryption in Python/Linux and then decrypt in PowerShell, it should be fairly trivial to do so. Have you tried it?
hi
dowset offered good enough option. basically you wish anything that can serve as a symmetric encryption. AES can work for it
although it could be more funny to use smth asymmetric 😅 good old RSA can work too
symetric is going to be more simple for you
https://pypi.org/project/cryptography/ probably something to use from cryptography library for example
>>> from cryptography.fernet import Fernet
>>> # Put this somewhere safe!
>>> key = Fernet.generate_key()
>>> f = Fernet(key)
>>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
>>> token
b'...'
>>> f.decrypt(token)
b'A really secret message. Not for prying eyes.'
they offer fernet right from the start
beware, the library has C lib dependencies i think https://cryptography.io/en/latest/installation/
they offer both linux and windows instructions
@rotund girder any recommendations?
for distro?
I have tried ubuntu 22 with snap
And linux mint
I'm using Ubuntu at home as well at the office, it works
I'm enjoying unix + nvim as my programming environment
But i never really thought of making it my primary OS .
Now i have been using wsl for like 8 months and can't think of using windows again
I use vim extension for vscode
If I had the time and energy, and there actually existed good documentation, I would go for NixOS distro.
But i only use it bcz my keyboard doesn't have up/ down keys(accidentally bought the 60% varient)
vscode is popular 🙂
Never heard of it
I'll look into that one
It might be good to really good with a simpler distro first (I'm guessing now that NixOS is difficult because it's quite a bit special)
(but it's also popular so most application might be easy to install and use anyway! 🙂 )
So they made an OS just to for package manager?
the package manager Nix and NixOS were both created in 2003
so I guess they were co-created
Yes but y not just use it as a package manager
Y does it require an entire os 
Maybe I'll use it as a server
Bcz it looks like it'll be really helpful to setup
As a server
You can probably use another distro + Nix, not sure how much of the cake you get, 50%? 90?%
Have you ever tried arch linux
nope, but that's probavbly really good to learn linux
I need an os which is easier for development and very minimal
But i am afraid of arch😂
Don't wana spend too much time on learning new things
Also security issues(don't know how to setup proper firewalls and stuff)
I just know terminal/shell/prompt/git/vim, some stuff about files/symlinks/pipes/ssh/X but MANY holes
But the holes are fillable with man!
Builtin help is the best!
right, I know nothing about it
time to sleep.
Ubuntu sounds like a good idea
however, the snap application provided by the snap package manager have some problems, if you are lucky you might not notice it
Hopefully i won't 😆
(P.S : i am not lucky)
Damn no wonder this channel is ded
Haha whut? 😂
I have spent like last 7 hours configuring bspwm
There was no option to set 2 monitors(like i can set it up but it always extends display and not add extra space)
If that makes sense
Oh, you didn't get that automatically? Never heard of bsp 😶
I guess you googled a lot already. (https://reddit.com/r/bspwm/s/2XyBTZAdwR)
Sorry I can't be of help, I've only used default Ubuntu windows manager (gnome+X/Wayland) and xfce.
This is for when u disconnect something different.
Well now i installed i3wm
Who da fk is naming these 😂
It is better for setting up display
Just need discord now😭
And then setup my coding environment 💀
Ok it is working me think
I would advise you to version control your dotfiles immediately
Y r there so many pakage managers
Don't ask me, it's crazy
Too late(if u r refering to my github work files)
Most of them r in python so what could go wrong
Apt, Flatpak, packman, nix, ...
Huh? 😳
Github work files. No I mean stuff like ~/.bashrc, ~/.gitconfig,...
Configuration files for your environment
ohh ok never worked wiith them before
Dotfile because it starts with a dot. They are considered "hidden". You want see them unless you ls -a to list all files.
Those two I mentioned are settings for bash and git. Which configuration you have depends on what programs you use I guess 🙂
alright i will
what you think about neovim
previously i was using vscode with vim extension
You only need to deal with different package managers if you use different distros, generally. Although flatpak and <that other one> throw a bit of a spanner in the works.
What do I think about neovim? I think it's a text editor… :)
like isit a good text editor if you want to touch mouse
or iit is hyped?
(much the same I think of VSCode/Codium/etc)
There's a fair learning curve, but if you've already learned some of the vi keybindings, you will be fine
I use neovim and love it!
I have not used any of the neovim "distros" (kickstarter, lazyvim, lunar-, astro-,...)
This is my small nvim config: https://github.com/kaddkaka/dotfiles/blob/main/dot_config/nvim/small.vim
ur github is from 2013 jesus
You make me feel old 🧓 😎
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1000M 0 part
└─sda2 8:2 0 930.5G 0 part
sdb 8:16 0 238.5G 0 disk
├─sdb1 8:17 0 1000M 0 part /efi
└─sdb2 8:18 0 237.5G 0 part /
sdc 8:32 1 0B 0 disk
i am pretty sure i installed it on hdd(1tb)
but it is showing iit was installed on sdd(256gb)
is iit installed on sdd?
How can you tell? I wonder how old mine is..
it shows on github
send link let me see
Ah, maybe only on Desktop, I'm on my phone.
bruuuuuuuuuuuuuuuuuuuuhhhhhhhhhhhh
urs is lder then me
we are actually same age
python was same pretty much even 24 years ago ?
definitely not. It got better 😅
really liking direction of python... evolution in terms of typing
if u are feeling kinky, u can go almost full C# in python now
how can i make mine like this we both are using i3wm
i meant like the syntax
i have never before tried reading py2.x
rate this someone ??
my github is like 2 (1.5)years old
this is sad times of not existing typing. in fact i think typing may be did not exist until 3.5
as well as not existing dataclasses or pydantic
yeah something like
no one uses it though
i went thorugh my code
literally coded that moduel in my sleep every type was wrong
🤣 but python didn't care (bcz it understands us)
RIP
looks like just a wallpaper and top status bar config
although remember that your operating system and desktop is just a tool
spend your time doing actually useful things rather than just making your computer screen aesthetically pleasing
I'm guessing that's https://deskto.ps/a/bar/polybar but who knows. If you want to rice your desktop check out r/unixporn on Reddit
Yes sir i just wanted to use tiling windows and get out of windows
Ok so that's what it is called
git question. Is there any easy and compact way to list all commit messages from sha to HEAD
I want to create change log
Found it git log --oneline HEAD...commit
you might want .. instead of ...
I went ahead with bumblebee for i3wm
Still setting up most of the stuff
Spent like 6 hours setting up ss mechanism
is anybody here good with yacc if so could i send you some files and have you look at it everything seems to be fine (from what i know but im a little dumb) but it isnt outputting anything
How do I install pip in WSL?
Already got python installed but tried using the docs for installing pip with linux, has not worked.
Ubuntu WSL? Probably apt install python3-pip
The Best answer, u don't
Install
sudo apt update
sudo apt install -y python3-venv
And create python3 -m venv venv in desired project folders
source venv/bin/activate
And use pip from there
Right, but what is the install for pip?
It will be auto installed inside venv
What commands?
Marked above
Thank you
breath@MSI:~$ sudo apt get python 3-venv
E: Invalid operation get
breath@MSI:~$ sudo apt install python 3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python-is-python3
E: Package 'python' has no installation candidate
E: Unable to locate package 3-venv
breath@MSI:~$
Fixed space, copy again
breath@MSI:~$ sudo apt get python3-venv
E: Invalid operation get
breath@MSI:~$ sudo apt install python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-venv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3-venv' has no installation candidate
breath@MSI:~$
Might need a apt update
Copy again, fixed. I am badly writing at midnight
Perfect, thank you
Beware, moving between folders venv is not possible.
What do I put here, the name of the venv or the directory?
Name of venv
And then do I put this in as is?
Or replace source with file path for venv or the name?
source is command, don't replace
pip freeze > constraints.txt to freeze deps versions.
Put main deps into requirements.txt (without versions or with minimum sign version or whatever)
Install as pip install -r requirements.txt -c constraints.txt from activated venv
Put venv into .gitignore
Regenerate constraints when wishing 😁
Very manualish and simple default. If wishing automated, learn using poetry
What do I use to deactivate the venv - so it is no longer running, not delete it though.
deactivate 😅
Thought so, just wanted to be sure
😉 u could install eventually btw specific python3.8-venv python3.10-venv packages (u need to install specific python first though)
and create venvs as python3.10 -m venv venv or as python3.8 -m venv venv
Thus having ability to use different python versions for different projects
Oh, I'm not that into it 😅
python3 is just some your system default python3 (don't ever delete it or make changes to it. u will break OS then)
(that is why i discouraged installing pip into system python, to avoid ever deleting smth that your OS relies upon to function)
Just trying to start using Ubuntu more and having a more organised workspace
just nice to know options 😅
i can't dev until i found out
- how to use different language versions
- how to install packages and where they are stored (and how to make your own library)
- also how to record which packages u use and having ability to install them again after repository cloning
- how to delete specific packages
- how to setup using unit testing framework
- and probably with ability how to mock stuff in this language
- how to run specific unit tests via CLI
- how to turn on visual debug during unit tests
- how to write CI to make deployment of app
- and of course how to start application
- preferably again with ability to turn on visual debug during the run
Yeh, I am probably intermediate with Python, I believe I have a few highly advanced topics still to go through but I know more than enough to get around in the language - just struggling with the whole managing my workspace thing.
I am actually moving onto C# which is interesting to say the least.
Is it possible to have a separate WSL terminals running separately? I.e., they are two different instances?
i use pure Linux
i go with Konsole from Kubuntu 22.04 LTS for terminal multiplexor
people tend to like also Terminator as terminal multiplexor
install Terminator 😅 or Konsole
Not sure if u will be able to make it working in WSL though
WSL is not a real Linux
not a guarantee u will be able to even install it there
You should be able to run multiple WSL instances, but I'm unsure if you can run multiple of the same wsl distro (e.g. ubuntu and kali, but maybe not two ubuntu)
i ahve a cloud computing question
have*
i'm running Ubuntu in a cloud instance
and after uploading my Python script and trying to run it nothing happens.. what gives?
So you're logged in via SSH and entering `python3 myscript.py' and then literally nothing happens? You're still connected, there's no error message and you can't type anything?
Without knowing anything about what your script looks like, I would tend to blame that and not the VM
it must have been an error during upload. got it working. now i am trying to figure out how to view png's from command line
any recommended packages? tried eye of gnome, desktop-file-utils..
Over SSH? Not possible. You'd need to serve the file so you can open it locally
apparently i have display and that also fails
so i am saving the png on the instance and trying to open it as i would any ubuntu command line tool
its just not showing up, i wonder if it is firefox blocking a 'popup..'
Did you say this is a cloud based server? Running a command remotely over SSH isn't going to launch Firefox or anything else on your local machine
Unless you really want to go through the trouble of setting up a remote x session, just download the file and open it
what is a terminal?
like i think i misunderstod what terminal actually is
i changed my terminal from xfce to alacrity and it changed themes for other windows??
That doesn't sound normal. Alacritty is just a terminal so its settings should only affect the terminal (and only alacritty)
is arch somehow using terminal configs for other window themes?
is that possible
That wouldn't be Arch, but Xfce (if that's your DE)
You should be able to see the settings from the desktop menu, iirc (I can't recall how you get to them in Xfce)
https://wiki.archlinux.org/title/Xfce (section 3)
thanks
Dislocker problem...
I accidentally shutdown when decrying BitLocker on windows 💀
Can dislocker helps?
Xfce doesn't do that, but you might have changed some global xfce settings thinking they only applied to the terminal
hello can anyone help me with ubuntu 22.04 two finger fast scrolling problem ?
https://askubuntu.com/questions/1413750/how-to-change-2-finger-touchpad-scroll-speed-on-ubuntu-22-04
this solution is not working
This is a unix channel y are we talking linux only here 
"unix" in the general sense, not "Unix" in the specific sense.
It's the speed a problem I'm all applications? Otherwise specific applications might have settings for scroll speed.
how can i change python version on my endevoros(arch) to 3.10 or 3.9 it is currently at 3.11
use pipx/pyenv and friends (not gonna do an exhaustive list)
don't u even think about changing your system python's version
that's what i was thinking
i sometimes get these urges lel
i guess i'll just install it beside 3.11
pyenv install 3.10, then pyenv global 3.10
if i do 2 finger scroll from touchpad it super fast in all app i want to make slow scrolling in all app when i scroll in vs code it fast and in firefox it fast in every app fast !
if i scroll from mouse it normal i cant find settings to slow down !
i have ubuntu install and do u know anything about sway ?
can it help me ?
Probably not the channel to ask, but does any ubuntu user here know how can I screenshare audio without using a third party client?
Depends on your desktop environment but there should be a touchpad setting where you adjust scroll speed
only have this setting its ubuntu 22.04
its gnome desktop enviroment
touchpad speed (range input) only change the speed of cursor in screen not scroll i need controller or low speed in 2 finger scrolling !
I'm not sure if you simply mean "stream audio" or "screenshare with audio" but either way it would require a client of some kind. Are you asking how to write one in Python?
hey
someone here use ubuntu
?
a lot of people don't like it
and it's not very popular in countrys like united states
australia
maybe in london
https://ubuntu.com/desktop/statistics seems to suggest that your statement's quite incorrect
do you… have a question?
I like how "London" gets the status of a country on par with the US and Australia ;)
Darn, didn't know that London even left Britain to become an independent nation.
Are you able to share your screen? Just no audio? Are you using the web Discord client or the installed one?
Installed one
Screen share works just fine, is just audio not getting streamed
Apparently it's complicated: https://www.reddit.com/r/linux_gaming/comments/t0bkw7/psa_discord_screensharing_with_sound_is_possible/
Sometimes I forget discord can be used for stuff other than text messages lol
Ubuntu popular in London? That's a weird statement 😂
linux desktop usage is in general around 2% in the world
somehow did not get stuck with regular people. Windows is more dominating just because they have at minimum agressive company to have it preinstalled everywhere
yet, Linux is perfection for developers
especially for developers in web development, backend and DevOps engineering
OS that has everything working natively for your servers
I personally enjoy Kubuntu 22.04 LTS. it is purrfect
inbuilt multi terminal
comfortable GUI with normal desktop and windows
good working Docker in its native lightweight way. access to all web infrastructure instruments
all dev tools are installed in one or few command lines from apt/snap/wget/deb whatever
Why do people always say "this" distro or "that" distro is better and then show a bunch of theamed screenshots without explaining the underlying difference... was my understanding you could add theams of almost any kind to your desktop environment and its still the same linux... I know "l" ubuntu is "lite" in apps but its just ubuntu... same as mint etc etc.
Can't imagine that "k" is any different ?
the ubuntu prefixes indicate the core DE in use, no?
xubuntu uses xfce
lubuntu uses lxqt
kubuntu uses KDE etc
they just change how the interface looks but not how you manage packages for example
yer so at the core the sane os and on top interchangeable desktop environments that are glorified theams. so in my mind no different really.
within the scope of ubuntu derivatives, yes
Isn’t Kubuntu’s KDE maintained separately or something
Might be thinking of KDE Neon
Gnome is great though
Maybe its skill issue by my part but I've been trying to give it a shot and it's been nothing but problems. I think it wont ever stick with people until most things work out of the box without much trouble.
The ubuntu software/app store, cant remember the name rn, also has many issues so console is kinda the only way of doings things
And normal user wont do that
well, that's kind of the point. Things work with less effort and out of the box for me in Linux
After getting used to Linux... i remember only in nightmares GUI crashing installers of Windows that tell no errors
in Linux... everything is friendly to do from console
GUI is... very optional for most of stuff
that makes stuff automatable, easy to record as dev instructions into git repo README, or automating to run from CI. We just need to record commands to run 😅
I guess being used to helps hahaha
I've just been having nightmares with seting everything up without errors everywhere
not sure what u tried to setup.
Its not like theres is smt in particular
i just use Kubuntu, which has everything configured for me out of the box.
Few things to install via apt/snap/deb and i am good to go
But more of the constant google search "error why"
And the fact that im not versed in the os
I guess im just to used too windows
i used windows for most of my life until i turned 25 😅 including working as windows system administrator
but then i started to work as backend dev/DevOps engineer... and linux just became better (removed need to use VMs in order to access all web tech)
Hahaha
Switching to linux made appreciate more windows actually. I never expected that to be the outcome of this little dive of mine
Still gonna be using it, because its smt i want to learn
i like that in Linux i am indeed admin 😅
once u learned what should not be done to break OS
u enjoy freedom to do ANYTHING
in windows... you are never really admin (illustrated picture above). Even if u are admin, your OS is still forbidding things, any random program can restrict you access :/
I love the customization linux provides
i enjoy being free 🤗 and being sure i am having no trackers or weird processes in background that take 50% of my hardware resources for strange activities
I havent had the need to be that much of an admin yet
Yeah thats a good point
But my problem with linux is more related to compatibility
Like the discord screenshare example i posted a few messages back
weird. probably some not linux friendly laptop?
or u use some weird program for doing that
i'm not an ubuntu fan but i've definitely found my home in KDE
Please how can I fix this?
https://paste.pythondiscord.com/JRMA
No OS, how came you up to this situation
plus, pipenv is kind of deprecated, use poetry 😅
No OS?
we have no idea what is your operational system, what are previous steps u used to achieve this situation
Ubuntu 20.04, I was following https://docs.modmail.dev/installation/local-hosting-vps/ubuntu and got the error from python3.10 -m pip install pipenv
is it real Ubuntu 22.04 intalled to your disk, or pseudo ubuntu installed in WSL?
Ubuntu 20.04 blank (64-bit) on VPS
okay. i think you are crashing your main python system i think
python3.10 in ubuntu22.04 is main python used
u tried to install python3.10 on top of it
not sure if your OS is even still working correctly at this point
Nope, python3 --version
Python 3.8.10
oh. it is ubuntu 20.04. okay it is 3.8 all right
u could have used 22.04 verison, it has python 3.10 out of the box
and saving yourself some headache then
otherwise u can continue trying to install python3.10 🤔 but do u need it if u can just switch OS?
anyway, i have no idea what is this error. never really encountered in using venv
try install python3.10-venv
and create python3.10-venv -m venv venv
source .venv/bin/activate
and then install pipenv from there
could be better
u have some weird broken python installation 🤔 may be venv will help to fix it
otherwise just switch to 22.04. it will have already correct python installed, thus eliminating posilibity of errors at this step
has anyone done anything quite so crazy as to get python running inside wine?
I've been trying for several hours, and while python runs alright, pip seems to fail to install
I've used the wenv package, and found that ktinker isn't included with that installation, which I need
why would u do it? 🤔
isn't python compilable fine as it is?
playing a game through proton, trying to install a python plugin for said game
python plugin uses heaps of windows dlls
nasty 😅 i prefer just to use windows at this point with dual boot
basically, doing my darnedest to not dual-boot
yeah XD I'm probably gonna wind up there, but doing what I can to avoid it haha
I've no idea why pip fails to install tho, and the error isn't showing up on google haha
as a silly alternative i tried to run Windows in VM at my linux with forwarded volumes
but i did not able to make videocard working for windows inside :/
You know...
i have a strong good solution how to have Windows i think
without sacrificing my Linux exp
i should just utilize my laptop for Windows and share files over samba or smth from main PC 😅
I was wondering if you were gonna say use WSL and mount your linux partition inside it XD
samba is pretty good to run Windows friendly accessable filesystem
i thought to say it, it is some sort of a solution, but remains hell of unsafe due to whole still being windows (which i usually pirate so it is doubled as unsafe)
XD
going to try WSL next time out of fun. i heard WSL2 runs full linux inside
I've heard there's a way to remove the watermark without pirating actually, so I may go that route XD
yeah wsl2 is full linux kernel
still Samba i find very attractive path
because... i don't sacritice my already configured dev env in linux
i just extend it with external windows compiler accessing it over samba
and optionally CI runners with windows
Going to have Linux dev env first solution then with Windows compatibility 😅
Hmm, if i will be not using Videocard, using Windows in VM with forwarded volumes could be enough for that
for least amount of headache and extra hardware usage
i like virt-manager to use for VMs
it does its job, and i got used to it already
well, except Videocards. that i did not get how to configure
Samba with extra laptop is good because i get 100% of windows working for sure without any setup headache. At the cost of extra hardware 😅
just in case someone's able to help with the python in wine thing: https://paste.pythondiscord.com/RHGQ
that's my tracelog for wine failing to install pip
steps to reproduce:
- create a new wineprefix
- download python 64-bit windows installer
- WINEPREFIX=prefix wine python-3.x-amd64.exe
- breaks upon trying to install pip
not very reproducable. Consider using docker wine
https://hub.docker.com/r/scottyhardy/docker-wine/
and building your solution with Dockerfile from there
then it will 100% reporoducable to exact same situation
may be even saving resulting code to git repo 😅
i could bet u can utilize wget to keep everything as single Dockerfile though
FROM scottyhardy/docker-wine:stable-8.0.2-20231015
... <your code here>
RUN wget smth
RUN apt get install -y smth
...
ENTRYPOINT ["/usr/bin/entrypoint"]
stuff like that it will be
with docker build --tag test . in current folder with file Dockerfile above to build those instructions
it will make 100% reproducability more or less
thanks! I'll see if I can get that working. Who knows, maybe it'll just work and this'll be my solution haha
going to be helpful quicker to debug it too 😅 since at any time u can change one command of instruction to another one
and it will be possible to rerun-rebuild it like the deleted thing was never installed
everything remains comletely erasable without polluting system
faster feedback
Docker Deep Dive book is great if u wish to dive into this tool more in a structured way (people manage to use it without learning stuff though)
every added line with RUN or smth else in Dockerfile is cached as another layer of an image. every layer/line is a savepoint for an image
The password for the next level is stored somewhere on the server and has all of the following properties:
owned by user bandit7
owned by group bandit6
33 bytes in size
Commands you may need to solve this level
my answer is find / -user bandit7 -group bandit6 -size 33c why not workng
Not sure that's possible, and you're probably approaching the problem the wrong way... You can use a bind mount to make a host folder accessible, and then attach to the container to move files. Or you can just edit inside the container without a bind mount, if it has an editor
But this generally defeats the purpose of containerization. You should probably just build the container the way you need it.
what do you mean "not working"? what's happening that differs from what you expect?
docker run -v /host_path:/container_path image_name
first path before : is your host path
second path after : is any container path
u can utilize relative path with docker run -v $(pwd)/folder_name:/container_path image_name
if u use docker-compose, declaring volumes is easier and can use . for relative path
u need to recreate container in order to bind volumes 😉
was support for . added recently?
in docker-compose/docker compose? it was available long time ago? for years.
I don't even know when it was not supported (it was available already in docker compose 1.* versions)
volumes:
./data:/container_path
in theory it should
oh you're right! i thought for some reason i had to put $PWD in my compose file 🤔
Is there a unix-y way to run a program at given intervals, eg every hour? My current idea is just to have a time.sleep in an infinite loop but I'd rather have the program not running at all when it doesn't need to
cronjob probably?
run X at every Y units of time and it makes me instantly think of cronjobs
though it's not exactly the same as running a job that takes X minutes, and then running it again exactly an hour later
Cron job is common for that
Although for turning programs on and off it is common using systemd
Not sure if we can utilize cron with systemd at the same time
Thanks, I'll check out cron jobs. I can just make the program turn itself off when the job is done
For web applications in python for more programmatic control and observability, common to go for Celery Beat though
Celery Flower can be used for monitoring
And there is cloud cheap option using Event Bridge with cron rule onto AWS lambda
(This option makes paying only for when program is running, but not for idle time)
I have a home server set up so I don't need aws, thanks for the info though
for home servers cronjobs will do nicely 😄
i use it to sync mirrors, handy dandy
When would one use one vs the other?
If u write many thousands code lines program, with unit testing and etc for long term quality, and u plan to deploy it within your own infra. Best is celery.
(Good if u write smth related to web apps, backend, rest APIs)
(Code scales well to run a lot of different periodic tasks)
If u just need one command to run every hour, for stuff u aren't going really to write code for... Cron will work too (and like it is not related to web apps)
(Ideal for single command to run of smth)
Sounds like cron is best for me then, thanks!
I personally use cron to have auto restart of my Minecraft server every day.
Cron goes to necessary folder during 2AM UTC and runs docker-compose restart for me 😊
yah for me i write shell scripts for syncing mirrors/logging and run it through cron
On this one, I'm grabbing data from an api, seeing if there's changes since the last pull, and sending an alert to my phone if there is
Cron is good for lazy stuff at your own home projects. For servers that aren't going to be ever updated probably
Ergh... Not really good cron usage then. I think.
While TRUE, time sleep hour would have worked better for simplicity.
It would have allowed u utilizing shared memory of app for simple, pure in memory application logic
(Assuming it is for home projects)
We can do it with cron too, but keeping stuff stateless is very advantageous default
Your program would have been able comparing status with previous one already in memory
How does the API deal with data diffs? I don't think it's desirable to do it directly with cron (not that you can anyway)
I'd like to write the incoming data to a db if there's a change and also to take snapshots of the data every week or so, so I think this way makes sense. Might also make a webapp to display the data on a local site, depends on how lazy I feel lol
for example, mirrors provide "lastsynced" or "lastupdated" with unix time on it to compare
Sounds like a minimum viable product would be a cron job that reads a file, calls the API, and overwrites the file if changed. But if you want to store history then a SQLite DB would be best. Either way, cron would work fine
Yeah sqlite is what I have in mind, thanks
By the way, systemd timers are also great (as a substitute for cron) and I've been using them for a while now.
how much documentaion do we really need to read before im elegable to ask a qustion
All of it
lol. have anyone done that? it seems like it but the ironic thing is, there are gaps. so how does a person know, when to actually ask a question?
I think more people today will ask discord questions like. "how do i for loop ?" and actually get "ohh your poor thing let me help you with that ....."
im from the 90s. you had to read the doc that was actually made from the developer. and you know how piss poor they can be.
no google
now there is so much of it and its getting better, but man, its an equally same but different challenge.
you can just ask the question, and say that in the process you've referred to X and Y docs to no avail
for example: I'm trying to do X, i've looked up library A's docs that does this, but i don't think it's adequate for my use case---there's also B I'ved checked out but it seems to lack validation and issues are stale
and that'd be good enough for me
im refering to the stackabuse community. the discord community is very good but people ask the same thing again and again here that eventually it will be more like stack overflow.
ah that
that thing
I'm glad I'm no part of it
Don't even have an account and I have it blocked so it doesn't show up on my results
wow that is extreme but i salute you 🫡 .
Oh unix channel. Is Linux UNIX?
Im voting No
on unix or unix-like systems such as Linux or MacOS.
it's fine i guess
I know what UNIX is and i get that this channel is unixish. Im just asking the actual question is Linux UNIX or not ?
I think it has diverged into a Non unix thing that is now its own thing that is Linux .
nomenclature-wise linux stands for linux is not unix
I think you mean GNU which is Gnu is not Unix. but linux is a diritive of mimix which was linus version of mimix ?