#unix
1 messages Β· Page 43 of 1
yes
okay running localhost/data.csv downloaded the CSV
but i'd need to load into my JS code
Well everything from your webserver gets "downloaded"
Its just what your browser decides to do with them
if you load them from js the thing that is actually being sent is the content of the csv
if you used wget or curl before this might make more sense
the webserver simply serves files, it doesn't tell the client to download or display them
Actually I'm wrong lmao
its a http header
but that shouldn't matter for your js
yeah but what does 'serving' really mean then?
It sends some headers and then the content of the file over the connection
but then isn't it different than merely 'downloading' a file?
like how
The computer on the other side gets the content of the file either way, its just what they do with it
i was thinking i'd see a raw csv similar to what I see in gist
yeah thats because they sent a different HTTP header than you
but it shouldn't matter for loading it from JS
you'll get the same content
not sure how do I load it from JS
how are you getting it from gist?
i have its URL stored. so like:
var url = <gist_url>
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);```
yep pretty sure that will work exactly the same with the new url
do you know how to call a function only when a certain condition is true?
var myVar = setInterval(function() {
updateData();
}, 2000);
}
calls updateData() every 2s. what if I want to call it only when a specific state changes
just to give you a context, i'd need to call updateData() when there's new data in the csv file which i'm checking by comparing the file length
I don't know javascript
but couldn't you just check if theres new data in the updateData function?
or call another function that checks that and runs updateData if so
why not call updateData() when you check the file?
my bad. wrong channel
why not call updateData() when you check the file?
i need to separate out the code but currently i'm checking insideupdateData()but logically it won't make any diff
what about using signals?
cause instead of calling updateData(), i'd be reading in the file size every 2s instead
never used signals
you mean pattern?
I'm sorry, I'm not quite sure what you're doing, or why you can't fire off an updateData inside your code that checks for file changes
if you need to decouple it, register it as a callback instead
You could have a backend that tells the javascript when the file size changes
this might also be an option if you want further decoupling: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
oh, are you saying your python watches the file, and has to communicate with Javascript?
there are a few interesting ways to do that python->javascript communication, but ultimately you're either going to be periodically polling HTTP, or you're going to establish a websocket connection (e.g. python/tornado server) and push the notification for change
but I'm kind of lost here, not sure what you're trying to do exactly
no i'm not using python. i have a C code that appends to a csv and JS to read off of it and plot it out
not node, he is just serving it from a webserver
ok... so what's watching the file?
how does that file get into JS?
an http request
not sure what you mean
var url = <gist_url>
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
this is what he is doing
ok, this does an HTTP request to a url
yes
the file is in his web root
ok, I'm going to just assume there's a webserver installed and it's serving files from there and you can point a browser at the URL and download the file
in that case you have no server-side file watching, therefore your javascript is going to have to poll the file. You either are going to have to GET the whole file every time, or depending on server you may be able to do a HEAD request to get the file size instead to save on having to fetch the whole thing
once you get the size, either because you grabbed the whole file again, or because you got it from the HEAD request, if the size is different from last time, run your updateData()
if you want to abstract updateData, from whatever's doing the Ajax, you can either do that having an object that's doing the ajax polling have a method that you can use to register the updateData function as a callback to it
or if you want more decoupling, you could use Events, and have the Ajax object emit an event, that the updateData is registered to
up to you really
also consider the Fetch API rather than old-school Ajax
so the syntax for a head request isrequest.open("HEAD", url);? where's the file size stored?
and which Fetch API are you referring to? sorry i'm not too into JS. just learning a bit on the side to get this part of the project done
Fetch API is a newer interface for making HTTP requests, and supports promises, it's much nicer to use than XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
before you commit to going with HEAD, I suggest you poke it with an HTTP tool, and see what it gives back. If it doesn't give back any data like file sizes or last update time that you can use to detect changes, you're going to have to go back to doing a GET and then checking the returned filesize
(HTTP tool like Postman)
but didn't we settle on that HEAD is used to give you a specific info while GET gives you the entire content?
only if the server provides that info, and not all servers do. so I suggest you check first before going with that option
how do I check with an HTTP tool? it's a separate toolkit?
there are lots of programs that frontend devs use, a popular one is Postman
for example:
here, I quickly spun up a python server (good old python -m http.server since we're in a Python discord), and then poked a file with a HEAD request. the return headers can be seen to the right, note that it does give me: Content-Length which is the filesize in bytes; and Last-Modified key which matches the file I have on disk:
(aside from timezones)
i'm using this server on an RPI and the only supported OS i'm seeing for postman is mac/windows
Postman is a dev tool, use it to check your HTTP endpoints
you are just using it to figure out what a particular request is going to return. are you actually developing on an RPi?
I'm literally just asking you to use it or a related tool to confirm that your web server will return you file siz (content-length) headers for your file. It should but it's best to be sure. Do this before committing to using HEAD as a way to check for file changes
I'm not asking you to incorporate Postman or anything into your actual program, it is a development tool
i thought you mentioned postman in response to my question of going about checking the file size
- get postman or related tool.
- use postman to confirm to yourself that your server is providing a content-length or last-modified header that you can use to detect file changes
- close postman
- write your javascript code to make this HEAD request and extract the content-length/last-modified header to use as part of your ap
- the rest
yeah that's what i understood, and that's what i'm doing right now and like i said i couldn't find a linux compatible OS version of postman
Postman is on Linux
looks like i can't open the executable
there's several chrome extensions as well
nice
so yeah, it's giving you countent-length of only 42 bytes, check that this changes when you update the CSV file
if it does, you're all good to use file size for change detection through HEAD request
BUT also consider using the last-modified timestamp (or both!) as well
yeah but how does one access any of these headers?
getResponseHeader() apparently
so i'd still have to use the GET request to obtain the contents of the file once the condition is true anyways right
yes
now, it should be pointed out that you could just GET all the time if you're not worried about latency of file transfer speeds, which would be the case if everything's local, but doing a HEAD for polling for file changes just feels neater
and since you're using fetch with promises, you can chain promises (or await) nicely
yeah I agree
but for some reason the HEAD request doesn't seem to take into account the latest changes in the csv
function readFileSize() {
var request = new XMLHttpRequest();
request.open("HEAD", url, false);
request.send(null);
len = request.getResponseHeader("content-length"); // remains the same even tho the actual size has increased
}
setInterval(function() {
readFileSize();
}, 500);```
actually now it seems to work. wasn't updating for some reason before
does anyone know why I don't have the permissions to write to /var/www/html?
even running chmod 766 -R /var/www/html doesn't help
is your FS mounted read-only?
sometimes due to fsck or other boot issues, booting falls back to mounting root as read only
weird, can you do it while sudo?
do what? run the chmod command?
touch files in there
are you saying if i should create files using touch command or?
something like that
i observed that i didnt have issues modifying via command line. but using the GUI is what seems to create an issue
Any video editors for linux like Sony Vegas?
usually the power button does it
tsk tsk, or you can use jumper cables if you're running Debian :p
@mossy wharf are you getting into Unix?
always a good suggestion for starting; you don't want to compile Linux from scratch until after a good couple of weeks
If you wanna go hardcore
LFS is the way
@urban axle Wait have you done this before ??
fool. foolish work. we must start from the basic silicon chip and go upward
@silent vector noooo
compiling Firefox was annoying enough
@urban axle Yeah true
BUt its pretty cool though
If you want to get to the neety gritty
I just poke at /etc/passwd for fun sometimes
Yeah dont do that
it's clean and easy and I can stop anyti
oh no the ghost of sudoers is haunting me now someone get a broom
try ''' dd bs=4M if=/home/<your_user>/<.iso> of=/dev/sda '''
Thats a fun command
But seriously
DOnt try
I saw bs=4M and was already scared
HEY
this is called "can I reinstall my system from itself?"
no resetting
I wonder if you can achieve this without hard crashing....
@obtuse depot Ma man
just hotpatch each and every file and restart each service
restart services just ahead of the DD write
initd might be hard but I'm sure you can get a couple of magnets to do the trick
you know if you're fast enough you can probably just do a hard drive platter swap while it's spinning
something something xkcd butterfly :p
am I able to make my self a script where it would make a screen and go into it and run something and go out and make another one and do the steps over and over? for linux
If you mean "open a window", yeah, it's possible, at in Python and/or C (as for bash, I doubt it). As to wether you're able to do it, I don't know you, so I can't tell π. I have never done this yet, so I won't be much help, but it's definitely possible.
@mossy wharf are you getting into Unix?
@urban axle yes
@mossy wharf definitely go for Ubuntu, then. the UI might not be your thing but the internals are set up wonderfully easy and the package manager is pretty wide
I made an install.sh file, but the bash command to install gradle out of the other commands didn't work?
Does anybody know what could have gone wrong?
Is this a dependency issue?
Also should I use apt-get update just once in the starting and apt-get upgrade just once in the end?
check line endings
it's a common issue, sometimes windows-style line endings crop in and the script doesn't work but it's non-obvious
but other than that, yea check your dependencies, check your env vars, and all that
@main olive can you clarify what "didn't work" means?
i've had all-in-one install scripts like that. and i did
apt-get update
apt-get upgrade
# install all your stuff
apt-get upgrade
worst case is that it tells you there's nothing to upgrade the 2nd time
I would think the second one always does nothing
first one upgrades all your currently installed packages, and then all the new ones are installed with their most current versions
@main olive out of curiosity, how did you try to install it ? I guess it's not available in package manager
gradle is installed using sdk right now, so u need to install sdk first
yes it isn't like apt-get install gradle
so it's a sdk manager.
Ok I installed ubuntu

Wats next to learn in unix
How should I start after that @urban axle
:0
@main olive well the error messages usually tell exactly what went wrong
there is no error message, it was just not installed
also, u don't have to ping me, I am reading what you have to say to me π
How should I start after that @urban axle
@mossy wharf Well, what do you eant to do?
I would recommend messing with the terminal
Try GNU tools included
less, vi, nano, teeβ¦
there are many many tools to build data together!
and pipes help you put them from one to the other
a rather basic example might be cat filepath | hello would take the contents of filepath and pipe it as input to hello
then there is a manual way, which should work
actually never tried installing it with sdk manager
what manual way?
need to download binaries, then set up environment variables
oh yeh
O ok
Any stage 3 lads? π€
You could learn to dual-boot, as well
That's some fun !
Are these necessary files in my root directory?
[shaen@xx /]$ ls -l | grep txt
-rw-r--r-- 1 root root 23642 Jun 6 03:06 desktopfs-pkgs.txt
-rw-r--r-- 1 root root 5037 Jun 6 03:04 rootfs-pkgs.txt
Aesthetically, I dont care for the length of the file names in my root where its nothing but short fnames that are fairly compactly viewed otherwise.
you can delete those
also, why is your pc named after me
@main olive
lol. because I started with x and decided it didn't look long enough. Then I tried xxx and that made me feel like people would think it was porn. And then I realized your name is perfect, and I did note that it is your name when I chose to name it after you, but not intentionally. π
the main reason x doesnt work is because x refers to something else already
I was reading about the significance of /run/media as a replacement spot for auto mounted drives. Someone on stackoverflow said it was due to somethings called udisks performing tasks before it has access to something. So /media/ was moved to there which apparently came from /var/run where it was originally. Kind of weird.
What does udisks do differently than... mount and a fstab?
Does anyone know the command to install python on linux debian
https://docs.python-guide.org/starting/install3/linux/ its a little bit complicated because to the nature of debian, it is not always entirely to the updated version that you need or want. The solution in the article involves adding something to your sources file. The time that I did it to get up to 3.7, I built python from source off github
its possible that this is not still a problem, also.
The time i did it they only had 3.5
maybe even 4
I'm noticing that I have both a /root dir and a /home/root dir. Hrmm...
What is the meaning of this...
or just use the version that is preinstalled
if you are on base debian, nothing is preinstalled.
Literally almost nothing.
The main reason I had to deal with it was I thought debian would be a good choice for my first server, and my first server needed python 3.7, because of the tech stack to run Django. But if you install from the source, it's not gonna be enough. For that reason I dont really start with debian anymore ha
[shaen@xx public]$ ls -l .. | grep public
drwxrwxr-x 2 root public 4096 Jul 9 07:55 public
[shaen@xx public]$ groups
{REDACTED...} public
[shaen@xx public]$ touch test && ls -l | grep *test*
-rw-r--r-- 1 shaen shaen 0 Jul 9 07:56 test
How can I make it so that any file that goes into this public directory is automatically given the group of this directory, regardless of who makes it... it already gives the group sole access to write there.
I feel like there is probably a simpler way than some of the ways im imagining
@main olive chmod g+s public
this is the "setGID bit"
ty
Do these look like reasonable [fstab] options here, assuming to the left are correct UUIDs? I didn't put the swap partition on there. I didnt seem like there was a need to. I'm not certain about the fsck value on the Windows device. And because ive never seen the effects of the default options im not really sure if those are what i want for my internal storage and externals. or not.
I should have done this a long time ago on my old system lol. But I was too much of a newb when i started and then i never got around to it
the storage one works. Some is off about the hotplugable one. I'll figures it out.
It doesnt like that hotplug option i saw someone use but since i dont want it on auto anyway, hopefully it wont have trouble trying to boot. according to some random poster.
it otherwise work tho
@main olive The boot,root and home look fine
Hey, how do I bootstrap my dotfiles(vim, polybar, i3, ncmcpp etc.)? I've heard about yaml, could you suggest me how do I acheive easier management of dotfiles?
I know it's off-topic, but any suggestions would be appreciated.
that's an open question
there are a few solutions
some people use GNU Stow
some people write their own scripts
some people use a tool that i used to use called Dotbot
(incidentally written in python)
Guys! What is the best method to watch a folder in unix for changes? I've heard "inotify" is one way of doing it, but I think I've heard of others too and want to use what's best. Thank you and sorry if this is a dumb question. :I
@thin hawk GNU stow, yadm, dotdrop, dotfiles, chezmoi, homeshick, etc.. pick your poison
@pulsar vapor try entr
@robust cave Thank you Kosayoda!
Thanks
how can i follow a port forwarding request?
trying to see if it is actually going via a remote bastion before hitting the endpoint i want
Ho ok tq
I love to swap. I do it all the time. I wake up, I do some swapping to get my day started. Sometimes I swap just for fun and sometimes I do it to relax myself in the evening before going to bed. I love to swap. I removed most of the ram, left only 20mb for the swapping. I use old hdd that my dad gave me before he passed away. With his last breath he told me: "Son, do not listen to the naysayers, swap is all that matters, swap is the answer to the meaning of life, swap swiftly, swap with pride." I always listen to those words in my head when i swap with that hdd, my eyes tear up and sometimes I get a tingling sensation through my whole body. I need to swap right now. I failed school because all I did was swap, they fired me from numerous jobs because all I did was swap. I swapped my wife and kids, I swapped my career, I swapped my future. I want to swap my life. I love swap. pls help
you know, these days I've noticed by default linuxes (by which I mean ubuntu since that's all I seem to install these days) has switched from swap partitions to swap files
I think this is a good thing. I'm fed up with losing disk space to swap partitions just because the RAM in this computer is disproportionately large compared to the drive space
16GB RAM on a machine with only 100gb of drive space, if you follow the old 1.5x rule of thumb for swap partitions, you've just lost 25% of your drive to a swap partition
1.5x swap for 16G ram is ridiculous
i don't think you even need 0.5x of that
16 + (16 x 1.5) = 40. I have 40G memory and no swap, and regularly have a pretty heavy workload (multiple browsers, VMs, Burp, electron apps etc) and I've never encountered my memory getting full to the point where I'd need to swap
that is true, and on server machines none of this applies anyway. but my point still stands that swap on root fs is probably a better option for most people these days despite the drawbacks, and I'm happy that that's the case
it depends on your host fs, to be honest
if your swapfile is on a journaling or COW fs, it's going to drastically hit the performance of the drive and perhaps even the lifespan
the main benefit of swap-as-partition is that it runs its own fs with basically no overhead and potentially troublesome fs features, such as cow
my thoughts on this is that you want to not swap. and swapping is a backup plan in case things go south in the RAM department. Things will be terrible, but you're not going to hard crash while you're swapping heavily
if you do swap a lot, then yeah, swap partition might be the way
@robust cave You told me a hell of a thing, chezmoi is wow, i'm working on makefile, would surely share my dotfiles. Thanks man!
@pale harness pyenv
what
ah wait- nvm i got it
no, nvm is for node versions, you should be using pyenv
do you need remote server specifically ?
I mean , only I want to mess with it and have some files in it
and I wanna run the files sometimes
I see
AWS does the same as far as i remember
but google one is the one i've been using myself
Do they need credit card info?
So I can't do it
even after 12 months expire
dont you have a credit card
maybe they added paypal as an option
well
maybe your relatives do
its free of charge
they just require information
as far as i remember
But the problem isn't the site
It doesn't support credit cards
Iranian credit cards*
ok...I live in Iran and it's not supported
@hollow linden (not that this is on-topic for this channel, but in case you don't realize this): US companies are not allowed to do business with Iranian nationals. If they were to take your money, they'd be committing a crime.
is anyone able to record audio from their terminal using mac os? I'm trying sox, it's not working for me
ok.... it works on Terminal but not iTerm, why would that be?
hi anyone here knows about raspberry pi? I have a one from 2012 I believe, when I try to sudo apt-get update, it manages to fetch some things, but then it tries to reach some links and it gives me a 404 Not Found error, this happens to every update/install that I try to make
I tried to get pip by sudo apt install python3-pip and it happens the same
if someone could please help me I would really appreciate it
likely it's running quite an old OS, which has since moved their apt lists elsewhere
you can either go look at your apt lists and get new URLs
or, consider reinstalling a newer OS
I'd recommend reinstalling if you're starting fresh. now's a good time for it
Does top show if it's using 100% of the core or utilizing 100% of the core?
100% of the core available time
what's the difference between using and utilizing ?
It's the same idea, but not the same word : 'to use' vs 'to utilize'.
I think there's a minor subtelty between the two, but I can't put my finger on itβ¦
Anyone know how to launch a new vlc process from terminal in such that when the terminal closes, it is still open?
thanks
<IN> is just a placeholder
I think the way this works is you specify a prefix once to i and your files are supposed to be named like the docs show
So if your prefix is hello then your files should be named hello_params hello0_int and so on
Probably, but I am not sure
To me, you wouldn't omit anything, you hust should rename your files according to the pattern; then, you just pass the common prefix as paramter to -i. For example, rename your files hello_params, hello0_int, hello1_int, hello_blast, and then just call ./networkblast -i hello -o whatever
Guys, how do you test your regex for egrep commands? I'm using: https://www.regextester.com/109207
Regular Expression to GREP generator for autotests
But it doesn't work when I try it in my terminal
I don't know of a site to test egrep specifically. Your site does support the PERL style, and so does GNU grep with grep -P.
I'll try grep -P, thanks so much man
anyone have any good vm recommendations cuz im thinking about setting up a unix flavour on there
What kind of recommendation? VM software, or a Linux distro to put on it?
vm software
Wdym by flavour?
Yeah, that's typically called a distro (short for distribution)
lol ive been calling em flavors
Everyone is gonna have a different preference. Just trying something out and see if you like it. Don't get too caught up trying to find what is "best"
I use Arch Linux but I would absolutely not recommend it for a Linux beginner.
Maybe Debian?
Heard good things about Mint and Manjaro too, but cannot speak from experience.
It's spelled Ubuntu
which distro do you guys recommend for turning an old laptop into a server of sorts to run discord bot(s)
Same as for a "regular" use, i.e. Ubuntu/Debian, imho
just boot it in init 3 / use the server version of the distro
thank you
I was thinking of init3 but felt that Manjaro (my main OS) is not the best choice.
I think I'll go with Debian.
debian for sure
old laptop seems like a good idea for a server, should be a lot more power effecient than e.g. an old workstation pc
Rolling distros are easier ... change my mind. I would absolutely recommend arch/manjaro for your avg. window gamerchan over Debian/Ubuntu.
debian testing is damn near rolling
i dont have anything against arch
arch might be better just for the sheer breadth of the package ecosystem
Rolling distros are easier until you hit a world-breaking bug, like a package that removes everything in the root filesystem when the package manager (running as root) tries to remove it, or something like that.
getting the latest and greatest packages as soon as they're available is all well and good until the latest and greatest version of a package corrupts a file you need, or breaks a feature you rely on, and then they're annoying, and in those cases you would have been thankful for the distribution to have gone through a testing period before you got that package.
how do I activate my venv?
Are you on linux?
If so, it's source ./activate
Well, you don't necessarily have to be on linux. The above will work if you're using something like bash as your shell.
Oh this is #unix, silly of me to ask even
You didn't type what I showed
Though I wonder why you have exe's in your environment if you're on linux
oh
Did you copy it over from a Windows machine?
well source didn't work
I wanna activate it cause all my modules are in there
I can't start without being able to activate it
and I gotta figure out the path
or I can't use selenium :3
I'm honestly not sure. I've barely used WSL. Is it possible for you to recreate the venv through WSL?
I wonder if it will still generate exes in there if you do it inside WSL
well yeah
not sure though
without a UI I had to navigate everythiing in a CLI
which I guess was the point
plus i'm liking the CLI
it's so much faster
Usually on linux the venv activate will be in a bin folder instead of Scripts, and you'll have linux binaries instead of exes. Not sure what happens in WSL though
source .venv/bin/activate is how I activate venvs in bash on linux.
By the way, you can create a new venv with python -m venv /path/to/new_venv_folder

I just gotta find the path
add gecko driver to it
I just have no idea how to do that
theres always yt lol
Rolling distros are easier ... change my mind. I would absolutely recommend arch/manjaro for your avg. window gamerchan over Debian/Ubuntu.
@plush sparrow sorry for the late reply, but would you recommend a rolling distro for a server?
I like Manjaro for the rolling releases but was not sure whether that would be the best choice for a server (guys feel free to ping me)
Hey, I've got a utf-8 text file, apparently you guys dislike uploads here, so please get it here: https://mega.nz/file/sNgQxYZK#epGSG700QKg-NgdjD4_D5SxzAX5QiNJO2NxvU1-d6N4
The problem is that reading it in a usual way produces 63-char long string
While simply copying it into ipython produces 36-char long string
I tried various encodings, etc, but can't find the way to read it in such a way to produce the same 36-char string as I'd get by simply copying
Anyone knows the solution?
@summer trail yay is not running as root
why not python open() the file?
@nimble panther Nope Debian /CentOS/Ubuntu
Do the job fine
Also they are the standad
And you can find solutions very easily if a problem occures
why not python
open()the file?
@obtuse depot well, try opening and reading that file, it produces different result from just copying the string.
maybe you have some kind of encoding issue
I suggest exploring why your encoding is off, and using appropriate encoding options to load it correctly, otherwise open as binary and do the conversion yourself
a hex editor can help
@plush sparrow Whats nix based
On
Have heard of it
But just dont know what distro family it belongs to
Totally custom
P sure it's source only yes
I got no interest in linux as my os, I'm very happy with windows, however I would like to get comfortable using ubuntu server. I have a spare partition on my computer, can it be installed there no problem or will that not work?
it can be installed there but be prepared to do some troubleshooting, dual booting isn't always just plug and play
Do you mean that the server version requires special boot options? I've used the partition with a few other distros to familiarize myself and never had issues.
I mean windows isn't great about being dualbooted
on ubuntu your bootloaders should work fine, but you'll still have to deal with like clock differences and such
Oh okay. Yeah im familiar with that. Thanks for the heads up!
but how are you planning on using ubuntu as a server? You will not be able to use windows and ubuntu simultaneously
Well he can still practice on it without running persistent services
Yeah that's the plan, I just want to play with it for future reference. I've been using docker containers, which work fine, however I want to compare them to the real thing.
using WSL on Windows might be a better way to learn the Linux command line.
lower commitment than dual booting, and most everything will work the same.
Or a VM i guess
any one working on kernel module??
yeah. what's up?
Why is this working? ./foxit-reader-install.run but this one isn't working source foxit-reader-install.run ?
I Googled it and as far as I know sourcing runs the script in the current shell, while executing will run the script in another shell. But why would running the installer script in the current shell not work?
@topaz hemlock What isn't working about that?
~/Downloads $ source FoxitReader.enu.setup.2.4.4.0911\(r057d814\).x64.run
FoxitReader.enu.setup.2.4.4.0911(r057d814).x64.run:20: parse error near )' ~/Downloads $ ./FoxitReader.enu.setup.2.4.4.0911(r057d814).x64.run`
[this time no errors! installed successfully]
@topaz hemlock look at the shebang
It probably isn't a shell script
Or might be for a different shell
Hello! I am new to Python (also I don't know where to fit my question). I wanted to ask if it is possible to have two different versions of Python installed on Mac? I have currently Python 3.7.7. but I need Python 2 to run a program which is working only on Python 2.
yes, it's very possible, and easy to manage using pyenv: https://github.com/pyenv/pyenv
Thank you for quick reply! I will try
@formal schooner it's not a script, I open it with a text editor and there's no shebang. Just gibberish.
do file xxxxxx it'll tell you what type of file it is
and yea source runs a script
.run isnt normally a script, but a binary executable
Right, can't source a binary
@topaz hemlock that means it's definitely not a shell script. so obviously sourceing it would fail
source just reads one line at a time and executes it in the current shell session
you can source binary files
There isn't a build of Python for PPC higher than 2.5, correct?
(Debian Etch)
If I posted in the wrong channel, let me know.
seems right
Fook.
@main olive pyenv should be able to bootstrap you a 3.x though
On Debian 4?
Cause I'm doing this whole thing on a Wii XD
maybe
also isn't there a newer distro for the wii?
building python3 on the Wii will take quite a bit of time
There's Debian Jessie, but I spent so much time configuring Etch that I'd need a separate SD card.
and you may need to give it a large swap space
ie on the SD card itself
the Wii doesn't exactly have a lot of memory
88mb
Yep
what kernel version is it running btw?
Uhh
XWhiite V0.2 kernel 2.0 maybe?
I don't know how compatible newer python versions are with older kernels
The kernel version on the Wii is 2.6.27b.
(XWhiite)
@main olive I have heard of swap but I don't know how to use it/create a swap space
all you need to know https://wiki.archlinux.org/index.php/swap
and 2.6 should be fine
Okay I'll check synaptic if it has pyenv
just use pyenv-installer
apt-get install pyenv-installer or just pyenv-installer?
@main olive curl https://pyenv.run | bash
@main olive bash: curl: command not found
do you have wget?
wget https://pyenv.run -O pyenv-install && chmod +x pyenv-install && ./pyenv-install
@main olive
what do you mean?
i was trying to run a cat command
and now
> :q
> :
> q
> exit
> wq
> q
> :wq
> :qw
>
this keeps happening
in the terminal?
press ctrl + c
you just typed cat?
you cna press the up arrow to see what you typed
or the command history
i forgot the specifics to be honest
i think there's a command to prepend everything you type in cat with a certain char
You were just stuck in a string? @blissful sage
perhaps someone else can shed some light
but it had a
'by mitake at the end
Then you were stuck in a string
You can either get out by completing the string, or sending a SIGINT
Gotcha thnks
π
anyone here an expert at terminal manipulation?
i have a program which has a spinner indicating what is running, and the output scrolling above it. the problem is i don't know how to do that, and it looks like this:
β£½ Updating Git repo 'cna-mme_cc'Already up to date.
β£ Updating Git repo 'cna-mme_cc'Already up to date.
β£» Updating Git repo 'cna-mme_cc'Already up to date.
β£· Updating Git repo 'cna-mme_cc'Already up to date.
β£― Updating Git repo 'cna-mme_cc'Already up to date.
what i want it to look like:
Already up to date.
Already up to date.
Already up to date.
Already up to date.
Already up to date.
β£― Updating Git repo 'cna-mme_cc'
similar to npm's output, or apt's
you can use \r to overwrite the previous line instead of printing to a new one
http://fitnr.com/showing-a-bash-spinner.html one example
# ./simple_program --script=helloworld
# ./simple_program --script helloworld
# ./simple_program script=helloworld```
What is the difference between those?
It simply depends on how the software parses commandline args
Some softwares do it the first way, some the second, others the third...
- kernel runs
./simple_programwith args:--script=helloworld - kernel runs
./simple_programwith args--script,helloworld - kernel runs
./simple_programwith argsscript=helloworld
so yes it's entirely up to simple_program to determine how to handle the args
in the third case isn't it an env variable?
no
Nope
an env var would be script=helloworld ./simple_program
Using an env var would be $MYVAR for instance
so it has to go before the program
yes
thanks
Ah right
note that make lets you get loose with this. CC=gcc make and make CC=gcc do completely different things but have the same effect in most simple cases
so that is one potential source of confusion
I have never used make
then ignore what i just said π
is it something I should definetely look into?
I am not doing anything complicated so far
it's mostly for writing C programs so you don't compile by hand as your project structure grows
anyone know how I can save this info somewhere?
Don't know if there's a way to retrieve that info after it's crashed if it's not piping to a file. If you know how to reproduce, just run it from the term and pipe it to a logfile
Alternatively you can edit the startup file to do the same, and then next time it happens to crash, you can check the logs
Anyone well versed in makefiles here?
DATAJA - Don't ask to ask, just ask. ;]
Sorted it
currently for a program im making, there is a script that is supposed to run every x hours. should i rely on telling the user to make crontab entries for the script, to allow greater customization, or should i find another way to cover it automatically in the setup.py script, at the cost of the users customizability, with the advantage of an easy setup
@main olive a third option would be to use https://docs.python.org/3/library/sched.html
thanks!
how would u prevent sth like this when running code written for windows
what program does this? Id raise an issue, code shouldnt hard code path separators
i wrote sth in python for windows
and i kinda hardcoded seperators
now i kinda dont want to find em all
now im kinda sad
how big is the code that you wouldn't want to "find them all"?
it occurs in multiple modules....
is os.path.join the perfered way
to prevent sth like this from happening
is os.path.join the perfered way
@main olive that works, but if you're using >Python 3.4? I think use thepathlibmodule andPurePath.joinpath
i guess this is a lesson learned lol
os.path.join is fine if you dont like pathlib
ive been sticking with os.path.join cuz i tried pathlib once in a 3.8 venv and it said it couldnt import the pathlib module so ive just stayed away from it
like i wanna login as root with winscp cuz im using that as a file navigator
yeah i fixed it
i first tried chmod
but i didnt have permission
i didnt realize i could login as root
i wanted to add a bind-address
@main olive Why not use sudo?
^
can anyone help me with linux ?
please don't ask to ask in this server, just state your question so anyone who is capable of answering can answer
when installing ubunt on VM, it freezes on install
When i install first time on VB
VM
first time it starts up to install
when it gets to the ubuntu logo and the loading icon it freezes completely
i increased the clocks in settings
and turned off/on 3d acceleration
what about disk space and memory ?
i dunno that should be enough
do you install fully from image or use network installation too ?
fully from image from ubuntu site
no i'm wrong, 10gb is not enough https://linuxconfig.org/ubuntu-20-04-system-requirements
In this guide, we go over the minimum and recommended system requirements for installing Ubuntu 20.04 Focal Fossa Linux.
how do i change it?
how many cpu cores did you assign ?
I've been reading through the readline manual and playing around with it in bash. I'm looking for some kind of focused exercise type thing. Anyone know of something like that?
Something like "Do X manipulation in Y seconds using Z keystrokes"
Like touch-typing practice, but for readline and/or vim keystrokes.
I don't know of anything like that, @tawdry sonnet, but that sounds like an excellent idea
you could try https://www.openvim.com/ or http://www.vimgenius.com/
@clear scarab That's the same page. (EDIT: Fixed)
for extreme stuff, https://www.vimgolf.com/
That's fun. I just tried one.
I only don't like that it doesn't reward generic solutions. Like all the input files are really small. So if you go manually through the lines to perform necessary operations it's fewer keystrokes/more points than creating a generic solution that works on files of any size.
is there any reason that alias grep=egrep would be a bad idea?
seems that it'd do exactly the same thing just means I can use regex if i want
Why not just use grep -E for regex support?
As for bad idea, maybe you don't always want regex? E.g. grepping for the literal character . as opposed to the regex equivalent. You'd need to escape these always then.
well
you have to escape . anyway for regular grep
egrep just has more magic characters, regular grep doesn't have none, that's fgrep
it's still regex it just doesn't have some magic characters ( ) + by default [you can still get them with \ prefix on most systems]
* for example.
I tend to just put up with having to use \( \) \+ since i have to do that with vim anyway [vim regexes are an entirely different animal than the ones most people are used to from javascript/perl/etc once you get beyond the basics]
- works in regular grep
[me@linux ~]$ cat test
asdf.
*fda
.hi
[me@linux ~]$ grep '*' test
*fda
I mean this.
well, that's because it isn't after anything
Ah okay.
'.*' has the same meaning in both grep and egrep
The more you know
On windows there is PortableApps, which is amazing for hopping across computers and performing regular resets. Anyone use something similar on linux? I've gotten use to never having to reconfigure my most important programs.
I've gotten use to never having to reconfigure my most important programs
That's what you have dotfiles for
You referring to the hidden files like .vimrc and .bashrc? Not really what I'd call portable since I'd have to relocate them off the usb and into the right directories.
yeah, applications on linux typically don't have "portable" version
sometimes you can customize the settings directory/file location with an environment variable
but other times they just hard-code to $XDG_CONFIG_PATH or worse to $HOME
if you compile the appliction from scratch often you can change the "prefix" which is usually / by default
e.g. ./configure --prefix=~/portableapps/myapp will install the app to ~/portableapps/myapp/{bin,var,lib,etc....}
anybody has any idea to why my chromium isn't displaying emojis?
like, my firefox displays em just fine, but chromium isn't
Decoder problem? A buddies phone was doing that, turns out he had unicode disabled.
how can I check the decoder?
I'm relatively new to unix-like systems
(I don't even know if it's possible for instance)
Actually the script would be quite different, but the gist is you probably are using a font that doesn't support them
@tiny lava it worked! thank you so much for sending that solution (:
unix, minix, linux
@tawdry sonnet USB? This is 2020, just have a git repo with your dotfiles that way they are always in sync.
Not a bad idea, and I'll definitely use it for myself, but I was thinking more along the lines of not modifying any local files, should I be on a computer that isn't mine (friend, work, etc).
That said, the odds of that happening with a linux machine are almost non-existant. Happens frequently with windows.
Hello! Guys
AVAILABLE_ENVS := eng transit-gateway
.PHONY: format
init:
@cd $(BUILDPATH) && terraform init --reconfigure
test-%:
$(eval ENV = $*)
echo "env: $(ENV)"
ifneq ($(filter $(ENV),$(AVAILABLE_ENVS)),)
$(eval BUILDPATH='$*/eu-west-2')
@MAKE init BUILDPATH=$(BUILDPATH)
@cd $(BUILDPATH) && terraform plan -var 'eks_cluster_name=$(cluster-name)'
else
@echo "Invalid environment specified '$(ENV)'. Must be one of: $(AVAILABLE_ENVS)"
exit 1
endif```
Anyone know why this makefile isn't working correctly? π
I just want it to make sure i'm passing either eng or transit-gateway through
.SHELL := /usr/bin/bash
AVAILABLE_ENVS := eng transit-gateway
.PHONY: format
init:
@cd $(BUILDPATH) && terraform init --reconfigure
test-%:
$(eval ENV = $*)
echo "env: $(ENV)"
ifneq ($(filter $(ENV),$(AVAILABLE_ENVS)),)
$(eval BUILDPATH='$*/eu-west-2')
@MAKE init BUILDPATH=$(BUILDPATH)
@cd $(BUILDPATH) && terraform plan -var 'eks_cluster_name=$(cluster-name)'
else
@echo "Invalid environment specified '$(ENV)'. Must be one of: $(AVAILABLE_ENVS)"
exit 1
endif
discord has makefile syntax π
what's wrong with the makefile currently?
what does $* mean in Make syntax?
ah implicit rule match
it looks right just eyeballing it
so im curious what the problem is
I believe the ifneq is evaluated at the time the rule is defined, not when it's being executed - so, before ENV has been set.
presumably ENV is set before the makefile is run though right?
oh i see
yeah thats very very likely whats happening
youd need to wrap all this up in a macro and then call it
lots of $$ escaping
yuck
im not sure how youd even write that honestly
define test-rule =
$(eval ENV = $*)
@echo "env: $(ENV)"
ifneq ($(filter $(ENV),$(AVAILABLE_ENVS)),)
$(eval BUILDPATH='$*/eu-west-2')
@MAKE init BUILDPATH=$(BUILDPATH)
@cd $(BUILDPATH) && terraform plan -var 'eks_cluster_name=$(cluster-name)'
else
@echo "Invalid environment specified '$(ENV)'. Must be one of: $(AVAILABLE_ENVS)"
exit 1
endif
endef
test-%:
$(test-rule)
this might work as per https://www.gnu.org/software/make/manual/html_node/Canned-Recipes.html#Canned-Recipes
Canned Recipes (GNU make)
try it. you still might need to do a lot of $$ escaping to make it work
@formal schooner hey thanks i actually gave up because it was just an additional layer i was adding to make it user friendly but ill take a look thank you
sure thing. as a starting point try $$-escaping everything in the define except $* itself
@summer trail I believe the ifneq is evaluated at the time the rule is defined, not when it's being executed - so, before ENV has been set.
what did you mean by that sorry i just read bvack properlu
the ifneq that you wrote is taking effect before the rule target is run, and the ENV isn't defined until the rule target is run.
Ohh okay thats so weird but thanks for clarifying
Hi all
I have a git repository inside another git repository, and so I had problem staging all the files from the containing repo. So I searched it and it's called a submodule. Now my problem is, the command git submodule add needs a remote-url as one of its argument, while mine is here locally, what do I do?
@topaz hemlock https://stackoverflow.com/a/6106503/174652
thank you
summary: git submodules without remotes dont really make sense π
-> % if [[ "hello there" ~= .*?"there" ]]; then echo "yes"; fi
zsh: condition expected: ~=
-> % if [[ "hello there" =~ .*?"there" ]]; then echo "yes"; fi
zsh: failed to compile regex: repetition-operator operand invalid
how do i test for substring with a regex? π€
usually you jsut type the substring
if I want to search for hello in a file example I would type grep "hello" example
but for your code, it looks like you are trying to run bash code with zsh
@static cosmos yeah i couldn't seem to find the zsh version of this
Why not just run it with bash?
well my shell is zshell
you can still do bash <script> tho
unless you actually don't have bash installed
so zshell doesn't have regex?
I'm pretty sure it just doesn't have that one conditional operator
i can't find the one that it uses
actually this says it does have that operator
zsh: 12 Conditional Expressions
π€
So actually maybe its your regex thats broken
Yeah I think there is something funky with the specific regex implementation or something
weird, tested as a POSIX extended regular expression
I'm sure .*? is valid in that
I don't think this is related to the problem, but pretty sure the quotes will make it not match
what do you mean
the quotes around there
no that's fine
.*?"there" would only match like something"there"
weird I wonder how that works
no idea lol, bash strings are always a mystery to me
i ended up solving this with if [[ "$(which python | sed -E 's/\/\.|\///g')" == *"virtual"* ]]
You're trying to see if the current python executable points to a virtual environment?
A better way may be to run a Python script that prints the site packages, or parse the python -m site output
Even then, the path doesn't necessarily have to have venv or virtual anywhere in its name
Or check environment variables, though I don't know which ones a venv sets
@warped nimbus in general, no, in my usecase they're within ~/.virtualenvs though
env variable might make more sense though π€
afaik theres an env variable like $PYTHON_VIRTUALENV or something that should do it
I test for $VIRTUAL_ENV, works with pipenv, poetry, pyenv-virtualenv
all of those use venv or virtualenv under the hood
and venv should be backward compatible with virtualenv
so makes sense
Yeah I'd likely lean towards check the environment as well.
I'm sure
.*?is valid in that
@digital haven it isn't.
Per the standard:
The behavior of multiple adjacent duplication symbols ( '+', '*', '?', and intervals) produces undefined results.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
Hi, since pipenv takes forever to check all the dependencies, I'd like to send a desktop notification whenever a pipenv command finishes
problem is, that I somehow dont manage to run that notification always after some pipenv command finishes
tried to make a function and set an alias to pipenv to call that function
but that somehow doesnt work out
pipenv $@;
notify-send 'Pipenv' 'has finally finished!'
}
alias pipenv='run_pipenv' ```
What am I doing wrong?
Hmm now its working as expected ...
not sure though
I don't see anything wrong
if you're using bash there's a small chance you have an alias called alert in your ~/.bashrc, in which case you can just run
pipenv <args>; alert
and it'll send you a notification when the command finishes
Seems to be running now. Didnt change code, maybe just remainder of my failed tries
on an old terminal window
Likely you didn't open a new terminal or source the changes?
yep, probably. It's working as expected now
should limit the output to install, sync, update
Hi. I was looking for some help regarding powerlevel10k. Could you please help me with this error in my terminal?
Last login: Thu Jul 30 on ttys002
/Users/useruser/.cache/p10k-instant-prompt-useruser.zsh:local:28: key: inconsistent type for assignment
_p9k_dump_instant_prompt:217: parse error near }' _p9k_dump_instant_prompt:zcompile:331: can't read file: /Users/useruser/.cache/p10k-instant-prompt-useruser.zsh _p9k_dump_state:53: parse error near )'
_p9k_dump_state:zcompile:23: can't read file: /Users/useruser/.cache/p10k-dump-useruser.zsh
??
@main olive are you sure you're running this with zsh and not bash or something?
Yes, macos
zsh
catalina
Was working just fine till one hour ago
@formal schooner
huh.
did you install it with homebrew, then brew update?
maybe something went wrong there
or maybe theres a bug in powerlevel 10k
https://pastebin.com/aPdhwGpq is my zshrc file
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I believe I installed it like this ^
@formal schooner
@main olive do you have a lot of things in your zshrc file?
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Not that too
you have the line source ~/powerlevel10k/powerlevel10k.zsh-theme in your zshrc file?
what happens if you run source ~/powerlevel10k/powerlevel10k.zsh-theme in ZSH?
same errors?
β― source ~/powerlevel10k/powerlevel10k.zsh-theme ββ―
_p9k_dump_state:416: unmatched '
_p9k_dump_state:zcompile:23: can't read file: /Users/useruser/.cache/p10k-dump-useruser.zsh
@formal schooner
Found a workaround
That is the zshrc file
@rich sierra you can ask your question here probably
Any linux developer here? Familier with environment variables and cmake? Please
@formal schooner ?
@rich sierra just ask your question, someone here will know
Hello I am trying to compile firestorm https://blog.sarapayne.co.uk/2020/07/01/compile-firestorm-on-ubuntu-20-04/
I followed all the steps and it compiles and then i get error undefined reference to boost:details. Libboost is installed qnd updated but still getting this error
@formal schooner
@main olive i saw and was away. One ping is enough.
It looks like your file got modified somehow
Try just deleting the repo and re-downloading it
I tried many times and even on different linux distribution
I think its environment variable issue cmake can't find boost libraries
@formal schooner Hi. How come the file was modified?
I have no idea
I fixed it but once that software/thing runs again it will again break my shell
How can I identify what software that is?
@formal schooner
Hi. I installed powerlevel10k on macOS Catalina by git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme&...
The owner of the repo said run exec zsh -fc '{ rm -rf -- ~/powerlevel10k ~/.cache/p10k*(N); mv ~/.zshenv ~/.zshenv.bak; mv ~/.zprofile ~/.zprofile.bak } 2>/dev/null; git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k; exec zsh'
I ran it, got fixed
He said I have some bad software and "If you run it again, it'll again break your shell."
@formal schooner
Share your zshrc and zprofile and zshenv files
Would it still help even if my problem was for now fixed?
I probably wont be able to find the problem...
But you need to start disabling programs one by one
It sounds like you have something that is modifying other files
Eg inserting itself into zshrc
Not malware right?
I have no idea
I am only able to guess
Unless i can see your files
Try pastebin again
I am on my phone now
What files? The zshrc and zprofile and zshenv files ?
Yes
Zshrc file is https://pastebin.com/E3qJm8gU
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Why are you sourcing bash profile in zshrc
What directory is zprofile file in?
My bash profile is literally export PATH="/usr/local/bin/python3.8:${PATH}"
~
"~/.bash_profile" 1L, 47C
2 lines
I need to send you my zprofile file too. What is its directory?
If you didnt create one, you dont have one
Same with zshenv
Do you get the same error every time with p10k? Or different errors
The repo owner simply had you reinstall p10k with that command
Before I "fixed"/reinstall it using the owner's command exec zsh -fc '{ rm -rf -- ~/powerlevel10k ~/.cache/p10k*(N); mv ~/.zshenv ~/.zshenv.bak; mv ~/.zprofile ~/.zprofile.bak } 2>/dev/null; git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k; exec zsh' during problem my zshrc was https://pastebin.com/aPdhwGpq
If the problem happens again
Go to the p10k dir on your computer
And run git diff
Do you get the same error every time with p10k? Or different errors
What do you mean? It was working just fine till day before yesterday and something made me get the errors ```Last login: on ttys001
/Users/useruser/.cache/p10k-instant-prompt-useruser.zsh:local:28: key: inconsistent type for assignment
_p9k_dump_instant_prompt:217: parse error near }' _p9k_dump_instant_prompt:zcompile:331: can't read file: /Users/useruser/.cache/p10k-instant-prompt-useruser.zsh _p9k_dump_state:53: parse error near )'
_p9k_dump_state:zcompile:23: can't read file: /Users/useruser/.cache/p10k-dump-useruser.zsh``` and once I reinstalled p10k using the repo owner instruction the error for now has gone
I think you accidentally edited a file in there
So if it happens again
Go to the p10k repo and run git diff
Ok, give me a sec
Does the problem happen now ?
β― vim ~/.zprofile
β― cd ~/powerlevel10k
β― ls
LICENSE powerlevel10k.zsh-theme
README.md powerlevel10k.zsh-theme.zwc
config powerlevel9k.zsh-theme
gitstatus powerlevel9k.zsh-theme.zwc
internal prompt_powerlevel10k_setup
powerlevel10k.png prompt_powerlevel9k_setup
β― git diff
I did this and when I ran git diff nothing happens
Do it only if the problem starts to happen again
What will that tell me?
It will tell you if something changed in those files
For now it seems to be fixed, so there's no way to diagnose what happened
Ok, thanks. Would it tell me what changed those files?
No
But if we can see what changed that can help
It might also be some program modifying the cache
Which is harder to find
Either way, if the problem doesn't happen again then don't worry about it
So out of the owners suggestion of what happened we have ruled out the first once since I don't have zshenv and zprofile?
Something on your machine has created either ~/.zshenv or ~/.zprofile with bad content.
Something on your machine has corrupted files in ~/powerlevel10k.
Something on your machine has corrupted files in ~/.cache.
I got zprofile.bak content ```
Setting PATH for Python 3.8
The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
Your previous /Users/useruser/.zprofile file was backed up as /Users/userjaii
n/.zprofile.macports-saved_2020-06-23_at_20:51:27
MacPorts Installer addition on 2020-06-23_at_20:51:27: adding an appropriate PP
ATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
Finished adapting your PATH environment variable for use with MacPorts.
"~/.zprofile.bak" 14L, 544C
Setting PATH for Python 3.8
The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
Your previous /Users/useruser/.zprofile file was backed up as /Users/useruser/.zprofile.macports-saved_2020-06-23_at_20:51:27
MacPorts Installer addition on 2020-06-23_at_20:51:27: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
Finished adapting your PATH environment variable for use with MacPorts.
No zshenv or ~/.zshenv.bak but I have a zprofile.bak
Which zprofile was probably moved to my running exec zsh -fc '{ rm -rf -- ~/powerlevel10k ~/.cache/p10k*(N); mv ~/.zshenv ~/.zshenv.bak; mv ~/.zprofile ~/.zprofile.bak } 2>/dev/null; git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k; exec zsh'
@formal schooner
So for now can we ~~~/.zshenv ~~or ~/.zprofile as the cause of problem?
= edit no zshenv file is there
Correct. I believe it was caused by corrupted files in ~/powerlevel10k or in ~/.cache
/Users/useruser/.cache/p10k-instant-prompt-useruser.zsh:local:28: key: inconsistent type for assignment
_p9k_dump_instant_prompt:217: parse error near `}'
_p9k_dump_instant_prompt:zcompile:331: can't read file: /Users/useruser/.cache/p10k-instant-prompt-useruser.zsh
_p9k_dump_state:53: parse error near `)'
_p9k_dump_state:zcompile:23: can't read file: /Users/useruser/.**cache**/p10k-dump-useruser.zsh```
This mentions cache
Why?
The cache is boldened by ** by me
p10k apparently puts files there
It probably pre-generates them to speed up the prompt
What do you think is more likely? something corrupted files in ~/powerlevel10k or ~/.cache ??
Then how did running what the owner sent me fixed it?
Didn't that just reinstall powerlevel10k?
Because the cache was probably regenerated by p10k
But that is a good point
Very hard to say
All i can say is, be careful running commands that automatically modify files for you
I dislike commands like that
All i can say is, be careful running commands that automatically modify files for you
@formal schooner Like what?
But doesn't it kind of just add itself to the files, why would it mess up the file?
conda init or macports
I don't know, I never saw this happen
It is an unusual problem
I think you should just not worry about it
Put zprofile back
If the problem happens again, do the git diff
And @ me with the output
And since we have come to the conclusion that most probably cache was corrupted and not powerlevel10k since the cache was probably regenerated by p10k once I ran owners command, what generally corrupts cache?
Put zprofile back
@formal schooner Why and by what command?
You ran mv ~/.zprofile ~/.zprofile.bak right? So move it back to its old name
So mv ~/.zprofile.bak to ~/.zprofile ?
Yes. It looks like macports has code in there
So running this might make the issue happen again and if so I have to run git diff?
I don't think zprofile caused the problem. I just want to make sure you don't break something else by removing a file you need.
But yes. If the problem happens again, do the git diff
I restarted terminal. Moving zprofile back from zprofile.bak to zprofile did not cause any issue at all
@formal schooner Also is it possible that my issue was a one of problem that maybe accidentally in vim I manually modified the file yesterday?
Which file most likely I modified?
/Users/useruser/.cache/p10k-instant-prompt-useruser.zsh:local:28: key: inconsistent type for assignment
_p9k_dump_instant_prompt:217: parse error near `}'
_p9k_dump_instant_prompt:zcompile:331: can't read file: /Users/useruser/.cache/p10k-instant-prompt-useruser.zsh
_p9k_dump_state:53: parse error near `)'
_p9k_dump_state:zcompile:23: can't read file: /Users/useruser/.**cache**/p10k-dump-useruser.zsh``` This file in cache /Users/useruser/.cache/p10k-instant-prompt-useruser.zsh in cache?
Maybe a file in the p10k dir itself
@formal schooner Yes but didn't you say cache is more likely than something in p10k directory since more likely some program or me by mistake modified cache but except now I have never ever visited p10k directory
Right?
Programs are more likely to mess with cache than other directories
But both are unlikely and i am only able to speculate
It's more likely that you accidentally opened and edited a file
I don't have any idea what file
Programs are more likely to mess with cache than other directories
@formal schooner Yes, specially since macs are locked down well enough
Could it also be a one off thing that a program/software for the first and last time accidentally messed with my cache?
Maybe
Could it also be a one off thing that a program/software for the first and last time accidentally messed with my cache?
Likely?
@formal schooner
@formal schooner Do respond when you are done with . work. Thanks
Hello , I just installed irccloud from sudo snap install irccloud on my ubuntu 20.04 , the gui wasnt opening so I tried opening from /snap/bin/irccloud but it gives me segmentation fault
[1] 259646 segmentation fault (core dumped) /snap/bin/irccloud```
any ideas on how to fix it would be appreciated , thank u
@main olive that's my guess, yeah. but really it's just a guess
So your guess is that it is likely that is was a one off thing that a program/software for the first and last time accidentally messed with my cache?
that, or you opened the file and accidentally edited in vim
