#unix
1 messages ยท Page 38 of 1
Okay... Took a sec for it to throw an error this time
dear god
please save me from this hell lmfao
don't worry
go back to the wsgi file and change it to sys.path.append('/home/pi/dev/webserver/src/webserver_project')
That is where your main django file is, right?
I don't know your folder structure
then the last line in your conf is also wrong
where it says WSGISCript Alias
The wsgi file is one level lower
ok hol up
inside of wsgi.py...
when you say "where my main django file is", are you referring to my manage.py?
yeah
k sec
editing wsgi.py
edityed
k so wsgiscriptalias needs to be fixed in sites-available now yes?
yes
you're jesus btw
I am really not
WSGIScriptAlias / /home/pi/dev/webserver/src/webserver_project/webserver_project/wsgi.py
ok, on the previous one it was different
oh
Same for the directory directive
ok, anything else you've noticed or should i try it?
no
your document root
needs a /src/webserver_project appended
that means the server is exposed to everyone
Oh fuck, really? Whoa
Well hold up, this is MEANT to be a LAN website, like I want any device on this network to access it
This way only people within the network can access it
The intention is to make it a controller for my raspberry pi
Oh ๐ฎ
Wait so hold up
How do I access it right now outsaide of the network?
Like what would I need to do?
it would be difficult, it is a precaution
It would need open ports, yadayada, but better safe than sorry
Ok, so...
Alright, it works. I can continue with setting this up now. The critical problem was that apache2 and mod_wsgi weren't talking correctly to each other/other shit, so I can now work again with this project.
I'd give you a hug right now and a fifth of vodka if I could.
Dude you have no idea how happy I am. I just sprinted down to my roommates, who were waiting impatiently for me to be done doing nerd shit so we could possibly get drunk, ripped my buddy's laptop out of his hand, smashed in that motherfuckin IP address, handed handed him the laptop, then screamed about how happy I was
I've been bitching about this problem for days to him
any tmux users?
it seems as though if there's a long file that's printed out to the terminal, then i can't scroll up to view it, i can only see what's printed out to the screen. Am i missing something obvious? Or is tihs how it is
@wheat ridge What you should keep in mind that this is very insecure right now
especially since you are using the default raspberry user
at some point this setup should be hardened
at least make sure pi has a password
The user? It does. I think, anyway.
how do i keep processes running after I close an SSH session?
You can create a service unit with systemd or use a tool like screen or tmux
@warped nimbus with those is it possible to look at logs that process has created when you start the SSH session again?
Yes
also nohup
Because they're "unix-like"
And that gets shortened to just "unix" though it's technically incorrect
But most people know what you really mean or don't care
Funnily enough, one does have to confirm when someone really does mean unix
oddly enough, words mean what the people who use them think they mean, as opposed to what the elite wish they meant
e.g. much as I wish that "literally" meant "the opposite of 'figuratively'", it no longer does
i have a batch file that connects to a server via ssh, but when i compile it to an exe, i get a prompt saying that ssh isn't a recognised command, how do i solve this?
heyy
can someone help me understand how to install kali linux properly on like a virtualbox
or where should i install it
you can install on a vm and there are tutorials on how to do so
okk thanks
hi?
Asking good questions will yield a much higher chance of a quick response:
โข Don't ask to ask your question, just go ahead and tell us your problem.
โข Don't ask if anyone is knowledgeable in some area, filtering serves no purpose.
โข Try to solve the problem on your own first, we're not going to write code for you.
โข Show us the code you've tried and any errors or unexpected results it's giving.
โข Be patient while we're helping you.
You can find a much more detailed explanation on our website.
Sorry, i just want have a talk with somebody)
I'am using debian with kde and i have such problem as tearing
I have read many sites for this info, but no one helped
I'am using linux for 4-5 years, and have this problem for all dists with kde
my videocard is NVIDIA GeForce GTX 1050
I have read that a lot of video cards by Nvidia have tearing problems on linux
this option has not effect
do you have a freesync monitor
Yes
is it enabled
Yes, but it do nothing
do you see the G-SYNC visual indicator in green at the top-right corner of your image?
where can i enable this?
I also enable this option
nvidia x server says that i have no g-sync
go to display configuration and check the box that says "allow gsync on monitor not validated"
nvidia x server says that i have no g-sync
is it?
freesync is not gsync
i know, my monitor has opiton freesync, but when i turn it on, it do nothing
is your monitor in the validated by nvidia list
anyone use vim and Ultisnips? Just wondering if you typically get a pop-up of snippets that are available
nope, is that just autocorrect for vim?
@sick storm is what autocorrect?
@sick storm i'm not sure what's unclear about what i asked
do you use ultisnips? It seems no? If you don't, i'm not sure how you'd answer
I've just switched from ultisnips to coc instead now though, which seems to half use ultisnips somehow, but it's giving me a popup now at least
@winged island does the following command fix tearing?
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
yes i have tried this, but no effect
How come i am getting different output when i run this:
for i in $(cat smth1); do (cat smth2 | grep "Content-Length") && echo $i; done
and this:
for i in $(cat smth1); do echo $i && (cat smth2 | grep "Content-Length"); done
why would the placement of commands separated by and matter
1 && 2
if 1 cant be do, then 2 not do
can CentOS convert MBR to GPT without losing data?
haha lot of fun here
I/O Error: Couldn't open file 'P79-1027.pdf.txt' in git bash
when i tried
for file in *.pdf; do pdftotext -layout "$file.txt"; done
i m trying to convert pdf to text
@vestal turret any help here
for file in *.pdf; do pdftotext -layout $file $(echo $file | cut -f 1 -d ".").txt; done
@ruby kernel
@main olive what was the issue with above command?
first, pdftotext takes must have 2 parameters, one input file, the other output file
you only provided one
and also given that every $file contained .pdf at the end, therefore the "$file.txt" would suffix .pdf with .txt on top, hence 'P79-1027.pdf.txt' in your error
i am not able to copy and paste from host machine(windows) to guest machine(linux). I installed VBox_Gas and selected Bidirectional in Drag_and_Drop and Shared_Clipboard in Virtual_Box Setting.
Can anyone help me here?
help, cant install linux kinda
hmm
which fans...
also which distro
@long pilot also ask this in another server... maybe linux specific server ?
I prefer arch, but I also like kde neon
so i have pycharm installed on my windows machine and i am using virtualbox to run ubuntu in a vm. i want to make a file available to edit from either system how would i go about doing this
it's tricky
you can share a folder from Windows into ubuntu, but in my experience that works about 50% of the time
then ... you're done?
but pycharm wont load it
can't help ya there; I don't use pycharm
not a pycharm issue
afaik
i think it is because you need the password to open it
but idk how to change that
that's not the kind of shared folder I was thinking of
I was thinking of something simple -- you create a file in the folder in one OS, it is immediately visible in the other
there's an option for that in virtualbox
Confused at the purpose of a shebang line, and why itโs necessary to include them at the top of a script you want to execute.
Can anybody explain?
it's to tell the operating system what interpreter to run the script with
if you leave it out, it just assumes it's a "shell script"
this is ancient crufty leftover from caveman times
to expand on this, it is only required if you mark the script executable and execute it by itself
if you execute the script via the interpreter, the shebang is not necessary
python myscript.py # shebang not necessary
chmod +x myscript.py
./myscript.py # shebang necessary
@cosmic topaz
alternatively, you could create a shell script that runs the python module
[no-one ever seems to do that even though shebang lines aren't in POSIX and /usr/bin/env is a dirty non-portable hack]
that's generally something I think is missing from POSIX
i shouldn't have to have two files to run one file
(or, well, three+, if you count the interpreter)
the problem is the shebang mechanism as traditionally implemented isn't good enough
can't handle multiple arguments, arguments with spaces, or execute the interpreter from $PATH [the env thing is a workaround for that, but introduces a dependency on env's own location]
it's damn lucky there aren't any common implementations that don't support any arguments at all, or the env thing would have been a non-starter
other than implementation, you have no issues with the shebang design?
It just saves time pretty much?
Instead of typing in python3 nameofmyscript.py
You can just type in ./nameofmyscript.py?
pretty much
@cosmic topaz it also allows you to have scripts in your path
so you can just do myscript.py whereever you're located
@main olive oh, makes sense now. Thanks
You wonโt always have to run the script from the cwd
i am not able to copy and paste from host machine(windows) to guest machine(linux). I installed VBox_Gas and selected Bidirectional in Drag_and_Drop and Shared_Clipboard in Virtual_Box Setting. Can anyone help me here?
"other than implementation, you have no issues " other than that mrs lincoln how was the play ๐
Hey y'all. For those coding on GNU/Linux, do you prefer vim or pycharm? I've been practicing in vim but I'm not used to yanking and pasting functions that get reused a lot. Just was curious c:
Never tried it. I've only started Linux a couple years ago
Does it have support for macros?
yes, it has both kinds of macros
I wonder why my first sentence is red
I don't recommend it
oh it didn't send if it's red, I think
yeah I guess not
if you like learning new crazy stuff, give it a try. But it's very VERY weird.
well vim was weird to me initially but now it feels amazing and I'm still a newb with it
it's not enough better than vim to warrant switching
I'll take your word for it especially if you aren't trying to make a case for it (;
that's what I love about computer science and OS / Software in general
well give it a try by all means
you have so many options and it doesn't have to make sense...if that makes sense
you might discover you love it too. Just don't go in thinking "oh there's this nice easy editor that will make my life simpler".
lol! yeah it's just for the love of tinkering
oh well if you love tinkering ... emacs is like crack
I need less crack and more of that soft stuff
been going through the NSA python course and it's been keeping me sharp..haven't given up yet
in the last 10 years I've made 1300 commits just to my ~/.emacs.d directory
@past sluice Can I get the link to install debian?
ya sure
But first, how cheap on performance is kde plasma from debian?
on a percentage?
oh
before, did you say debian is very cheap from windows?
or kde plasma is very cheap from windows?
look
kde plasma genome lxde they are GUI variants
it depends on you want you want
for performance use lxde of plasma
no
??
plasma is default desktop of KDE
daum
yup
I'm sorry if I go afk
I'm talking to another guy on #help-coconut
Tag me if you wanna say something important
@main olive np
we've traced the process -- and the execs are coming from inside the house!!
@frigid sequoia what is starting it?
ps uwwp $(ps -p $(pgrep process_in_question) -o ppid=)
replace process_in_question with whatever it is you're trying to kill
it's a zombie
can git hooks run a script?
it seems as though i need to use some separate library, i thought that might be a default though
@warped nimbus ok cool - I'll try and dump something in there. What's best - so call a script from the hook that's stored in the repo, or to have the script within the hook. I've never really used hooks
I guess call the script rather than have it in the hook
If you want to commit the script to the repo then it's better to call it from the hook
Or if you just want to generally re-use the script in multiple repos
yeah, i want it to be viewable / accessible so all good, i'll try calling from the hook
I only see pre-commit hooks :
โโโ [ 478] ./applypatch-msg.sample
โโโ [ 896] ./commit-msg.sample
โโโ [3.0K] ./fsmonitor-watchman.sample
โโโ [ 189] ./post-update.sample
โโโ [ 424] ./pre-applypatch.sample
โโโ [1.6K] ./pre-commit.sample
โโโ [ 416] ./pre-merge-commit.sample
โโโ [1.3K] ./pre-push.sample
โโโ [4.8K] ./pre-rebase.sample
โโโ [ 544] ./pre-receive.sample
โโโ [1.5K] ./prepare-commit-msg.sample
โโโ [3.5K] ./update.sample
can i do post instead? or should one stick with the defaults
Yeah, you can
Those are just samples. They don't necessarily represent all supported hooks.
ok cool - i just wrote a pre-commit hook and that works... I'll have a look for post. It's just for syncing project data up to the database, so it's only really a single gsutil command
man githooks will show you all hooks
Would anyone know of an article that would possibly help me install python libraries using bash?
just python3 -m pip install --user name-of-library should work 90% of the time
Okii
Hey guys first time using cron
Does a cron job go in the same directory but different file than the script to be executed by it?
the "job" isn't a file
it's a single line in a file called (I think) /etc/crontab, but as xx says, you don't edit that file directly; instead you use a program to edit it for you
for Reasonsยฎ
@here anyone here ever do kafka?
Is there a way to install ubuntu alongside windows without a usb?
I don't have a usb and there's a curfew going on outside
I can't go and buy one
or is there a tutorial that you would recommend me on watching
@main olive got a rooted phone?
@main olive I have an iphone XI
is that rooted?
Well, what does rooted mean?
A windows mobile?
ah, no, I meant an Android phone. Rooted just means root access (if you're new to Unix, the root account is the most privileged account). With it, you could've used DriveDroid, which emulates bootable USB media
don't think that's possible at all with an iPhone
ughhh
@main olive maybe a VM could suffice until you can get an USB drive?
@main olive Can you link me to a vm installer?
it depends entirely on what VM software you want to use
I wanna try out ubuntu..?
virtualbox and vmware are the more popular ones
Yea sure
I'll go with virtualbox
just create a new VM in virtualbox and point it to the Ubuntu iso
performance is not as good when compared to running on real hardware, but you can still get a feel of how the system operates
@main olive Can you link me to vm?
There are plenty of them when I search
VM just means "virtual machine"... it's a concept, I can't exactly link to it
virtualbox is a software which lets you create virtual machines
..?
what are you confused about exactly..?
have you heard of virtual machines before?
Is virtual machine an installable software?
No
okay okay, leave the linux thing
I don't want it without a usb
no, virtual machine is just when you create a new "machine" that doesn't run directly on the host machine's hardware (like if you're using Windows right now), but is instead almost entirely implemented virtually. You can create virtual machines (called "guests"), which run on your host machine, and install operating systems on it, like Ubuntu or Windows
@main olive What ide/editor do you use?
vim
..
Are you on linux?
yes
I assume you are
aw man
Is vim good on windows?
I've never tried
ow
any other editors you use?
(can we move to #tools-and-devops)
is it possible to have code snippets for nano?
is this the place for a grep question?
@full oriole think it's as good as any... i've asked questions along those lines here before at least
Thanks @digital haven
I have a file, time.txt that has the following entries:
1:12 am 09:33 pm 23:12 14
When I use grep '\(1[012]|[0-9]\):[0-5][0-9] [am|pm] time.txt nothing is returned.
is that the exact command you've used
also - what are you expecting to be returned @full oriole
Yeah. I would expect 1:12 am to be returned because in the first sub-expression in parentheses it would match 1 then the colon, then 1 then 2 then a space and the am.
sorry, that expression is missing a closing single quote '
just 1:12 am is what you're expecting to be returned?
Right.
why have [am|pm] then?
and not just am
also - egrep is useful if you're using regular expressions
eg
-> % egrep '9|3' time.txt
09:33 pm
23:12
I was going to extend the pattern to match the time 09:33 pm once I could get the first pattern to match correctly.
so do you in fact just want to return anything that isn't a time?
in which case
-> % egrep '[am|pm]' time.txt
1:12 am
09:33 pm
seems that it'd be enough
Ok, so when I use egrep with egrep '(1[012]|[1-9]):[0-5][0-9] [am|pm]' time.txt I get
09:33 pm 23:12 1:12 am
No, I'm working through the book Mastering Regular Expressions, and the section is about matching any time in the 24-hr time model.
ok well i don't really understand what the expected out put is
maybe someone else follows
Thanks @digital haven !
if i just wanted to match times then from that i'd do something like egrep '^[0-9]?[0-9]:[0-9][0-9]' time.txt
Right, that's actually the first attempt the book gives, but that could get non-sensical times like 99:99, so the next step is to refine the pattern to only returns real times.
the files not a great test case then
@full oriole something like this?
$ cat times
1:12 am
14:35 am
99:28 pm
21:99
21:22 am
9:1 pm
09:33 pm
23:12
4:25
04:25
24:12
14
$ grep -P '(?:(?:^0?[1-9]|^1[0-2]):[0-5][0-9] (?:am|pm)|(?:^[0-1][0-9]|^2[0-3]):[0-5][0-9])$' times
1:12 am
09:33 pm
23:12
04:25
matches only valid 12h times or valid 24h times
@main olive thanks! give me a minute to digest it ;)
@full oriole this should make digesting it easier: https://regex101.com/r/25Yej3/2
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.
Ah nice! What's -P do? I'm not seeing that as an option for grep in the man pages.
you using GNU grep, right? my manpages have it
-P, --perl-regexp
Interpret PATTERNS as Perl-compatible regular expressions (PCREs). This option is
experimental when combined with the -z (--null-data) option, and grep -P may warn of
unimplemented features.
Ah yep. I just did a flip through "Linux in a Nutshell", but you're right. I have it on my machine :-)
@main olive is this part Perl (?:(?... ?
yes, it creates a non-capturing group
If not I don't understand the logic of matching ( zero or more times at the beginning.
Ah, got it!
i'm sure this could be done with grep's common flavor of regex as well, but i'm personally more comfortable with the perl version
you're lost in a twisty maze of regex flavors, all different
Hey! I use git bash for Windows and I'd like to make a bash script that I can use in my terminal that automatically cd's into a specific directory (predefined in the script) and then does ls -a. Would this be an alias, or can I make a specific script for it, and if so, how does that work when Windows is in the mix (even though I'm not using the windows command prompt?)? Even just some search keywords would be really helpful, as I'm not sure what the terms are for this concept
easily implemented as an alias
That's what I was thinking too, although I would be open to making a script specifically for it just for the hell of it too, as I've never written a .sh script
How do aliases work in git bash for windows? Is there even a .bashrc? I barely remember how they work in unix, tbh... lol
cd in a script doesn't work when running the script in a regular manner (ie sh script.sh) because it creates a new shell when the script is run and the cd only applies there - you'll have to source the script instead (source script.sh or . script.sh)
Oh interesting, I didn't know that!
obviously the latter means you can't have the script in your PATH and run it anywhere, since you need to call source with a path to the file
Then an alias implementation would be far better for this particular thing
so an alias is probably the easiest method
Okay, well that's enough information for me to do this then, thanks for the tip on sourcing, I didn't know that!
of course, you can utilise both: have a script in a predefined location (like ~/.local/bin/script.sh) and an alias which sources it: alias dothething='source ~/.local/bin/script.sh'
Oo that's a good idea too
It probably fits just into an alias though, as it's suuuper simple. It's just cd'ing to the directory my dev project is currently in, then doing an ls -a and I might have it also start up my django server (I'm building a django local network website/server to be hosted on a raspberry pi)
yeah, sure, makes sense
@wheat ridge also, yeah, git bash should have a bashrc in the regular location, $HOME/.bashrc, should work fine on windows
wtf this git bash doesn't have tree? Ahhgh no ๐ฆ
Oh, looks like past me has already made some aliases and forgotten about them lol
there's a lot of aliases in .bashrc that come by default
No, they're definitely mine lol
I'm in bash_profile actually, which is where git actually recognizes aliases between sessions (.bashrc doesn't seem to work properly)
hello, so I've been learning python for around 4 months now.
But I'm bored of just doing python so I started learning linux command line and sql.
Do you guys think it's a good idea to learn multiple things at once?
Or should I just focus on python for now?
that is entirely up to you
if it's more fun than learning one thing at a time, then do it
ok tnks
I have used GNU/Linux since i was 13. And I prefer it over any other OS
especially arch linux
how can i launch to linux live usb with radeon mode? it always gets stuck on logo for me.
So, this is a bit separate from python exclusively, but I'm trying to build something from source on Raspbian, and I'm running into a wall:
The thing I'm building depends on a patched version of x264. I've been able to compile the patched x264 version, but I've not been able to compile the overall library.
I've tried searching, moving files, recompiling, etc., but I still haven't been able to get ./config to find the patched version of x264 it depends on.
Can anyone help with this, and is this the right place to ask?
I should probably include that I'm following https://libdrc.org/docs/installation.html to compile from source
@radiant pike try ./config --help, sometimes there's useful hints
often you have to do something like ./config LD_FLAGS=-lyour-library LDPATH=/where/ever/you/installed/it CXXFLAGS=-I/where/ever/you/installed/etc
What's a good way to tell where I might've installed something?
When I ran make on the patched x264 lib, I don't know where the actual bins went
heh
couple ideas
run make -n install and see where it says it's doing
other idea: list every single file on the file system, sorted by timestamp; the installation files will probably be recent, and all together
I'm pretty sure it'll say x264.h not found
also I'm not good enough at bash to know how to list files by dir
or wait no it won't make, it'll ask for config first?
well, if you ran make and it installed some stuff, run from that directory
I think this will search your whole file system -- it could be slow
find / -printf '%T@ ' -ls | sort -n | cut -d\ -f 2-
requires GNU find but that's probably what you have
It's a fresh raspbian install, so the search shouldn't have to go far
it's erroring at cut:
cut: the delimiter must be a single character...
I'm not sure lemme retype
with both the two spaces after and the ' ' it stops at no such file or directory with -printf and %T@
So I don't have somehting installed?
you're mistyping something
or else you don't have GNU find, but I think you should
$ find --version
find (GNU findutils) 4.7.0
that recipe is super handy; I use it all the time
It's going into the raspbian install files and listing things from 2018
did I mention you should pipe the output into less? ๐
also the interesting stuff is gonna be at the end
is it going old to new?
ya
you could flip that around by saying sort -rn instead of sort -n
probably ought to, now that I think about it
so I piped it into less
I think less is working but I can't ctrl+c out of it
I'm pretty new to bash, no idea how to get out of this
ah ctrl z works I guess
Still not able to see the first entries it hits
yep, I don't know why but sometimes C-z works when C-c doesn't
well try again, with sort -rn
it should be faster
There's a lot of "no such file or directory" before it gets to the recent files
yeah, 've been doing the -rn sort for a bit
huh
Other than playing ctrl z whackamole, and trying to capture the absolute most recent files, how should I get the output from this to a reasonably readable format
I could understand permission denied, but no such file or directory seems wrong
here's an example line:
try | head instead of | less -- that'll show the first 10, then stop
find: /proc/63/exe: No such file or directory
uh no?
you can hide the errors with find / -printf '%T@ ' -ls | sort -rn | cut -d\ -f 2- 2> /dev/null | head
you could also try limiting to /usr instead of /, on the assumption that everything got installed under there
fewer weird files under /usr
by doing find /usr -printf '%T@ ' -ls | sort -rn | cut -d\ -f 2- 2> /dev/null | head?
ok that's less than a second to run in /usr
but did it find your stuff?
it found some codecs and drivers I knew were installed earlier
well anyway; that's how you scour the whole filesystem
so here's a third idea: you might be able to go back into the directory where you ran "make install", and run ... make uninstall.
Not every package lets you do that, but this one might
I linked the package earlier, right?
For the specific package though, the actual main code has @echo TODO as it's uninstall
heh
The codec might be different though
the x264
it's based on existing stuff but patched
ok so I ran sudo make uninstall in the dir for the souce for that patched standard x264
and it removed two files
so, reinstall and try to point ./configure to those files?
I guess
I'm actually having trouble picturing what you're doing
you're building two things from source, one of which depends on the other?
yes
the commands it ran were:
ah I was mistaken
two lines, 5 files?
Time for a crude screenshot
you can't copy the text from your terminal?
Hopefully useful
the terminal's on a rpi and it's running a cli-only install rn
Tried getting a gui up but I'd get a login screen that when I put the right usrname and pass it'd just reboot
that's an odd location -- I'd expect /usr/include instead of /include and /usr/lib instead of /lib
or even /usr/local/
the other thing you're building is probably not looking in /include, 'cuz that's weird. So I guess pass something like CXXFLAGS=-I/include to it
maybe CPPFLAGS instead
see what ./config --help tells you
yeah I think CXX is for C++, which I doubt you're using
dunno tbh
you have to make the two packages "agree"; you can do that by fiddling one of them, or fiddling the other (or even both)
which is best is up to you
I'm not sure what a sane location would be for this.
Here's what the install readme guides to do
I had to tweak this a bit to get it to work but it's here
git clone https://bitbucket.org/memahaxx/drc-x264/
cd drc-x264
./configure --prefix=$PATCHED_X264_PREFIX --enable-static
make install
and then to build the thing that depends on that:
cd libdrc
PKG_CONFIG_PATH=$PATCHED_X264_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH ./configure
make```
well $PATCHED_X264_PREFIX is a variable; what's its value?
I've run env and it's not there
maybe it's empty and that's why the stuff wound up in weird locations
do echo $PATCHED_X264_PREFIX
variables can live in the environment or just the shell; echo will look both places but env only looks in the environment
blank/newline returned
ok well that's why it got installed someplace weird.
the README probably assumed you wouldn't type $PATCHED_X264_PREFIX literally
I'd use /usr/local as the prefix; that's kinda conventional
My guess is that Mr Memahaxx is not super-professional in his documentation
The website looks pretty professional :P
and yet those two sets of commands you pasted are consistent, so it really shudda worked ...
but good css does not a good readme make
Here's where those commands appear if you want to look
I had a time getting git to clone from the bitbucket
Kept getting errors on the url other than not found
like, illegal url
I've started re-makeing the dependency lib
Looks like it's finding the dependency now, thanks
It's missing more dependencies, but at least it's a new problem
SDL and GLEW
do you know how to get SDL and GLEW?
"If you want to build the libdrc demos, SDL and GLEW are also required."
I don't even know what they are
so it's a problem of the docs
so from here it's a process of digging through the files to see what other dependencies are needed?
them being those packages which have dependencies back to something that once ran on an 8bit micro or something
or are just really hard to find the dependencies for?
dunno
nono what did you mean by
and then struggling to build and install them
how far do dependency trees go
BAAAAHAHAHAHAH HaHAHAA HA HA HHHHA AH snort HA HHA HAHAHA HA HAH HAH HAH HAHAH HAH HAH oh man HAH AH HAAAAAHAAAHHH cough cough cough hah hehhh hehhhhh geez.. cough
sometimes it's not this bad
but I think you're dealing with amateur software made by amateurs
so it's build->need another dependency ->try to build -> need another dependency -> that has no docs
it's usually not too bad, but yeah, it could go a few levels
It's software with no release version
I found what GLEW is supposed to be
GL E Wrangler library
and I found it's github
it's saying now though:
this is something with make?
oh wait I might not need to build it
http://glew.sourceforge.net/install.html says there's premade .h and .c files for it?
sourceforge notoriously starting inserting ads in windows executables that they hosted.
basically, corrupting the files that people had trusted them to host
exactly
Today SourceForge it is excited to launch DevShare, a new opt-in, revenue-sharing program aimed at giving developers a better way to monetize their projects in a transparent, honest ...
It says opt-in but I assume it was a sneaky, sort of underhanded auto opt-in thing, right?
honestly I don't know
like, you're opted in by default
to me, it just smelled bad
same here
I never used them for hosting so it didn't much matter. And github was getting big at the time
you've fumbled something. That glew directory somehow doesn't contain the source code
dunno what's in it
The readme.mid has this gacha in it:
There's a folder within called auto which requires you run make on it first ._.
running make there it's doing
something
about 10 screens of cmdline output later I have a tarminal again
I think they have a program which makes source
they've automated some part of the source writing process?
wouldn't surprise me
if they're hosting on sourceforge then anything's fair game, huh?
still getting "demos cannot be built because one of the dependencies (glew) could not be found"
Hey guys. I've created a bash file but when I try to open it with sudo ./adminMenu.sh it says ./adminMenu.sh command not found
Why isn't it running for me?
Are you in the right directory when doing that command?
Yeah I can cat the file and see the script is in there too
Sorry I think it's a permissions problem
so cat <file> works, but if you immediately run <file> it doesn't?
ok, good luck with that
I think it was a permissions problem even with sudo
I'm not sure. The file in terminal was white and normal font
Usually if you can execute it it's bold and a different colour right?
When i changed the mode it went to a different colour
I'm honestly not well-versed in permissions in bash
But the different color sounds like a difference and like you're making progress for sure
also a different error
Yeah definitely progress
The format was just wrong in my script. A misplaced ;;
I'm trying to create a script that backs up files
But I want to copy only the files that have been edited since the previous backup
Any idea how I could go about that? ๐
I'd say follow the template of find / -printf '%T@ ' -ls | sort -n | cut -d\ -f 2- if I knew how it worked, but I don't
If you change n to rn then it shows files by date modified
and it shows them in recently modified first
so, that might be a building block you could use to find all files that were modified after some set date, and then copy them
so something like find / -printf '%T@ ' -ls | sort -rn | cut -d\ -f 2-
@hollow skiff This might work, but I'm not too sure how that command works. offby1 showed me that to find the most recently modified files
the path you want to start from is the /
I'm still very new so the conventions I don't know yet
same
to start from /usr/local you'd do
find /usr/local/ -printf '%T@ ' -ls | sort -n | cut -d\ -f 2-
I don't know what '%T@ ' does
Okay, it's saying cut: the delimiter must be a single character
Ahh ok. Now it's saying find: paths must precede expression: 'ls
find /var/www/html/intsite -printf '%T@ ' ls | sort -rn | cut -d\ -f 2-
That's what I have so far
add a slash after intsite
Same error. Hmmmm
is the var directory a home directory?
or should you use ./var etcetera
oh it is
should work
hm
oh you left out the - at -ls
Is it working?
If you know how to use the output of that for a backup script then props to you
I don't lol. That's my next task
best I'd be able to do is pipe it into a text file lol
well, good luck
while you're here:
Cheers ๐
You wouldn't happen to know how to install Simple Diirect media layer, would you?
Need it for something I'm building
from source
I've never heard of it before I'm afraid
Google returned this though:
sudo apt-get install libsdl2-2.0
Great ๐
I literally googled it at the same time
lol
google first needs to be a mantra of mine
Mine too
Jeez
What's make ran lulz
make is a program
make turns a makefile and some source into a executable bin
I've been trying to build a package someone else made from source for a few hours now
Ahh I see
Sorry I can't be of much use to you. I'm too inexperienced
Good luck though ๐
This is my first time sitting down at a linux term and building packages from source, literally just installed raspbian on an rpi today ๐
You've got way more experience than me on user perms by the way
I have zero clue what those are outside of sudo
ok so uh
I don't know how to run this lol
Everything you need to know about chmod is here:
https://www.reddit.com/r/linux/comments/ayditr/chmod_cheatsheet/
rpi's sound like fun
Anyway its 6:15am and I need to sleep
All the best! ๐
Hey
What is a linux that you would recommend me?
linux is just the kernel :) there is no "a linux", it's the linux
think you mean a linux distro, which is an operating system distribution using the linux kernel
@main olive Whichever distro you like
in which case, it depends entirely on your skill level
there's so much choice that it's a matter of taste at this point
but newcomers usually use Ubuntu or Mint
arch?
What is it like?
it is for people who already know their way around linux and are very comfortable with the terminal
xx
arch is very bare-bones, which is perfect for people who want to build their distro up to be comfortable to them
yes?
I want to install a linux distro without usb
Can you please check the internet about UNETBootIN for me?
what
you have the internet
I know but I'm really bad at these kind of stuff
also unetbootin is not for network boot
If you cannot use a USB stick, does your computer support PXE? Could boot from that, however, it is 100x harder to set up
PreExecution Boot Environment
eh?
It allows to boot an image over the entwork
You neeed a dhcp server and a tftp server for that
What if I try unetbootin?
AIO boot has all of that integrated
again, unetbootin is for USBs
Some guy on youtube is telling me to install unetbootin
I have been getting many request from you guys that "how can I install Linux OS without a CD/DVD or USB Pendrive. So I have tried so many method on my computer and finally I have got a solution for installing linux with a CD/DVD or USB Drive .So In this video I will going to s...
@main olive True.. Especially if you come across some cringy indian dude
@steel verge Anything that doesn't require a usb?
unetbootin is also pretty dated at this point and i woudn't use it even to burn usbs
As I said, either network, which requires an extra computer, or a DVD
Actually, that makes me think of a fun project
using termux on Android to run a "pxe server"
@main olive Does the link direct me on how to install a linux distro with a usb?
dude
using termux on Android to run a "pxe server"
@steel verge I fell off my chair, please stop throwing those big stuff on me
lmfao
the link literally says it's for "network boot"
What is a network boot..?
you will not learn these things unless you research them yourself
google "network boot" and read up on it
@steel verge similar project, have you heard of DriveDroid? Emulates an USB drive and lets you boot ISOs stored on the phone
During a network boot, the computer fetches an IP from a DHCP server. The DHCP server will also deliver option 66 and 67, which are the filename to download and the server to contact for that file. The file is a bootloader, which is then booted by the OS and handles the rest of the downloads required.
Search Results
Featured snippet from the web
Network booting, or booting from LAN as it is also called, is a process which allows a computer to start up and load an operating system or other program directly from the network without any locally attached storage device, like a floppy, CDROM, USB stick or hard drive.
So it loads?
It doesn't install?
The whole thing is called PXE and supported by most MOtherboards these days
it loads a live environment just as it would when you use an USB
you can install to the hard drive using that live environment
wait WHAT
I can install?!
... yes.
wow.
Pretty self-explanatory
๐
can anyone help me with some basioc bash
okay so i have a script that im running but it only works when i do
. ./upload-helm-chart.sh && setVariablesExecuteAll atlas eng
it works
but ./upload-helm-chart.sh && setVariablesExecuteAll atlas eng
it doesn't
so i'm confused why
the . at the start
is it because my terminal is zsh?
im using iterm2
but ./upload-helm-chart.sh setVariablesExecuteAll atlas eng
sorry that doesnt work
the source/. and the && is missing
but usually if i want to run a function from a script ./testScript.sh testFunction arg1 arg2
works fine
know what i mean?
yep
function setVariablesExecuteAll {
path = $1
url = $2
}
trying to run this
. ./upload-helm-chart.sh && setVariablesExecuteAll atlas eng this works
./upload-helm-chart.sh setVariablesExecuteAll atlas eng
this doesnt
why? no idea
Cause I don't think it's supposed to work
I don't know where you got the idea that it should
If you want to use a function defined in a script you need to source it
because ive used scripts before where i can call a function like that and a lot of answers online say it should work
okay can you explain that please
i dont get the distinction
./script.sh arg1 arg2 executes a script with those args
source ./script.sh will instead like put the current script's commands in the current shell, if that makes sense. Not sure how to explain it well.
The source would make the commands defined inside the script accessible locally too i.e. outside the script and in the current shell
In this case ./upload-helm-chart.sh setVariablesExecuteAll atlas eng, as far as I know, the shell just interprets setVariablesExecuteAll as $1. So unless you have some code to call a function based on the value of $1, it won't do anything
This is how I understand it
Maybe zsh is different?
Can you link some of the answers that say it should work like that?
oooooooh
yeah i will
okay as soon as you said it registers it as a first argument
it seems so dumb that people are saying that
I have a script that has some functions.
Can I run one of the function directly from command line?
Something like this?
myScript.sh func()
so the first few answers there
you have to go down to find the solution which works
but thank you for that explanation
Yeah most answers say to source it
One answer uses "$@"
Which would do what you want
So yeah if you just add that to the end of your script it will work like you originally wanted
You're welcome
source ./script.shwill instead like put the current script's commands in the current shell, if that makes sense. Not sure how to explain it well.
@warped nimbus it can be viewed like animportfor shells
Yes! good analogy
much more primitive, but the core concept is the same
yeah it makes sense to me now xx
does that mean source makes it run it first then? so it will run twice effectively
source does execute stuff in there, but if you've defined a function, only the "defining" itself will be executed, not the body of the function itself
if that makes sense
okay it makes sense
ill take it for what it is and not pry further at risk of confusing myself lol
Is it possible to run a Selenium chrome driver on Ubuntu just with putty? Because it can't open any page visually or else
that's pretty much the point of selenium, that it doesn't require a graphical interface
Okay well, because when I deployed it on my windows machine it didn't give me any errors but now on my server it does. However, good to know that it is possible. Thanks
what errors exactly?
might be able to help or point in the right direction
also my apologies, i've been misleading
wdym
selenium itself doesn't require a graphical interface, but whatever browser you're using for the backend might. for this, you have to be sure that selenium tries to use chrome headless
Oh okay
https://intoli.com/blog/running-selenium-with-headless-chrome/ this might provide some insight
Thank you
๐
Sorry, but you may only use this command within #bot-commands.
np honest mistake
. ./upload-helm-chart.sh atlas-logs-exporter && executeLint
โ Shell Script
1s
-
. ./upload-helm-chart.sh atlas-logs-exporter
-
path=
-
url=
-
function createHelmTemplate {
/home/jenkins/agent/workspace/infra-k8s-charts_PR-114@tmp/durable-ec88a11d/script.sh: 11: ./upload-helm-chart.sh: function: not found
script returned exit code 127
my build in jenkins is failing because of this idk whats up with it
!codeblock
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
โข These are backticks, not quotes. Backticks can usually be found on the tilde key.
โข You can also use py as the language instead of python
โข The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
can you link us to the jenkins job?
def THE_ENVIRONMENT = "eng"
def PATH_FILE = "atlas-logs-exporter"
pipeline {
agent any
stages {
stage('Upload chart') {
steps {
script {
if (env.BRANCH_NAME == 'master'){
if (THE_ENVIRONMENT == 'eng') {
sh ". ./upload-helm-chart.sh ${PATH_FILE} ${ENG} && executeAll"
} else if (THE_ENVIRONMENT == 'ops') {
sh ". ./upload-helm-chart.sh ${PATH_FILE} ${OPS} && executeAll"
}
}
else {
sh ". ./upload-helm-chart.sh ${PATH_FILE} && executeLint"
}
}
}
}
}
this one
oh the script is something else
its running the helm chart script
are you defining functions in the script with function?
yup like this
path=$1
url=$2
function createHelmTemplate {
if [ ! -z "$path" ]; then
out=$(helm template --namespace test --values=values.yaml --set id=test -x $path . )
else
out=$(helm template --namespace test --values=values.yaml --set id=test . )
fi
echo "${out}"
helm lint --namespace test --values=values.yaml --set id=test . && \
echo "${out}" | kubectl apply --validate=true --dry-run=true -f -
}
function executeAll {
cd "$path"
createHelmTemplate
packageHelmTemplate
loginToVault
}
function executeLint {
cd "$path"
createHelmTemplate
}
sh doesn't support that syntax
this is the execution
use createHelmTemplate() { stuff } instead
add the (), and remove the function
and yeah, all of them
#!/bin/sh
function()
{
echo "args: $@"
}
something lik ethis
yep gotcha ill let you know what happens
. ./upload-helm-chart.sh atlas-logs-exporter && executeLint
โ Shell Script
<1s
+ . ./upload-helm-chart.sh atlas-logs-exporter
+ path=
+ url=
+ executeLint
+ cd
+ createHelmTemplate
+ [ ! -z ]
+ helm template --namespace test --values=values.yaml --set id=test .
Error: open values.yaml: no such file or directory
+ out=
script returned exit code 1
Now that comes up
well, it can't find values.yaml for whatever reason
can you add a pwd right before that last command and see where it's trying to run from?
and whether it's the same directory where values.yaml actually is
okay
also i just realised
it does cd with no argument
looks like $path is blank
cd with no argument changes directory to the user's home dir
which on jenkins is some arbitrary location and probably not where you actually want to go
this is probably why it can't find values.yaml
okay yeah spoke w colleague
why might that be?
sh ". ./upload-helm-chart.sh ${PATH_FILE} ${ENG} && executeAll"
this is what jenkins runs
and we specify path as $1
url also isnt set
+ path=
+ url=
+ executeLint
+ cd
+ createHelmTemplate
+ [ ! -z ]
+ helm template --namespace test --values=values.yaml --set id=test .
Error: open values.yaml: no such file or directory
+ out=
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[Bitbucket] Notifying pull request build result
[Bitbucket] Build result notified
ERROR: script returned exit code 1
Finished: FAILURE```
grrrr
i'm not sure the jenkinsfile does variable substitution like that
oh, no, jenkinsfile does do that
strange
dunno, i'm stumped
haven't really worked with jenkins too much
okay ive narrowed down the issue
// Change environment and path file below
def THE_ENVIRONMENT = "eng"
def PATH_FILE = "atlas-logs-exporter"
if (env.BRANCH_NAME == 'master'){
if (THE_ENVIRONMENT == 'eng') {
sh ". ./upload-helm-chart.sh ${PATH_FILE} ${ENG} && executeAll"
} else if (THE_ENVIRONMENT == 'ops') {
sh ". ./upload-helm-chart.sh ${PATH_FILE} ${OPS} && executeAll"
}
}
the issue is the defined variables arent being passed through
no idea why
@modern kestrel did you ever figure it out?
a workaround i was going to suggest was using environment instead of defining them with def
i have a senior engineer looking at it and he's stumped too haha hes diagnosing it but bash isnt his forte
i was going to try that
tbh i don't think this is a bash-specific issue
it seems (to me at least) to be related to jenkins
apparently path is a keyword
or something
idk still looking lol
think is his speciality is jenkins and he said the jenkins file looks fine
thing*
what distinguishes Unix from other file systems?
@main olive Unix is not a file system
what other systems do you have in mind?
idk i just wanna know what unix even is
it's an operating system. Nowadays, it's more used as a philosophy that other operating systems (like Linux and MacOS) follow
which is why BSD, MacOS, Linux, etc have a lot of similarities
o ok
I'm rubbish at this sort of thing so that's helpful
yea
nowadays, when people say Unix, they don't actually mean "the Unix operating system", they probably mean something like Linux or similar
@main olive is was because the first argument was called path
in the script
changed that and it fixed
coolio, good to know
and very obvious now that i think about it
$PATH has a special meaning
What's the difference between source and .
I'm not quite getting it
Some people say theres no diffrence but there definitely appears to be
what differencese are you experiencing?
can you compile python code with the make command
yes... all make command does is run a bunch of commands from the Makefile
so all you have to do is write your Makefile with the commands you want to run
usually we use wheel and setup.py instead, though
Hi
How can i print a textfile in the console, but with timestamps of when each line of the file was written
that information isn't stored on a per-line basis
you have the creation date and the last-modified date
you need to make it so whatever creates that textfile also prepends timestamps
here is my command
date +%A%_d" "%B", "%Y" @ " && echo $(date +"%r" | sed -e 's/\([0-9][0-9]:[0-9][0-9]\):[0-9][0-9]/\1/')
how can i get both the outputs onto the same line
that's my issue
@magic basin a=date +%A%_d" "%B", "%Y" @ " && echo -n $a && echo $(date +"%r" | sed -e 's/([0-9][0-9]:[0
-9][0-9]):[0-9][0-9]/\1/')
@rich oriole ?
I solved your issue, code above
yeah i tried, it didn't work?
that's not the same as what you sent
pastebin?
How you can answer in that way if I ask how to do it here..
i don't think you can send it here
test`test
because discord is weird
ok I need to use two backticks