#unix
1 messages · Page 13 of 1
i agree i'm searching for help everywhere and people are not answering me nowhere so that's painful 😭
thanks for your advices
Mm, probably because u aren't approaching it in the right way
For a right way u should be trying/attempting to do stuff on your own
And writing a wall of text, how u do it and what errors u encountered
than any human passing by could help if they encoutnered such problem before and not lazy to add input
then even if other humans do not help, by voicing all your steps and errors => u are very likely to reach answer on your own
like u just rubber ducked your way to finish
Otherwise other people could give small advices for else to try to feed your inspiration what else to try to fix it or make in a right way.
People are way more willing to help if they see your effort, and if effort on their part required is very small (and they don't need to interrogate you what u have)
i'm trying stuff on my own but it's not giving results for now
my problem is that i don't encouter any errors when it comes to python , only a broken file at the end, so i have no clue where to search and this is why i can't give much information
as of now i'm trying a new way
thanks for your advices i'll try all of this
, only a broken file at the end
if things are all too bad, then just share Github repository for a link, and screenshot of last crash, and last commands u invoked to reach it
Try also to summarize relevant code files/ file structure to shorten reading time for helper
Mention your OS of course, from where u run it
Otherwise for actually discovering problems related to debian at every commit u could be just using Github Actions
You code could be having pytest unit tests, and GH ci could be autolaunching them to run at linux and check all is okay
https://github.com/darklab8/py-typelog/blob/master/.github/workflows/ci.yml
WSL2 is more rapid solution to iterate locally, and develop with comfort (or just developing straight from linux 😁 )
CI can be just an extra to ensure preventing degradation if u stopped using wsl2 at this point of time (u will receive Emails if it they crash, plus seeing red mark to commit as they don't pass)
that's what i've done here https://discord.com/channels/267624335836053506/1277194669339447397 and on stackoverflow
Ah. Classical devops problem 😏
Docker is able to encapsulate inside not only Python dependencies
but also imitating Linux OS filesystem inside and having installed different system level dependencies (apt, and etc stuff)
that makes built docker a reliable artifact for launching, with 99.999%+ guarantee that it will work as intended on another machine
oh wow
a big too deep for me to dive into tbh i'm hoping for something easier
and i still need to learn how github works apart from push and pull 
Feel free to dive into it eventually. That's a very handy tool helping to have better development environment too
it makes a lot of stuff way simpler
like if u need postgres, or redis, it makes it possible in a single command, within few minutes of your effort to find Docker hub and launch them
And also... if u will build from WSL2 Docker image for the correct CPU architecture of your friend (Amd64 / Arm64 for example) and save to docker registry (at docker hub)
the friend will be able to launch your app in a single command effort with all your dependencies being inside already installed (no relying on whatever python is installed at remote server, it will be already smth inside the image)
Docker is lightweight VM imitator, that creates an illusion of VM, imitates its own filesystem inside, but actually fully reuses resources of a current Linux machine
It is a really good "artifact" to build for launching at othe rmachines
Consider docker being a "binary" to build for web world. A real way to frozen all your python/system level dependencies and not relying on having then installed later and being available
ooooh dammn seems interesting
i with i had time to learn about that but class goes again in a week and i'm hoping for my bug to be fixed before this 😭
i'm saving all of this for next holidays to read and learn definitively
for now i'll just try with wsl for my tests
https://docs.docker.com/engine/install/ubuntu/#next-steps
u can try using Docker from within WSL2
here is the proper Docker Engine installation for wsl2 ubuntu default
Docker is not usable from Windows directly. That's Linux technology only. (there exist ugly tools to workaround it, but they should not be used due to problems they create, WSL2 or direct Linux usage is a way to go. Or optionally just using remote server or regular VM, but those choices are less comfy)
would you advice using ubuntu on wsl instead of debian as ubuntu is the default ?
it does not matter a lot what u choose here. Ubuntu is debian for 90%+
there exists only extra important caveat
you said your friend uses RetroPi, which is likely having Arm64 CPU architecture. And your Windows is Amd64 CPU architectured.
Docker builds CPU architecture dependended artifacts
so u would have to build it on arm64 and save result ot docker registry for friend able to run, or provide friend with dockerfile to rebuild at arm64 on its own
any programs built for amd64 can't run on arm64 😅
you are separated by CPU architecture wall
ooh ok which may be the problem for my code ?
different hardware
u have regular windows which usually runs on some intel/amd CPUs having amd64 arch
she has Raspberry PI server, which has arm64 architectured CPUs
this is what the server shows when i launch the ssh
anyway, test your things on WSL2 for a start
ok lets go
Sounds good just a warning lfs is harder than gentoo, lfs is basically gentoo but you run every single make command manually while gentoo does most of them for you
I'll probably try lfs again sometime since I'm way more comfortable with the Linux system
I think in that respect, itd better for me to do lfs because that way I actually properly learn more about linux. Anyhow, thanks for your help. Ill let you know if I need any assistance.
Figured out how to launch a transient systemd service via SystemD's API. Took me a minute
So, there's Timeshift. It's a tool for making automated system backups. It works (by default) via rsync - when a new backup is made, it's compared to the last one and files that weren't changed get symlinked to the last one, whereas new and changed files get stored for real. This is a cool feature that saves tons of space.
Is there a way to achieve something like this, except also compressing all the files? Not for system backups, just for use on various directories one may want to backup.
(I don't just mean "is there a tool for this", but also "how can this be implemented at all". E.g. I was thinking of just adding each version to a single big zipfile, but this only sometimes manages to deduplicate the files, it seems.)
I suggest btrfs, it comes with both snapshots, and compression
And sending of the snapshots via btrfs send, with no garbage, as opposed to plain dd
Oh, that's an interesting idea. I wonder if I can make a BTRFS in a file via FUSE...
hmm, is it possible to mount a file as a filesystem without binding it to a loop device? because the latter needs sudo, which is an annoying limitation to have
yup, this pretty much works! (not actually via FUSE; couldn't find an impl of that) I can make a btrfs system in a file, mount it, put a bunch of "backups" in, deduplicate them with something like rmlint, and if necessary also have the filesystem compressed (though this has a weirdly high overhead, despite using zstd it took me 20s to read files which should have been read in one).
The main issues are:
- this is unix-only
- this needs
sudoto dosudo mount mycoolfs.img mycoolfs_mnt -o loop -o compress=zstd, which is quite a big thing to ask just for one feature.
I wonder if I can avoid that last one somehow...
also btrfs needs a 120MB file at least, even if you don't use all that space
Well, that's a shame
I had my own investigation on doing backups that don't suck, look into rclone and all of the backends/options available for it, maybe you'll find something suitable
a question
what is the command to execute a querry in a SQLite database
on linux?
sqlite3 nameofdb 'your query'
how do i locate my poetry enviroment to execute the poetry update?
i need to find it to install
are you sure? You can just run poetry in the directory that holds pyproject.toml, or any directory below that
but anyway: poetry env info --path will tell you
I swear to god manjaro has been the only distro that ive used that works perfectly on a VM. other isos ive used have always had issue but only manjaro works well. is there a reason for this?
Yes, must be incorrect configuration.
What hypervisor? Maybe try a different one.
I use vmware
i use windows because i am lazy
termux is good for local ssh
you can make a good ssh with termux
and you can install zsh on it and oh-my-zsh
is there an opensource alternative to something like thinlinc?
I want to do gpu intensive work remotely within the lan with multiple users that can login
Thank you so much for giving me the first link that appears on google when I search up my question. Glad that you also took nothing in considerations because none of these alternatives are viable for my usecase.
This is a discord server, correct?
I didn't know it's a search engine
I did find xrdp and tigervnc somewhat relatable for my usecase, but tigervnc isn't persistent. Not sure if any are suitable for gpu intensive work
I would use sunshine/moonlight if they could handle multiple users logged in at once
such kind person, I wish my boss would have your personality. Would be great to get so warmed feedback everyday, what a joy
I don't know whats the point in trying to answer a question that you don't know the answer for, and in turn, misleading the person. Perhaps just...don't respond?
people from different experience levels come here everyday. I can't tell with just a single line question what you did or not before answering. Perhaps you can post your questions with more contexts next time to avoid vague responses. I did not mean to mislead you.
This would be context enough...None of the alternatives in the link meet the criteria. Though, I didn't mean to be imprudent while responding. Good day
how to install python on ubuntu? i tried multiple times from website but it didn't worked?
first, let me ask why you're not using the python that's already present -- /usr/bin/python3
"24.04 LTS (Noble Numbat)" comes with version 3.12.3, e.g.
i'am a beginner, not aware about terminal
ah well if you're a beginner, your life will be simpler if you use the built in one
installing is not as easy as it should be
where to get built in one?
i mean access?
as above: it's /usr/bin/python3. If you don't know what that means, then you need to learn a little bit about Unix.
Ty, moving ahead
how were you planning on using Python?
for CP
I have no idea what CP is, sorry
competitive prog
huh, well good luck.
Python is installed with Ubuntu
Shouldn’t need to install it
@strong gate did you get it worked out?
Yes
Any one need a website or an App developer?
!rule 6 9 <@&831776746206265384>
Every day, in another channel once again #software-architecture message
6. Do not post unapproved advertising.
9. Do not offer or ask for paid work of any kind.
how else do you use python, at all? even on windows you use it through a terminal
I saw something called idle on internet
most people use IDEs
Vs code?
Yes, for example. Vs code is popular.
No pycharm
What do you mean, no pycharm?
Use VSCode, PyCharm Pro and Visual Studio 2022
My favorite but hard OS to grasp
Do you understand more of how windows works? 😬
Yeah, I daily drive Windows. I got Kali on a VM, I'm learning. I'm still having issues reading Man pages and trying to get them resolved
lol
What? Why not?
Well, I have no idea how it works under the hood. Windows is magical, Unix is understandable.
Cross posting from general since I figured that's the wrong xhannel for this question:
How to make a python script behave differently if it's invoked by a command that pipes to another command?
$ my_script.py | fzf
I think usually commands check if stdout is connnected to a tty or not. If so, it's going to the user's terminal. If not, it's been redirected to a file or a pipe.
Not sure how to do [ -t 1 ] in Python though
saaame
actually scratch that I would backflip on my neck very soon after having to use windows
my environment matters a lot to me so I wouldn't be able to handle it
you have a lovely pfp + nickname combo
very cozy
🙂 [2024-09-11T06:33:13-0700][discord-recipes] % python3 -c 'import os; print(os.isatty(1))' | cat
False
🙂 [2024-09-11T06:33:20-0700][discord-recipes] % python3 -c 'import os; print(os.isatty(1))'
True
disclaimer: I just made this up now, I've never tried it
Good enough for me, thanks! @formal schooner @fickle granite
marginally cleaner: ```shell
🙂 [2024-09-11T06:33:22-0700][discord-recipes] % python3 -c 'import sys; print(sys.stdout.buffer.isatty())'
True
🙂 [2024-09-11T06:38:32-0700][discord-recipes] % python3 -c 'import sys; print(sys.stdout.buffer.isatty())' | cat
False
just in case stdout isn't fd 1 for some reason 🤷
also it avoids making the reader wonder "wtf is this 1 doing"
I did sys.stdout.isatty()
huh, I failed to notice that existed. That's better yet
If it's your daily driver I wouldn't, but if it's an extra device and you want to experiment for learning purposes, sure https://www.osnews.com/story/139562/why-i-run-a-bsd-on-a-pc/
I'm guessing the hardest part is gonna be setting up the wifi but yes my main PC is my desktop I use my laptop to code at coffee shops
Actually
Might wait a bit until I'm done with my project to tackle that lmfao
I remember installing Debian on my only pc (circa 2002) and I had no internet connection. I had to download dependencies one by one at college and then install them back home at night. Just to figure out I missed another bunch 😄
Lmfaaaaooo
I might dual boot Linux on my PC I need to get back to using something besides windows
I haven't been using my VMs since I stopped studying for certs
If you haven't tried it in a VM yet, I would start there
Yea my only experience with bsd is pfsense so I'll definitely spin up a freebsd VM before trying to convert my laptop
I'm a big fan of enabling XRDP on VMs. The Windows RDP client provides a pretty seamless experience. I will never dual boot again
Interesting, I might try that out
on Windows you also have WSL2 which is somewhat descent compared to version 1. It will help you to understand a lot of commands. Also Docker is another option these days.
Ive used docker to spin up labs on linux
there might be some bullfuckery with fd redirection potentially, so yeah nice safety
How to make a command that wraps my script so that the default behavior is to always pipe the result to fzf?
# alias shortname # how to write this so that
# short_name --banana, translates into
path_to_script.py --banana | fzf --ansi
But not for shortname --help 😬
You can write a function
short_name() {
if [[ "$1" == "--help" ]]; then
path_to_script.py "$@"
else
path_to_script.py "$@" | fzf --ansi
fi
}
Yeah, I'm wondering if this is my best approach. I just want the script accessible, convenient and transparent
Once again I think an abbreviation like fish has would have been the best.
aliases are strictly prefixes, so you have to write a shell function for anything more sophisticated
depending on how the program handles its options, you might instead want to do something like this:
function short_name {
local use_fzf=1 arg
for arg; do
case "$arg" in
-h|--help|-V|--version) use_fzf=0 ; break ;;
esac
do
if (( $use_fzf )); then
path_to_script.py "$@" | fzf --ansi
else
path_to_script.py "$@"
fi
}
interestingly this is one of the cases where shell scripting is actually a bit more parsimonious than python
Depends on the shell
E.g. in zsh you can do alias -g H='| head'
true, but that's a different kind of cursed
Yeah, and that's not even the most cursed type of zsh alias..
its okay ahah
Is it like a suffix alias? And why is it cursed?
Is it possible to do something like fish abbreviations in bash or zsh? I remember googling for this before without finding anything.
But. Worst case. It should be possible to hack something on top of tab completion, right? 🤔
What do Fish abbreviations do? -g is a "global" alias in Zsh, -s is suffix only
And yes in Zsh there is something called Zle which lets you run pretty much arbitrary code to process your text input
Not to mention the wildly complicated completion system
For example you type ga<space> and it expands to git add on the prompt so that you can add more options before entering the command
It's nice because the command history will only contain full commands and never aliases that are personal to yourself. Good if you want to copy the history to someone else.
Ah that would be a Zle thing then
It's a global alias, it expands anywhere in the line. The cursed thing I'm referring to is actually suffix aliases, which work differently:
$ alias -s txt=vim
$ foo.txt # opens vim with the file
$ alias -s net=ssh
$ myserver.net
It's similar to Windows file extension associations :D
Scary 😬 both global and the suffix stuff
If I have something like this, what would happen to echo H or banana -H?
% alias -g H='| head -c 3'
% print 123456 H
123
🙃
i once tried using global aliases for things like piping to grep and head but i didn't use them enough to make them worth using, and they were spooky to have sitting around
aliases creep me out; for years I only used shell functions
Now that I've switched to Zsh (at Apple's gentle encouragement 😐 ) I use a few simple ones
I have 2 that I use pretty regularly: ```sh
Pipe to less
alias -g L='|less'
Detach
alias -g D='&>/dev/null &|'
of the two, I could probably get rid of the L one and not miss it too much, but I use the D one only once in a while, and I've never memorized that incantation
Thankfully it's not that global, it's only replacing it if it's a word of its own.
hi
hello
is "Unix" short for a Linux based system?
As the channel description says, Linux is "unix-like" and we do discuss it here. Unix systems were around before Linux, and are what Linux is based on
ah ohkay i was not shure about it, i was shure Linux systems are the base for Unix, but to be frank i dont know what Unix actually is 🙂 so thank you
Unix is a commercial operating system, but there are many operating systems that behave similarly, and people tend to group all operating systems in that category under the Unix name. Linux is one such OS, the name is just "Linus + Unix", because the guy who created it is named Linus.
No
Linux Is Not UniX
It's also just a kernel
Eg you can make an operating system distribution like alpine. That's not GNU but uses Linux
what?
Typo
I didn't want to get into that, also I don't really agree with the GNU kernel/OS distinction. Maybe if it were some kind of tiny core kernel, sure, but Linux has a huge surface area and very much shapes the way that programs can operate the computer -- that's good enough as the core of an operating system IMO
And practically there is no Linux OS that is not GNU-based, moreover GNU itself as an OS is vaporware, instead GNU is more like a userspace toolkit that you can build a complete OS on top of
So yeah there are some layers to it: your Linux-based OS (Debian, Arch, Fedora, Alpine) is built in part on GNU software and running the Linux kernel, but the kernel very much shapes how that higher level stuff behaves. It's not a clean separation.
I mostly agree with you, but I don't think you can call Alpine "based on GNU software". Just because it's compiled with GCC?
it doesn't use any GNU coreutils, findutils, etc?
IIRC it's Musl + Busybox but I don't know how extensively the GNU has been eradicated from the overall base system
Nah, that's all busybox.
How can I fix this ? Someone please help
you can start by pasting that text as text, not a photo of your screen
@green iron
i cant do that, i am in tty3
i cant boot
something got messed while grading to ubuntu 24
in that case, that is a horrible screen shot regardless
we can't even see all the output
you can do better than that
We can't even see the text well enough to type the error into Google for you, but that's where you should start
Okay I'll try to take a better pic next time and share here. Sorry
I can see it well enough to tell you that the error message is very clear about what the problem is: python-numpy and python3-numpy both install the same file and therefore are incompatible. personally i think this a packaging bug (the conflicting scripts should have different names, eg "f2py3") but it sounds like for now you need to remove one of those two packages. But none of this is relevant at all to booting into a graphical system...
i was trying to upgrade into ubuntu 24 and thats where things got messed up , there were some errors and some partial upgrade i guess.
so how do i remove one of it ? 🥲
do you actually need numpy installed as a package on your system? just remove both imo unless it's a dependency of something else
it must be a dependency thats why its breaking maybe? i am not sure tho 🥺
I was gonna say "oh yeah I would sudo pacman -Rns to uninstall it including extra unneeded dependencies it installed" but then realized that ubuntu
too archbrained
chatgpt / phind / perplexity the error
lol
it will probably point you to some stackoverflow thing or some such
where you'll be able to learn what it actually means
oh okay. i will check that out
thanks guys
i'll update on the issue if there's any progress
apt remove but you should read https://www.debian.org/doc/manuals/debian-handbook/sect.apt-get.en.html
"aptly remove" hehe
Do not do that unless you want to break your system more
I've been using linux (excepting WSL) for around a year, and it's worked every time
I strongly discourage asking the autocomplete bot when an actual manual exists and is easy to read
you should sorta know what the commands are doing
which is where you ask follow up questions if you don't understand some command it's giving you
but that goes without saying
Right, it's not a tool for a beginner who is already in over their head just trying to get their system working and doesn't understand its basic tools yet
a lot of the times it may be easy to read, but is a lot to read
not necessarily about this specific issue, but for the general case
yeahhhh good point on that
@green iron listen to the lamp
Right, but for questions like "how do i remove a package" then yeah you should at least try to read the manual to understand the fundamentals of your own system
Sorry to be cantankerous
what I thought of is "why does this conflict happen, why is this package required by something (or why is it installed), what's the discussion about this issue that probably already happened, what will happen if I remove it", where at least for me, AI would help solve all or some of these questions
I never considered that the "remove a package" part of the deal could be an issue, but ig it is in this case
never heard that word before!
Tbh even in this case I would be skeptical. Is the autocomplete bot really more likely to know why a package file conflict problem occurred, without knowledge of the contents of your system, than you are when armed with knowledge of how to use your OS?
I use AIs that search the internet
I mean heck try it
so they are basically google that do some filtering for me
you gotta develop a balance of how much you should trust them, of course, but I make good use of them
More than likely it'll tell you that you have a package conflict and you will be able to Q&A your way to the right commands to investigate and fix
cause usually, if I'm having an issue, there's a really good chance someone else already has; but searching for it myself can be cumbersome, and so it's often easier and faster to use an AI for that
So it will probably work -- but that's more than just asking the bot, you need to treat it like an expert with dementia
Yup it's a skill
I have enough overall experience where I generally know what the right answer will be, even if I don't know the technical details
so I can tell when the ai is right or wrong, even if I didn't know that information beforehand
to highlight that you pointed out correctly that pointing a newbie at an ai is probably a bad idea
Once there was a time when people had to establish the same skills and instincts for search engines like Google
there's a use that happens often with me
I want to know if something is possible in configuration of some software
and so I ask the AI "is it possible to [blank] in [blank]"
if it starts spewing gibberish, I assume it's impossible
simply so that I don't have to waste time and effort on things that are less likely to be possible, and focus on the billion other things I already know are possible
(I have a long todo list)
That's a useful tip, ty
:3
which tools do you use ?
okay
so basically., soemthing went wrong while i was upgrading from ubuntu 22 to 24. and i need to fix that
perplexity ai, phind ai
i see "something went wrong " screen if i boot apart from tty
if i had to try one whats the best?
the paid chatgpt 4 one, most likely
has a lot of good features and is really powerful
I can't buy it because I'm in russia
but otherwise I would
i cant either. how aboout the free gpt 4o?
I don't know about that one, haven't tried it
personally I use perplexity ai
if you are going to use ai, MAKE SURE to assume it's always lying to you
ask questions that you can prove right or wrong
blindly trusting an ai is a bad idea
oh okay okay
What's this channel for lolmau xD
they had an error booting up ubuntu
but then it sparked a conversation
Hi, I'm using Ubuntu 22.04.5 LTS. This morning I installed some software updates... and now my file view stopped working (the files are still there), I just open files and it keeps loading as shown in the image without showing me any folders or files... does anyone have any idea of how to fix this?
can you provide the details of the updates you installed
i would open it from a terminal and see if there's any errors in stderr
so IG this channel is for linux related help
yep
yeah linux and occasionally macos
username censored for obvious reasons
Thanks!
The stuff that's visible there is:
Alacritty(terminal emulator)
Grubbox dark hard
Neofetch
The blue thing which shows the cwd is power something sorry can't remember exactly
https://github.com/romkatv/powerlevel10k I will guess
What’s the biggest difference between a Unix os and a windows os
Does Linux counts for your definition, or strictly must be Unix
Linux sure
Then biggest difference:
- Linux is free. Licensed version is seriously free for all mainstream stuff.
- that alone makes it easy to abuse in server infrastructure for raising hundreds servers for free if necessary. That allows handling horizontal scaling where we increase numbers of servers instead of their power. Destroy and create server instances as much often as u desire
- that simple fact built ecosystem around to automate its configuration and having all server infra dedicated only for it.
Since it is free and open source as well as many its mainstream diatros...
Even if u a using it for desktop as dev machine...
...u a really left in control to be full admin of it and able to change literally everything. As long as u inserted admin authorization, the OS is not fighting you or restricting in any way, including not forcing onto you auto updates, unwanted antivirus, or any other dumb decision windows makes.
- also since it is real user oriented, each new version of distros is not hiding settings, configuration away behind some new marketing move.
So... In a short Linux OS is built with comfort at least for developers.
How about like structure wise
All Linux OSes usually adhere to be very similar at console level
Having same rules, folder names where everything should be and it should be organized and working.
All same rules to commands and how to read their help
As mainstream most of Linux OSes are based on debian, so once u learn how to work with Ubuntu (based on debian)/debian, u are able to with with 2/3 of Linux OSes in exactly same way
Visual interface can variate for desktop machines, people choose whatever they want.
I am fan of KDE plasma interface, so I go with Kubuntu for desktop (Kubuntu + KDE)
By default Ubuntu is shipped with Gnome interface
Between majorly different Linuxes, having entirely different under it distro, usually biggest difference for user only which package manager is installed.
Well.. sometimes can variate default shell language too.
Anyway I just stick with debian/Ubuntu family and I am good then
So in the end, u usually learn how to use Linux at console level for specific family, and then u are good to use it
Console is quite comfy, because often faster to use, and devs are not lazy to output detailed information what is happening
Also not least importantly, easy automatable for configuration of servers
No like structure wise how is Linux and windows different
If u ask it again, then I must ask what is structure
Provide me example of windows structure u wish comparison with
Like it’s file system and kernel idrk
Common to use ext4 filesystem
Different path slash to use
And it is case sensitive in comparison to windows
/var/Smth
/var/smth
are two different files
Cool
Never touched its kernel. It is there.
For me Linux kernel is important only from point Docker is able to run multiple containers in efficient way
By grabbing same host kernel
At windows it can not, without running somewhere Linux vm
Thanks
As mentioned, my terminal breaks after suspending applications like vim/nvim/helix. This happens in bash after I have used fg from a key binding.
Every 2nd time I do ctrl-z to suspend the editor to the background, my terminal enters a broken state where I can't see anything I type. To reset my terminal state I have to blindly do stty sane<enter> to get it back into functional state. so weird!
If I compare my tty settings with stty -a command and diffing, I get this: (The red settings is when my terminal is "sane" and working. The green settings is a broken terminal)
Does anyone have any guess or idea what could be going on?
Terminfo not matching your terminal? What's $TERM and what is your terminal?
So the annoying part of my input not showing is due to stty -echo being set.
$ echo $TERM
xterm-256color
I also noticed I get the same behavior when ctrl-z (suspending) python3, so it's not only for alternative screen (fullscreen) TUI application.
Here is some info regarding my terminal Wezterm:
wezterm version: 20240203-110809-5046fc22 x86_64-unknown-linux-gnu
Window Environment: X11 GNOME Shell
Lua Version: Lua 5.4
OpenGL: AMD Radeon Graphics (radeonsi, renoir, LLVM 15.0.7, DRM 3.42, 5.15.0-119-generic) 4.6 (Compatibility Profile) Mesa 24.2.3 - kisak-mesa PPA
I also experience the issue in xfce4-terminal 0.8.10, which has this:
$ echo $-
himBHs
$ echo $TERM
xterm-256color
shell is bash version 5.1.16(1)-release (x86_64-pc-linux-gnu)
And I noticed by inspecting tty from another terminal that the strange settings are set when I do ctrl-a to foreground the process
Similar issue in fish that has been resolved: https://github.com/fish-shell/fish-shell/issues/2114
bingo
thanks for the find
👀
I think I asked at one point, how to make a poll. And someone was angry because I asked and didn't look it up myself 😩
lol
sometimes you just want a human response instead am I right?
Is it possible to make my Crostini use a partition of my external HDD to store all of my debian VM container's data? (basically the whole "/" directory)?
true!
@scarlet pivot what you rocking
What desktop environnement would you recommand that doesn't use mutter nor wayland ?
i like Kubuntu. by default it uses X11. there is an option to switch to Wayland if desiring
crip
from what i've tested kwin seems to have the same downside as mutter for my usecase
I need to be able to create virtual monitors. Mutter has a bug preventing it, and wayland doesn't handle it for the moment. iirc virtual monitor didn't work on kwin either
at some point i used this Virtual Monitor business at ubuntu, found some program that works well for it to extend how many desktops i have
And then stopped using and just started using two physical screens 😏
I actually need 2 screens to behave as one
so I can have some app on fullscreen on 2 monitors
I have a xrandr scripts that does it and it works great
I was using Cinnamon, but I've upgraded from Ubuntu 22.04 to Ubuntu 24.04 and now playing with virtual monitors makes Cinnamon crashs...
Apparently it's a bug in mutter
KDE forever
But not Ubuntu blech
For an ultrawide?
no the other way around
merging 2 screens into one
looks like I'm stuck with Xfce or LxQt for the time being
ah, KDE does not do that well
LxQt is low-key great anyway
Feels a bit more like "WM + apps" than most DEs, not well integrated
Xfce also great if you want something more coherent
I'm trying to have Firefox as default browser, but I can only get xdg-open to launch chromium. Is there a way to debug why this is happening? xdg-open didn't have many options on the cli.
I'm guessing maybe missing .desktop file. Where is that located on Ubuntu (with xfce)?
I do have a /usr/share/applications/firefox.desktop
does it show up in the output of update-alternatives?
I solved this!
Had to use xdg-settings set default-web-browser firefox.desktop 🥳
Does anyone know why #ifndef __GNU__ is here? https://github.com/python/cpython/blob/main/Modules/socketmodule.c#L7924
And then why even on GNU I still see SO_REUSEPORT available in the socket module?
Modules/socketmodule.c line 7924
#ifndef __GNU__```
the blamed commit says
Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway.
Oh hurd
Why is there no issue for this commit?
I see this as rejected https://github.com/python/cpython/issues/65472
Hurd is not on the list of supported platforms: https://pythondev.readthedocs.io/platforms.html
Is the __GNU__ guard only for Hurd?
had a great time with kde, can easily recommend it
ty but kde sadly doesn't meet the requirements for my usecase
that would be my choise otherwise
Anyone know how to use symlinks for automating the management of dotfiles? I have a system that works for me, but I'm curious how others manage their dotfiles ^^
Mine are in a git repo, and I have a (fairly nasty) script that symlinks them into place.
I use chezmoi for managing dotfiles
yep same
I should switch those to be hardlinks though ngl
I used to do this as well, with a self-written symlink manager thing, but I've since become enlightened. My home directory is a (bare) git repo.
.zshrc lines 27 to 30
alias config='git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
# git clone --bare ... $HOME/.cfg
# config config --local status.showUntrackedFiles no
# config checkout```
No symlinks, just real files. I config add files I want to track, config push to sync it to Github, etc.
hmmmm interesting
the big reason I like the symlink approach is that I get to make the file structure / file names that make the most sense to me, rather than what a given program expects
then in fuzzy searching, I don't have to shovel through a million files called "rc" or "config"
I see that, but you could also just search files tracked in your repo, I think
E.g. config ls-tree -r master --name-only | fzf (which you could of course alias)
yes, but then they would still be named not how I like
True. If that's more important to you, then perhaps it's not for you.
so basically I'm putting in a bunch more effort to have a nicer filestructure that I interact with
indeed
For me it was a pure upgrade, since I anyways copied the same structure inside my dotfiles repo and then recursively symlinked them into the correct place based on the directory and file structure.
How do you map your preferred names to the "real" ones?
ohhhh yeah in that case it's just better!
I heard stow does exactly that
hmm?
via symlinks
Manually created ones?
yep!
I see
and this script ↑ tracks the overall install process of things
so if I ever need to reinstall my os, I follow a bunch of scripts that do that
Yeah, I had a similar thing (with a single curl | bash setup script)..
neato
Same here, I call it dots https://git.sr.ht/~wintershadows/dotfiles
Very fancy
I used to use dotbot to manage symlinks
I liked the level of control vs GNU Stow
I use chezmoi to manage my dotfiles as a separate repo. It keeps a copy of the tracked files and alleviates syncing the used file with the copy in chezmoi directory.
It's a bit complicated but supports file properties and encryption. It's a bit too complicated for me, but I got it working and it works very well now after I learnt it.
Manage your dotfiles across multiple machines, securely.
nice!
yeah not a fan of gnu stow simply for the restriction that it works by
nice!!
I started out by using "stow", but switched away at some point. I can't remember why.
If anyone is doing chezmoi with vim I recommend this config:
" Quick way to edit config file(s)
map <leader>e <cmd>Files $CHEZMOI_HOME<cr>
" Automatically apply update to config files with chezmoi
autocmd BufWritePost ~/.local/share/chezmoi/[^.]* ! chezmoi apply --source-path <afile>
So, only update the tracked, and automatically sync to the real file on every save.
sync to the real file? isn't it supposed to make symlinks?
No, it creates copies, no symlinks. I think it's for example to allow encrypted version in the Chezmoi git dir and non-encrypted at real place. There might be more/other reasons.
Like git fetching but only applying/syncing some files.
For my use case symlinks would be enough.
ohhhh interesting
yeah indeed, for what I do, symlinks are enough
I need to look into using hardlinks more though
Never heard of chezmoi, but I'm going to check it out and see if it works for me!
I'll look into this too!
wait until you hear about reflinks (copy on write)
ohhh interesting
what's the benefit over hardlinks / symlinks?
a reflink just seems like a worse hardlink, I'm sure it's more helpful than I imagine though
reflinks are just copies that don't copy any data until something is changed
and also how do you make them? with the ln command also using some flag?
conceptually they are just copies
You make them with cp, on supported filesystems (e.g. BTRFS)
yep, got that
my question is why is that potentially more useful than a hardlink
which is as real of a file as can be, without taking the extra space
Well, it has different uses. If you change the file, all (hard) links to the file notice that change. If you "make a reflink" and change the original, the copy doesn't see those changes. Because it's a copy.
A reflink also doesn't take up space (until one of the copies are modified)
ohhhh
so editing a copy updates the original, but editing the original doesn't update the copies?
No, they act like regular copies. Edit one, it doesn't change the other one
wait so it's literally just a copy, no other fancy special behavior?
except saving on space ig
Yes, exactly.
Trying to use pyenv for the first time to install pylsp globally. But for some reason I have another path in front of my pyenv in $PATH 🤔
But after launching bash inside my bash, it's fixed. URGH I dont like how $PATH works ...
Yo dawg I heard you like $PATH
Why does pyenv go into ~/.bashrc and not ~/.profile ? 🤔
Seems wrong >.> I'm trying to learn now and I'm becoming confused by tools telling me to modify my PATH in .bashrc ... 🤯
I think .profile only affects "login shells", which in this day and age, are rare
whereas .bashrc affects any interactive shell
I hate it when tools fiddle with my dotfiles 😦
.bashrc is called whenever an interactive shell starts, so if I do bash inside bash, I will source my .bashrc again
Bash Startup Files (Bash Reference Manual)
If I append to PATH in .bashrc it will grow (not good)
otoh iirc if you "do bash inside bash", the child will inherit variables from the parent, which could be confusing
.profile seems to be called only the first time the shell is started, not for each invocation of bash inside the first one
yes, that's roughly what "login shell" means
yes, so I dont understand why login shells would be rare?
Isn't it just PATH should be appended to in .profile and not .bashrc ?
nobody has "logged in" to a computer since about 1982
or at least, you don't get a shell after you log in; instead you get windows or MacOS
and you can then manually start a shell if you like, but only about 0.0000001% of all computer users ever do so
you, me, and a couple of weirdos over there --->
uhm but, I'm meddling with config files related to my shell, of course I will use a terminal and do weird things and want it to behave? o.O
yes, you are one of those 0.00001%
anyway, the idea behind .profile was that stuff in there only needed to happen once, when you "logged in".
But, all instructions that tell you to modify PATH in .bashrc, who are those written for? >.>
most .profiles these days basically just source .bashrc iirc
that's quite sad
here's mine in its entirety ```
~/.bash_profile: executed by bash(1) for login shells.
Allow core dumps
ulimit -c unlimited
if [ -f ~/.bashrc ] ; then
. ~/.bashrc;
fi
Change the terminal's title to include the hostname. "help echo"
says I can use \E instead of \033, but it lies.
echo -e "\033]2;$HOSTNAME\a"
I don't really know what this is for, but I do know that if it's
set, some python stuff doesn't install properly on Amazon Linux.
e.g., "pip install acme-nginx" puts the Crypto library someplace
that Python doesn't find it.
unset PYTHON_INSTALL_LAYOUT
haven't looked at it in years
Where do you modify PATH and how do you make sure you don't get multiple appends of the same path into it?
that's two questions
indeed
- I have a nasty python script that creates my environment variables
- it takes care of eliminating duplicates
I see 👍 This shouldn't be needed T_T
🤷
cuda
shuda
wuda
the aforementioned "nasty python script"
https://paste.pythondiscord.com/YJUA
I have a solution for this as well, I built my own framework for it
(mine is just posix shell scripts)
My environment became much more sane today when I started using .profile 👍
I think I'm confused or missing some knowledge, what is going on here?
$ pip install asciinema
Collecting asciinema
Downloading asciinema-2.4.0-py3-none-any.whl.metadata (19 kB)
Downloading asciinema-2.4.0-py3-none-any.whl (97 kB)
Installing collected packages: asciinema
Successfully installed asciinema-2.4.0
$ asciinema --help
Traceback (most recent call last):
File "/usr/local/bin/asciinema", line 5, in <module>
from asciinema.__main__ import main
ModuleNotFoundError: No module named 'asciinema'
Also:
$ pipx --version
Traceback (most recent call last):
File "/home/david/.local/bin/pipx", line 5, in <module>
from pipx.main import cli
ModuleNotFoundError: No module named 'pipx'
it makes me sad that we all have to go to such effort just to get a sane setup
Agreed, that's what I was getting at with "shouldn't be needed T_T" remark earlier.
What's the escape path?
Depends: escape from what?
Freeing future devs to come up with there own fixes for this
Making it simpler to learn and use.
Yeah, but it depends on what aspect of "this" you have in mind
For example PATH being just string means we lack idempotency and it's generally difficult to work with safely
Zsh for example exposes a path array that keeps PATH in sync
That's a solution if you're a shell user, but maybe instead we need a standard C API/ABI for manipulating "array" environment variables
And I think a big part of the problem in general is that every shell does it differently, and here we are trying to adapt something designed for shells, that only works in shells, for use in things that aren't shells
Every OS does things differently too, for example, on Mac every shell by default is a login shell, whereas in other systems only your first login on TTY is a login shell, and you never get a login shell at all in a GUI terminal
So then you have another problem, not only does every shell do it differently, but every graphical environment does it slightly differently
And there is more than one way to do it
Ultimately I actually think the idea of setting environment variables in a dedicated process and then printing them (null-separated ofc) to be merged in by the parent process is a nice compromise that doesn't require everybody in the world to redesign everything
It's very Unixey at least
Unless you want to do it all in a C shared library but that makes it significantly harder for a typical user to interact with, and relies more on application developers
Is it really the commoncase to not get a login shell from gui? When I launch Wezterm from my ubuntu desktop shortcut it runs .profile at least, indicating login shell?
Was your script an example of this, or is this a separate idea?
It's just up to the terminal to do that
As in, terminals are free to do it one way or the other, but the conventions vary
Separate idea, but I use it that way
Eg on Mac there's no way to set env vars for the entire login session, there's no .xsession equivalent
So I do it in my Neovim config because I like using a GUI frontend that I launch from the dock, not a shell
What is asciinema ??
Idk what i am speaking
..
Sry
Wrong place
Recorder for terminal, like I used here:
yeah 😭
I hate installing python software ngl
tbh, I haven't had much trouble with pipx/uvx
I actually can't point to what the issue was, but I do distinctly remember having issues with pipx
haven't heard of uvx though!
what is that?
I used pyenv for first time last week and succeeded, I think
I had to tbomb my Ubuntu system python with some --break flag though
that.. doesn't sound like you succeeded tbh
I think I really did, why not? 🙂
It was stuff I installed 3 years ago into system python, so wanted to get rid off it now.
https://discord.gg/MvJueqDV It's like pip and pipx and other stuff rolled into one, and is super-fast
cool!
Hi I just updated my Ubuntu from 22.04 to 24.04
But now for every action such as running python files and others, I need to create virtual environments repeatedly
When I am running it as normally. Message of externally managed environment pops up
What to do for this problem?
keep creating virtual environments 🙂 the message is there for a reason
it's trying to stop you from pip installing something system-wide, which can and will ruin your ubuntu installation
sudo pip install is the equivalent of running sudo make install into /usr/lib for some C library -- you would never do that
pip install --user is better but not better enough
so now for every use we have to create virtual env?
what do you mean "for every use"? yes, every project should have its own venv
and if you are installing python CLI tools, use pipx or uv tool which creates the venvs for you
execute binaries from Python packages in isolated environments
Thanks. Just needed this clarifcation
it's the recommended safe practice in all systems anyway, even those that don't impose this restriction
Hi all
I wrote a blog about writing a performant and extensible web server in Zig and Python
https://dev.to/brogrammerjohn/a-performant-and-extensible-web-server-with-zig-and-python-4adl
There is not much Python in there, but I hope you guys like it. And I want to hear your feedback
Complicated issue? 🧠
What happens with current directory for the exec command during an interactive rebase? I'm seeing strange issue with git grep complaining that my glob is matching files outside the repo root. I'm running git grep as part of a make invocation that looks like make -C a/b/c/ target
Outside of rebase -i --exec I'm not able to recreate the issue
Can you reproduce in a clean test repo
Do you have a stray .git directory in a parent directory?
Yes I can, I realized that git has a messed up idea of git rev-parse --show-toplevel inside rebase exec if current dir is changed.
I can make a minimal example. I'm wondering if this is related to git bisect restriction that you have to stand in the repo root.
Huh interesting
I would love to know what you found here because I suspect this will bite me one day
I'm surprised I've never run into that. Maybe it's because I never use rebase -i --exec
I'm trying to recreate it but it's not super easy! 🤔 😠
Successfully rebased and updated refs/heads/main. ugh! Not what I want, damnit 😛
I love git, but it does have some dark corners
I will have to compare git version when I get back to office tomorrow
I'm on git version 2.43.0 on my personal laptop
I can't remember the last time that the git version made a difference to anything I needed to do
You dont use --fixup=":amend:newmessage <or whatever the syntax is>" daily? 😛
I fixup, squash, and edit dozens of times per day
but I have a slick UI handle the actual commands for me
likewise, I fixup often, but not using the amend: or reword: versions
I am not sure which versions I use!
I dont use a gui though, only tig (which is a TUI)
aha, then it's probably just regular fixups. reword: is a fixup that only changes the commit message but not the content
yep I do that a lot
I doubt it creates a fixup commit though, it's probably just doing a rebase reword under the hood
bet it does both
git commit --fixup reword:HEAD is rather new, what UI do you use? 🙂
I see this ```
0 git … add -u -- project/app/tests.py
0 git … commit --no-gpg-sign --no-edit --fixup=959fef8 --
ruff.....................................................................Passed
ruff-format..............................................................Passed
djLint formatting for Django.........................(no files to check)Skipped
djLint linting for Django............................(no files to check)Skipped
[just-for-fun a9f6205] fixup! Maybe it's time for a nap --
1 file changed, 3 insertions(+)
0 git … rebase -i --autosquash --autostash --keep-empty 959fef8^
Successfully rebased and updated refs/heads/just-for-fun.
not sure how to interpret that
the ui is called "magit", and it's the best UI for anything that I've ever seen. Unfortunately it is not available to you, or to any normal human.
I know it's emacs plugin 🙂
you must be a member of the super-sekrit "Crazy Emacs Users" club to use it
and much as I love Emacs, I would not recommend that you use it just for magit.
Unless you're into weird-for-the-sake-of-weird
At the office (20 engineers) emacs was the most used editor until 4 years ago. Now vscode and vim users are more numerous.
Everyone uses emacs through script or command line tool for 1 specific feature of 1 specific plugin/mode 😛
wow, curious
I've never run into more than a couple co-workers who used it, and that's when I worked for a giant globe-spanning company
anyway, the word "reword" doesn't appear in magit's own git log more recently than 6 years ago, so you're right: it doesn't use that fancy new feature
I imagine they don't use fancy new features unless there's a huge benefit, since of course doing so would break backwards compatibility
there's no reason to use the fixup reword: unless you want to delay the rewrite of the commit history (updating/replacing the original commit would give you new commits for all following commits.
...
that just proves I have no idea what that feature does
git has added piles of new features in the last couple of years, and I haven't learned any of them 😐
shame that https://git-scm.com/book/en/v2 isn't kept up to date
I liked this blog! https://github.blog/open-source/git/highlights-from-git-2-47/
scarily close to my issue, but I doubt I have that old of a git version at work 🤔
2.15.1.txt: * A recent regression in "git rebase -i" that broke execution of git
2.15.1.txt: commands from subdirectories via "exec" instruction has been fixed.
On the other hand git v2.16 is 5 years old, and I run Ubuntu 18.04, so ...
I also have a git question
I forked helix, added some commits of my own
currently the fork is both behind and ahead of upstream/master in commits
there's a PR in upstream, that I want to take
it starts from a considerably older commit than my fork starts on
the pr also has messy multiple branches, with merge commits here and there, so I can't just cherry pick the PR's commits to then put onto my fork
how would I go about merging in / rebasing a PR like this? git merge-base is returning nothing, merging errors with the message of "refusing to merge unrelated histories"
is the best course of action to just give up, because the PR is too messy, or is there a reasonably good solution?
it's odd that "git merge-base" says they're unrelated, I wonder if you're doing it wrong
is your work someplace where I can see it?
I assume it's https://github.com/Axlefublr/helix
the PR I'm talking about isn't listed there, lemme find it so the example is more clear
possibly. I was doing gh pr checkout <id> to get a local branch of it, and then git merge-base pr-branch upstream/master
https://github.com/helix-editor/helix/pull/2796 this is the PR I'm talking about
I've implemented a few other PRs into my fork, with those the commit history was clean, so I could just cherry pick the commits and place them onto my branch, however this PR wasn't this straightforward
cherry picking has a nice advantage: I could squish all those commits into an older "merge #123 by @author" commit, retaining the commit messages and co-authors; seems like it won't be that straightforward with this PR
I considered just doing some sort of reset, but it's hard to understand where the commits of the PR start, they mix together with master in such a way where it's hard to understand how I'm supposed to get just the PR's changes
I'd add upstream as a remote (if you don't already have it), and just try merging ... lemme see if I can do it
I'd add upstream as a remote
if I understand this correctly, yeah I already have this
upstream is available in my remote branches
looks like upstream never merged it fwiw
yeah, that's why I'm trying to merge it into my fork
regardless of your success, would be glad to hear your thoughts
this is not a show-stopping feature, so I'm just interested to learn more about the dynamics of project maintenence, most of all
helix has a bad habit of ghosting mostly finished PRs implementing important editor features
which is why I started my fork, to add things in. so far, with far better success than expected!
hm, I'm stuck; the PR doesn't exist as a branch in the original repo; and I don't have the "gh" command set up, so I don't know how to get it
and I don't see 'helix' at https://github.com/QiBaobin?tab=repositories 😦
it will most likely be packaged by your package manager, on arch the package name is github-cli
the cli is very simple, and often times interactive, so there's no setup required really, and if there is, it tells you
in the Old Days® a pull request included a URL from which you could fetch 😐
yeah they seem to have deleted their repo
however checking out the pr with gh still gives me the branch
well I'm making dinner at the moment; might get back to this in an hour or two
alrightie have a nice dinner!
perhaps this is the case here too? I wouldn't know, I'm only starting to gain experience with working with prs, realized I could checkout PRs in a convenient way just yesterday
ok, just tried git … merge --no-edit prompt-history, and got a conflict in a single file
which should be solvable. (I am not about to try; I have no idea what this project does, and I don't remember any Ruby)
interesting!
thank you very much :3
i need a tutorial for the --fixup option. i use interactive rebase all the time but it seems like there are fancier tools now
yesss same actually
I really want to learn how fixup commits are useful
considering that I can just amend a commit anyway
or rebase and blammo
well i have definitely wanted to amend a commit that wasn't the most recent commit
so I feel like I can already do things fixup commits do, more easily, and don't quite get their usecase
but i don't understand how --fixup works after reading the manual
right, same here
i can just do reword or fixup or squash inside an interactive rebase and be on my way
I use lazygit fwiw, and amending an older commit just does a rebase automatically for me
or is the idea that i can do a non-interactive rebase and still get fixups? i prefer interactive anyway so i can check that the todo list makes sense
while also providing easy functionality for fixup commits, for not sure which reason
i wonder if it's using this --fixup option internally
yessss same
I doubt it, although can't provide a well thought-out reasoning as to why
if that's it, it would be quite underwhelming ngl
my hunch: traditional git tools discourage you from "modifying history", and instead create new commits whose log message starts with "fixup:"
However, I, and I suspect many other people, modify history willy-nilly, so we don't really need such things
It's like any other fixup commit, but let's you modify the commit message as well.
The manpages for git are great. Check
man git commit
If you are more than one person working on a branch, it's less disruptive to create new fixup commits and modify the commit history later when others are ready for the change.
I create fixup commits with keybinding directly in tig, or by doing interactive rebase directly from tig as well. Lazygit just automates this somehow for you. Since I know how to do it by myself, I just prefer the control that gives.
So a squash? If I mark a commit as "squash" instead of "fixup" in interactive rebase, I get to change the commit message.
Ah, I looked it up, so to sort out the confusion for people like me who've never used --fixup:
It's a flag for git commit that makes it actually not do a fixup (yet), only mark the new, regular commit as being destined to be upfixed (?) on a specified commit later: When you rebase with the --autosquash option, which will reorder and squash/fixup the commits based on this prior annotation.
Correct
well yes, and then you apply those fixup commits to modify to commits regardless
so I'm trying to figure out why them, instead of just rebasing directly
ohhhh okay that makes more sense
but don't fixup commits simply work on the commit right before them?
so say you have these commits:
banana
orange
potato
scalpel
and you want to fixup potato.
you would have to insert the fixup commit like this:
banana
orange
fixup!: whatever
potato
scalpel
, changing the history regardless. you might as well have just rebased
this is even truer if all of these commits are already pushed
because if they aren't, there's no loss in rebasing anyway
but if they're pushed, you'll be changing commit history twice (by adding the fixup commit, and then later squashing it), rather than once (by just doing a rebase once)
would be happy to be proven wrong as I'm desperately trying to find a usecase for fixup commits
No, the fixup commit can act on any commit. You give it a sha and they are linked with the commit msg. So you would have:
fixup! potato
banana
orange
potato
scalpel
ooohhhhhhhhh
okay, that gives them a lot of worth
however, completely useless to me in specific, I don't work in repos that do development in main, rather than extra branches
so I wonder if they have more usecases than this one, for them to be useful to me too
And then you can do rebase --autosquash
We always do work on branches as well, but we are always co-working at least 2 on each branch
ohhhhh
haven't heard of that before
it's probably more common than I think though
hmmm yeah I do see the value for them, from your side, definitely
Currently we are all 5 members of the team on the same branch, which requires a little bit of discipline. Not too much though 🙂
huh!
uhu! 😇
heh?
Remind me, I will see if I can minimize my failing case. It does not seem to be a version issue at least. 🧠🐁
Aha!
This is a command sequence that causes the error I had. Please see if reproducible if interested.
It mixes git rebase exec, make -C and git worktrees:
mkdir repo
cd repo/
mkdir dir
echo -e 'lint:' > dir/Makefile
echo -e '\tgit rev-parse --show-toplevel' >> dir/Makefile
echo -e '\tgit grep "banana" -- "$$BANANA"' >> dir/Makefile
git init
git add dir
git commit -m"Intial commit"
git worktree add ../repo2
cd ../repo2/
BANANA=$PWD GIT_EDITOR='sed -i "1s/noop/exec make -C dir\/ lint/"' git rebase -i HEAD
And what is the error? You end up in the main repo dir and not the extra worktree dir?
The git grep command completely fails with a Fatal error
You should be able to reproduce by just running that short script in a new folder.
The worktree misunderstands where the repo root is.
In a sense. I raised an issue about worktrees a year ago that the first "main" worktree is handled differently than other worktrees, but at that point it was just a small layout/print difference. It's a known issue.
So this might caused by the same underlying issue.
hell yeah! a classic W kaddkaka issue
and for very widely used software, to boot
super appreciated
even though I don't use git worktrees, it's continually nice to hear you contribute through issues and such
awwwww I love your pfp
W? 🤔🤓
internet slang, short for "win"
commonly used to praise someone
and there's the opposite "L"
which stands for loss
Oh, never seen 😁👌
I reported this as a bash bug and the developer Chet Ramey apparently already provided a fix to bash devel branch! 😎 https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=254081c09767738833cdf161b4bc3feb1a51690a
+ 9/24
+ ----
+jobs.c
+ - start_job: don't fetch the tty settings if we're being called from
+ a readline key binding (bind -x) or programmable completion
+ From a report by David Moberg <kaddkaka@gmail.com>
🤩 😎
heyyy
👋
My grandpa made unix what it is today RIP
Your grandpa was Ken Thompson?
Was? AFAIK Ken Thompson is alive :)
guys do i pick linux or mint? or is there any other os you guys recommend cause i wanna dual boot linux on my system
mint is linux
I think you're asking: "which distro should I choose to dual-boot"? My answer would be: find other people who are doing it, and see what works for them.
If I had no other data, I'd go with Ubuntu, simply because it's the most popular distro
ubuntu and mint are both extremely popular
sure whatever
which is relevant, because as a beginner, you'll be able to get more help more easily
@junior comet if you have no clue, good enough idea to pick one of them
hence my suggestion to see what other people are using
i meant ubuntu 🫠 instead of linux in that sentence
idk brain got fried or somn
I've heard better things about mint than about ubuntu, fwiw
yeah i was thinking ubuntu simply cause its more popular and more tutorials exist for it
I cannot name a single of those things, but the general consensus I heard is that people enjoy mint more
this is valuable also, though
for example, no snap
yeah same thing i have seen but its not as popular in terms of help while searching
wait i thought snap was nice? is it not
oh damn
I know a guy that actively uses them
flabbergasts me
surprised I haven't blocked him yet /j
i have seen few vids that talk of it as a positive point
I used a snap once by mistake. It was ... annoying
it's controversial
to say the least
idk what it exactly does nor why its used as much
nice, good job on researching
it's super-containerized
bruh i searched snap and first comment is why do people hate snap
with linux, you'll need to do that a lot, make sure to retain patience
yeah if i am gonna dual boot i prolly wont be changing it anytime soon
the snap I used was of some software that creates a file, and the docs for the software clearly stated that the file gets created in the current directory. But because it was a snap, instead of a normal program, it actually created the file in /var/snap/)#(*$&()*#*$(*&#(*&$(*&/youll-never-find-me-mua-ha-ha-, which took me a long time to track down
IIRC, a major point against snap is that the backend is proprietary
the most realistic case is that you're going to find them useful for a while, and maybe in the future realize the issue with them
i see
for now you don't really need to worry about our nerd points about snaps
it's probably telling that nobody but Ubuntu uses them. If they were genuinely useful, I'd expect to see them used more widely
it was developed by Canonical, so of course Ubuntu uses them
don't be afraid to try things out! you can gain pretty valuable experience by trying multiple distros for a noticeable amount of time
if it's something you would be interested in
on metal, I've tried debian (hated it) and then switched to endeavor os, and loved it ever since
thank you
tbf main reason why i am trying to switch to linux atm is cause i dont wanna use windows 11 and windows 10 support ends next year
oof that's sucky
and ubuntu feels nice on my vmware
It's faintly conceivable that if I used snaps a lot, I'd come to appreciate their advantages ... but that hasn't happened yet 🙂
i use ubuntu whenever i wanna do something related to networking
nice, linux is amazing, especially in comparison
hope your journey isn't going to be too difficult
yeah hopefully
you'll be amazed once you have it on hardware!
linux performance is insane
If those are your only criteria, then you should consider MacOS.
prolly will be debating it for a while, might put some on my vms and see which one i like
i mean...wouldnt macos be optimized for like apple hardware
or BSD
Not just "optimized for" but "only runs on"
or as I like to say: "you could make the argument that [example argument], but I'm not gonna make that argument"
well you could say that
ah...no i am not planning on buying an apple system 💀
ok, Linux it is then
indeed
so far i have tested mint and ubuntu
kali as well but not that interested to use kali
lmao don't
damn
a funnier suggestion would be nix
yep
i should try arch just for the memes
there was a time when I was fascinated to try out all the distros.
but now https://tenor.com/bjFit.gif
arch is actually genuinely really nice, I've been loving it
but jumping onto arch before you realize what your problems it solves, without first having those problems, makes no sense
that's true for ... any technology at all, really
my biggest gripe about most technical documentation is: they rarely explain the problem that the tech is intended to solve
it's impossible to make a rational choice if you don't know that
for the most part, yeah
but especially true with arch, because it does have a pretty glaring tradeoff
so it's not just a direct benefit
you're paying for that benefit, basically
what's the big tradeoff?
yeah i currently have no real problems so far
i have like 2 main criteria atm for what i wanna do in linux
- tutorials and troubleshooting stuff should be easier, aka when i run into an issue or need to do something in linux, there should ideally be a tutorial for it
- ease of use, i will prolly not be doing much other than just projects or work related stuff rather than configuring the system considering most of my time is just gonna be spent on the ide or browsing
because the versions are very up to date, less stability because of less testing of all those different versions together
it's not catastrohpic, unlike some people suggest, but it can be noticeable
OK, this is now 50% serious -- https://www.linuxfromscratch.org/
I've never tried it myself, but it's been around a long time, and appears to get frequent updates. It's hard-core low-level stuff, but I bet if you went through it you'd be able to get a high-paying job
I'm having a hard time coming up with the example, but something like python2->python3 is just a direct upgrade of the software, while debian and arch more so use different tradeoffs to give you different things, rather than one of them being directly better
hmm its certainly interesting, altho it looks more like a holiday project tbh
2 days aren't going to be enough
yeah prolly a week long holiday where i have no other commitments
yep! possibly that
although I'm unsure how reasonable of an adventure it is for a complete beginner
I wouldn't recommend it
yeah going through it, there is a lot
yeah dw about it for now, or ever honestly
get comfortable with actually using linux at first
fair enough
get acquainted with the command line to some degree
there is a LOT of power in the commandline, although idk how much power you even need
so, focus on solving problems you actually have, basically
hmm so far i dont use the cli as much even in ubuntu, maybe it will change for future projects ig
maybe its cause most of my projects just involve web dev or aiml stuff
it's hard to come up with a use for something if you don't know how it can help you
I would strongly recommend proactively learning about the commandline
get youtube to recommend you some shell tutorials and such
things like "top 10 most useful bash commands!"
yea ig i can browse through some of it
even iceberg level knowledge is beneficial
since you seem to be a developer, linux commandline is a pretty strongly important skill
I am a cli junkie
I like making interpreters for my microcontroller
Oh and i make all my own commands i don't use linux anymore
Tell us more 👀
Got hacked too much
Sure ask me questions plz do
Plymouth is for persistence or was and bluez is how they hacked me for a long time
Bluesnarf
I h8 hacking btw love code i'm like the younger richard stallman imo
I know 59% of the words you use..
I destroyed the arduino language in days moved on to the raspberry pi pico w and been here for weeks love it i'll teach ya if you want
Ik inline asm bin hex dec chr etc everything. you interested?
Oh and do you use python3 or micropython? i will give free code today
Anyways my grandfather helped build unix and now i will present to you all my own custom version made entirely from scratch TyWin OS no kernel none needed
while True:
Indent
a=str(input("$: ")
if (a=="clear"):
Print \n
There is your code you can now make a microcontroller your base or house or heaven hahaha
Tywin wins
Also i'm a sexy 24 year old man lookin for a computer girl lmk if there are any unix girls out there 🥰😍
I have more on registers if you wanna learn
More code
what if a isn't clear
honestly i think instead of hoping for a tutorial users should have a decent understanding of the system to try and fix it themselves
troubleshooting and things breaking is an inherent part of linux and if you hope for a step by step guide for every issue you might not have a great time
at least in my experience
but if it works for you. pop off, my opinion is pretty irrelevant
This. It will help you to understand the basics from early on and how to get more information.
manwhichand$PATH--help- difference between shell/terminal
- difference between command/alias/function
and like I use to say: there is no magic.
this is why i recommend gentoo linux to all beginners ||/j||
(but fr gentoo made me a linux machine)
Hmm? Explain, is gentoo very broken or what?
no but its about as close to linux from scratch as you can get without linux from scratch
you manually build everything, configure grub, kernel, ect
ah I see
you can do basicalyl whatever you want from a fresh install
and things break a lot if you arent a linux god
but since you are in complete control it can be insanely stable
basically the issue is always the user not the system
and portage is godly if you use it right its one of the most stable dependency managers in unix
i am bias though since i daily drive gentoo on my computer
I see, I just run Ubuntu as it's what we have at the office.
So... how would you compare gentoo+portage and NixOS, different beasts altogether I guess
yeah nix is just a whole different beast
nix is like, if i need 100 comptuers to work out of the box for my employees
ill use nix
Because that is what some of colleagues are using, so that would be my convenientest option to ubuntu
gentoo is like, i brick my system weekly so i need as much control as possible to bring it back from the depths of hell
source: i brick linux a lot and gentoo has saved me
arch fucked me over multiple times
pacman is just terrible IMO
and i cant stand the arch community
the 2 things i hate
oh and they think installing arch is hard 
good to know
I wiped my system to install nixos a few weeks ago
It's great when it works, but when stuff doesn't work there's a bit more work involved to get everything working since a lot of how nixos does things is different
that would be so inconvenient
how do you get anything done?
i use gentoo because its the most stable for somebody like me
No; Why do you brick your system weekly?
pacman really liked to remove python core libraries for me
portage has been stable, arch was not
So use something more stable? Lol
I've never had any issues like that with normal distros - Ubuntu, RHEL or SUSE based, Clear Linux, etc.
i just like the control you get with gentoo
building gentoo yourself step by step is fun
if i ever get tired of gentoo ill probably just go to mint and never touch a config file again though
smh. Idk how that's fun. I have 500,000 other things to do besides waiting for my system to compile instead of using it
you can use it while its compiling
i do it all the time
you can set how many threads you want to use on portage
so i could use 2 threads then use the rest for any other comptuer activity
or just sudo emerge -auDvn @world then go to bed
wake up with an updated system
to be honest we are at the point of computing where compiling something isnt crippling a machine
maybe in 2001 gentoo wasnt useable while compiling a kernel but thats not the case at all anymore
(i dont even think gentoo existed in 2001 lol)
it's not about resources, it's about time. I don't have time to compile something everytime I want to use it 
you can setup a binary mirror which uses a binary if its available
and theres bins for things like firefox and chromium now
even a kernel bin
at that point, you might as well just use any other distro that hosts a repository for you ;)
nah
i still compile plenty of stuff
i also only have 8gb of ram and i prefer to have as much available as possible
gentoo has by far been the fastest system ive used
and the part i enjoy is that a fresh install comes with completely nothing
bare bones linux
i also find that the learning experience you get from gentoo to be very rewarding
you probably arent digging though xorg logs on mint very often
oh i forgot my favorite feature
portage USE flags are godly
i can set something like USE= 'X nvidia -bluetooth -telemetry which tells portage to always install optional X and nvidia deps, but ignore optional bluetooth or telemetry deps
you can also set portage to only allow certain licenses which is super cool
I sure hope not! I have better things to do than troubleshoot things all the time
exactly, lol. Like i said, I have 500,000 other projects to work on at home, I need to operating systems to be stable so I can I actually do them
anyways
that was a very unconstructive conversation
and a long way of saying people have different wants and needs
I kept saying for several years that I'd stop using arch when my system properly broke because I didn't have time/interest in maintaining it. It refused to break on me
trying to use a fancy distro gives me nightmares nowadays
The only system I haven't been able go break has been gentoo
Arch self destructed a few times
ah i didnt really mean tutorial for fixing something wrong with the system, i meant tutorials in the form of new applications or software that is compatible, for example for network simuation we use ns3, and pretty much every tutorial for ns3 is based on ubuntu
so its just a lot more convenient to not try to troubleshoot issues on a different os cause everyone is showing troubleshooting and tutorials based on ubuntu
for this ns3 thing, i couldnt even find anything related to being done on mint or something else
could someone please explain / point to the correct docs about git's "fast forward"ing? I don't really get what that means, and the wording doesn't make it obvious for me. I've been using git for a while and I've made several programs around git, so I understand most things fairly well, except fast forwarding
When merging a completely linear history (i.e. the commits are all based on the one you're on right now), Git by default doesn't create a merge commit, but instead just advances your head to the thing you're merging; or it fast-forwards. You can force it to create an (empty) merge commit instead to better show that some group of commits were on a branch.
HEAD somebranch
| |
a - b - c - d
If you are at HEAD and git merge somebranch, you will just move to commit d.
ohhhhh! what a lovely explanation
the name "fast forward" makes more sense now
thank you!!
@final island it's not unlike git reset-ing
basically it just moves HEAD without creating a merge commit, but it will only do it if it's "safe" to do so (i.e. not with the full power of git reset)
ohhhhhhhhh
so it's a metaphorical git reset --hard branchie --unless
or --ask-for-consent, opposing --force
which I'm pretty sure doesn't even exist for git reset ahahahaha
@formal pasture I wrote an example package for implementing daemon processes in both Unix (double-forking) and Windows (detached processes), if you want to look through it:
https://github.com/thegamecracks/daemon-example sh $ thedaemon start $ thedaemon start Daemon already running $ thedaemon ping pong $ thedaemon stop stop $ thedaemon ping Failed to connect to daemon; did you start it? Given my lack of experience in the subject I can't say if the implementation is good, but that might be sufficient for your project. Of course, it's still up to you to decide how to handle re-scheduling; if you stick with a selector-based server like mine, it would be theoretically possible to implement sleeping by setting a .select(timeout=) to wake up at a given timestamp, but asyncio can also work for this purpose as well
(hmm i probably should have posted this in #async-and-concurrency )
Wow! Awesome!
Nah, i think this is pretty unix aswell
Thanks!
Yeah, but to be clear, it's more about the current committee being an ancestor of the fast forward destination
The name is a metaphor for "fast forward" on a VCR or cassette tape -- just jump forward in history without changing anything
speaking of git
I accidently added a file to be staged when I wasn't ready for it, so I ran git restore --staged $file, then did a commit. Now git status doesn't show the file at all, but it also wasn't committed, and git add --all still doesn't add the file. I'm confused, how did it get completely untracked?
Is the file physically present still?
yup
Does it still contain your changes?
it's not visible at all in git status as changed?
nope
what does git status -vu $file report?
whoops, meant to reply to @tribal finch
Thanks for the ping! I’ll go check :)
and: does git show HEAD:$file show your changes, or show the old version?
sorry, just got back to my desk
nothing
it shows the current version, not the old one
Is there an area for docker ?
then... the repo does contain the new version
why do you say it doesn't?
the change isnt' reflected in github when I veiw it in a browser
maybe you missed a git push ?
yup, that's exactly it 
anyway, learned some new things about git, so thank you!
I did one, but I guess I ended up with a commit, push, and then commit, but not a second push 
yep, got that
What is Unix anyway?
Unix is a basically a dead operating system, but most operating systems besides Windows are based on it and are call "Unix-like" systems. Here are some key differences between Windows and Unix(-like) systems:
- There is a standard set of utility applications for the command line
- Programs are usually stored either /bin/, /usr/bin/ (less common apps), and or somewhere in a user's user folder.
- Slashes are used instead of backslashes for directories and there is no C:\ D:\ etc, there is one main drive and every other drive gets mounted in /mnt/
- root is the user which has all control of the system and Unix usually has better permission systems for files and users
Unix ( , YOO-niks; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.
Initially intended for use inside the Bell System, AT&T licensed Unix to outside partie...
Some OS's based on Unix include Linux, MacOS, FreeBSD, Android, and iOS
Basically every OS that's widely used today, with the sole exception of Windows
And if we extend Unit to Unix like, then it becomes the most used OS indeed
which dominates ...pretty much everything except Windows Desktop.
- Android? Unix like (some Linux based)
- Servers? Linuxes
- Embedded devices, Arduinos? Linuxes
- Favourite desktop dev machine? Linuxes 😏
Arduino isn't Linux, actually
Raspberry Pi OS is a Unix-like operating system based on the Debian Linux distribution for the Raspberry Pi family of compact single-board computers. Wikipedia
okay, unix like too
Based on debian though, soo... Linux 😏
i meant apperently Raspberry Pi then.
not sure what is used there for Arduino
it would be great that Microsoft releases a unix-flavored version of Windows