#unix
1 messages · Page 45 of 1
i wonder how aws have so many ip addresses that they give out servers for free
They probably got a huge ip range
You can run a curl script to get them dynamically
looks like they have a huge json file w/ all the blocks and the services herel:
https://aws.amazon.com/blogs/aws/aws-ip-ranges-json/
Hi guys! I understand the gist of creating virtual environment for every single project. I know the process of install pip, virtualenv -> create a new environment using virtualenv -> activate that environment and install let say Django for web dev project.
SO what should I do before all these to make sure everything runs as smooth as possible? And yet find it challenging to wrap my head around with:
(1) installing different version of python,
(2) alias and stuff,
(3) pip installation,
(4) personal working directory path vs /usr/bin/python, etc.
You can usually stick with 1 version of python at a time
You don't typically need special setup
You can start to come up with shell aliases and things as you get more comfortable
apt install python3 python3-pip python3-wheel python3-venv is all you need on debian for example
Whereas on windows and mac usuall pip and wheel and venv are included with the main python installation
(Debian likes to package things in smaller pieces so you can omit them if you really know what you are doing)
So a new project basically consists of ```bash
mkdir my-project
cd my-project
python -m venv ./venv
Then you just `. ./venv/bin/activate` and you are good to go
@formal schooner thus the path where I installed Python doesn’t really matter right?
as long as its in your PATH yes
which python
I created the below class that uses inotify to watch and notify of file changes. I designed in a way that a user can enable, disable and re-enable it again if needed. Because the infinite for loop in the start function results in it blocking the whole thread, I decided to create and execute this function in a separate thread. All this works nicely until I disable and re-enable the watcher again by explicitly calling the stop function first and then the start function. The main thread where all the business logic resides and from where I am explicitly calling these functions is blocked. I think this is because the start function is executed in the main thread rather than in the separate thread when I explicitly call it.
Does anyone know how I can make sure that this function is executed in the thread that I am creating in the Watcher class rather than in the main thread?
... imports ...
class Watcher:
def __init__(self, file_paths):
self._i = inotify.adapters.Inotify()
self._is_watching = False
self._watched_files = set()
self.modified_files_queue = queue.Queue()
self._thread = threading.Thread(target=self.start).start
if file_paths:
if not isinstance(file_paths, list):
file_paths = [file_paths]
self.add_file_to_watch(file_paths)
def start(self):
self._is_watching = True
for event in self._i.event_gen(yield_nones=False):
if not self._is_watching:
break
(_, type_names, path, filename) = event
print("PATH=[{}] FILENAME=[{}] EVENT_TYPES={}".format(
path, filename, type_names))
self.modified_files_queue.put(Path(path))
def stop(self):
self.remove_files_from_watch(list(self._watched_files))
self._is_watching = False
def add_file_to_watch(self, file_path):
if file_path not in self._watched_files:
self._i.add_watch(file_path, inotify.constants.IN_MODIFY)
self._watched_files.add(file_path)
def remove_files_from_watch(self, file_path):
if file_path in self._watched_files:
self._i.remove_watch(file_path)
self._watched_files.remove(file_path)
p.s. I tried moving the logic that deals with creation of the thread in a separate method and calling it before calling the start function when re-enabling the watcher, but that increases the number of threads in memory and I couldn't find a way of killing the old method before creating a new one..
Hello, I just built a linux kernel but when Im trying to boot into it with qemu , I somehow havent set the root password and hence not able to go root with it , is there a default password because remounting the fs as rw also requires me to be root
@river estuary you wrote .start instead of .start() when you do self._thread =
not sure if that's in your actual code or just a mistake here
is the inotify object thread safe?
I think it is (not at my desk rn) because it runs in the seperate thread when its first enabled, but when I disable it and then enable it agaib by calling stop and then start, it executes in the main thread.
so when you disable and re-enable the watcher, the main thread becomes blocked?
Correct, note that to re-enable I am explicitly calling the ‘start’ function. This makes me think that the function is getting executed in the main thread rather than in the separate thread.
can you "start" a thread twice?
I was looking to install Ubuntu encrypted with LUKS with dual-boot on my Lenovo ThinkPad by following https://askubuntu.com/a/293029 by Flimm or https://www.mikekasberg.com/blog/2020/04/08/dual-boot-ubuntu-and-windows-with-encryption.html by mkasberg. The issue I noticed now was that "The Lenovo BIOS WMI interface currently only supports enabling UEFI with Secure Boot. Enabling UEFI without Secure Boot or with the Compatibility Support Module(CSM) is not supported" . How can I work around this and still install Ubuntu encrypted with LUKS with dual-boot? Mike for instance in the tutorial said "I disabled Secure Boot. I’m not sure if this is absolutely required, and you can try leaving it on or re-enabling it when you’re done if you want." Many others too have noted that disabling secure boot is needed. Thank you.
can you "start" a thread twice?
@formal schooner not sure if thats possible but I will give it a try in the morning and get back to you.
Hey unix people, maybe you could look at my problem in #help-dumpling?
it's a weird mixture of a lot of stuff, but maybe someone has done something similar
I want to make a wireshark-like packet sniffing proxy in python, ideally something I could append to proxychains.conf, and analyze my traffic in real time. I've done some searching around and found this: https://www.tutorialspoint.com/python_penetration_testing/python_penetration_testing_network_packet_sniffing.htm, however I'm not sure where the data is coming from
can you "start" a thread twice?
@formal schooner I've just tried this, but it throws a runtime errorRuntimeError: threads can only be started once
Hello, I just built a linux kernel but when Im trying to boot into it with qemu , I somehow havent set the root password and hence not able to go root with it , is there a default password because remounting the fs as rw also requires me to be root
anyone has any insights on this?
Are you in the sudoers group perhaps?
No Im not actually
Guess you're screwed then
You have to boot another distro, chroot into it and set the root password/add you to the sudoers
is there some way I can set a root password while configuring my kernel through makefile's menuconfig?
No you can't, the root password is set in /etc/passwd or /etc/shadow, it has nothing to do with the kernel 
ah thanks @fresh saddle , I actually forgot that I could provide permissions in the init shell script to give me root perms , thank u once again
Any time! 
Hi
I need some help parsing a unix file, there's a ~R and ~Y character that are in blue
which I am trying to catch with a regex on a windows system
They dont show up in that same format, and after they are pased they become an upside down question mark. Do you know a way to capture these characters with REGEX
my current solution is to isolate what character they are not.. and capture them, but this is not a good solution for us, as there will be otehr character we might ignore in the future.
Any help appreciated.
any reason not to just do a unix2dos @wind adder ?
Thing is we can only manipulate the file through this informatica tool
and there we can only use regexes
otherwise have to get the unix team involved
Yes, but there's some in between words aswell
thats what we want to avoid
like the name O~RHannasey
where the ~R is blue
I think they might just be different styles of apostrophes
gotcha ... so your tool looks like it's not a UTF-8 compliant tool lol
Yes sadly
eitehr that or the unix file is UTF-16
but we can only store UTF-8 chars in db
do you match on those if you just do regex for those puncuation characters?
no
They're behaving a bit different on the clients too, like on oracle its just showing up as upside down question marks
what if you set up a negative match for all [a-zA-Z0-9]
but python it is Angstrom and then upside down questionmarks
We are doing that currently
But the data sets are huge
we might be cutting off some characters we want to capture
and that can be handled
only the upside down question mark is making some process fail down the line
i mean, those things are easy to add to the negative match though (the ones you want to be able to process)
Yes that is true, I have done this for now.
I was just curious if there was a way to regex a specific utf char
like with unicode
i think you can, but it depends on the regex parser if it knows how to do that
So I could just do some tests and see which unicode captures the exact chars
there are a LOT of possibilies with unicode though ... not sure brute-forcing it is a good spend of your time lol
oh okay
like if its below 1mill its okay u know
we got a lotta computation power to waste lol
if you can find out the regex parsing engine your tool uses, it's not hard to figure out what flags you need to provide to do unicode lookup
(if you can that is)
oky sure, I think thats a good idea, i will look into it
we can informatica should disclose this
Thanks for your suggestion
i've not heard of that tool, but yeah, if you have support, it's a pretty simply doc lookup or support ticket 😄
Hey
@viscid sage As far as the informatica tool goes
It should be using the Oracle 12 regex engine
everything on informatica we can usually query for on oracle or with plsql code
can anyone help me out in using rhel 8 for 32 bit windows 7 that whether it can be installed and run properly or not???
wait what?
i'm not sure what you just asked @regal tundra
are you trying to run RHEL8 in a VM? or a container? or installing along side your windows? or installing it instead of your windows?
Maybe WSL? Just guessing here.
Oh, Windows 7. That's a no.
Must be something else then
im struggling to change default user on WSL ubuntu
ive found this https://winaero.com/blog/set-default-user-wsl-windows-10/ but it says to use ubuntu config but when i try to do that it says that ubuntu is an unidentified command and where.exe ubuntu cant find anything i thought i could do wsl config but it says thats not a command
yeah ... i though WSL as well ... but then remembered that RHEL doesn't even have a WSL image yet lol
oh i think i found it i have to do ubuntu2004 since thats the version i have
i hav windows
I have a python script which works on macos but I want it to work on my laptop with linux without me having to install all the dependencies myself on my linux machine. Is there a way to do this?
write down the dependencies in a requirements.txt file and distribute it with your script
Then you can use pip3 install -r requirements.txt
That's a simple option. You can also properly package your app and create a distribution, like with setuptools.
I searched this up and this seemed to be exactly what I was looking for, thx!
Hey there I have a question
So I have a mac
And I was wondering if there was a way to restrict my terminal from using the python2 version of pip
pip3?
Hey, I wanted to try out a new thing I learned: chmod +s [filename] but I don't really see how it works, I read that it was supposed to make a file executable and if I run it, it will be run with the owners user id instead of your user id. But when I tried this, I couldn't get it to work, I've logged in as root, made a new file which contained:
#/bin/bash
bash -p
and set the flag, then I went back to my non-root user and ran the file, problem is that when I ran id I haven't seen any new groups or uids present, is there something I'm missing?
ping me for the answer please, thanks
@shadow musk did you try just putting id in the file?
#!/bin/bash
whoami
groups
id
then chmod +s that file
@formal schooner @shadow musk linux ignores the +s flag on script files like that
even on executables like manually compiled C code
too
some older kernels will permit that flag to work though!
on older kernels
on newer ones it only works on executables that come in
with the installation iso
as far as i understand
like /bin/passwd
even kali distros of the last years disallowed it
despite having root as a default user
that says something
Does kali still have root as default? I thought they switched
interesting, is that because there was some attack where you could put +s on a file when you weren't the owner?
@heady shore they switched in the latest release
2020 one
@formal schooner yes security reasons
can i use multiple linters in a python.nanorc if yes whats the syntax for that?
and why does running pylint linter when no errors are present produce an error?
no errors are present meaning there is nothing to lint
what's the best place to save file on Linux and Mac?
On your home folder? (~)
@quaint bluff i have a ~/projects directory
i don't want to create folders
so i have ~/projects/projectA/... where i put all my projects
i also have ~/tmp and ~/misc
my script is creating file
where i put random junk, tmp for temporary things and misc for uncategorized things
ah
what kind of script? who is meant to use it?
what kind of file does it create?
other people. it is a plugin for cross platform program. it is creating svg file. i already met some problems with windows with saving file in program files folder
windows has documents folder
i wonder what mac and linux have
oh. normally a command line tool should give the user the option to specify the output location
yes you can use $HOME but i dislike programs that don't let me choose where to save output
mac and linux also have documents folders
windows and linux both have special functions [shell known folders, and xdg user dirs] to get the location of it, i don't know if it can ever be different on mac
true, ~/Documents is pretty common
there isn't an XDG base directory specification equivalent for ~/Documents but there is XDG_DATA_HOME which should be ~/.local/share by default
yes you can use
$HOMEbut i dislike programs that don't let me choose where to save output
@formal schooner
i will delete the file, after I upload it to program, i promise
@quaint bluff if the file is temporary use $XDG_CACHE_HOME
which is ~/.cache by default
hmm
yes, file is temporary
is $XDG_CACHE_HOME a unix only thing or python have a special name for folder of temporary files?
you can also create a truly temporary directory with the tempfile module
XDG_CACHE_HOME is moslty a gnu/linux thing yes. the xdg basedir spec is published by the Freedesktop organization
import platform
from pathlib import Path
if platform.system() == 'Windows':
output_dir = Path(os.environ['USERPROFILE']).joinpath('Documents')
else:
_cache_dir_default = Path(os.environ['HOME']).joinpath('.cache')
output_dir = Path(os.getenv('XDG_CACHE_HOME', _cache_dir_default).joinpath('my-app')
output_dir.mkdir(exist_ok=True)
for example
tempfile.mkstemp(suffix=None, prefix=None, dir=None, text=False)```
Creates a temporary file in the most secure manner possible. There are no race conditions in the file’s creation, assuming that the platform properly implements the [`os.O_EXCL`](os.html#os.O_EXCL "os.O_EXCL") flag for [`os.open()`](os.html#os.open "os.open"). The file is readable and writable only by the creating user ID. If the platform uses permission bits to indicate whether a file is executable, the file is executable by no one. The file descriptor is not inherited by child processes.
Unlike [`TemporaryFile()`](#tempfile.TemporaryFile "tempfile.TemporaryFile"), the user of [`mkstemp()`](#tempfile.mkstemp "tempfile.mkstemp") is responsible for deleting the temporary file when done with it.
If *suffix* is not `None`, the file name will end with that suffix, otherwise there will be no suffix. [`mkstemp()`](#tempfile.mkstemp "tempfile.mkstemp") does not put a dot between the file name and the suffix; if you need one, put it at the beginning of *suffix*.... [read more](https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp)
!d g tempfile.mkdtemp
tempfile.mkdtemp(suffix=None, prefix=None, dir=None)```
Creates a temporary directory in the most secure manner possible. There are no race conditions in the directory’s creation. The directory is readable, writable, and searchable only by the creating user ID.
The user of [`mkdtemp()`](#tempfile.mkdtemp "tempfile.mkdtemp") is responsible for deleting the temporary directory and its contents when done with it.
The *prefix*, *suffix*, and *dir* arguments are the same as for [`mkstemp()`](#tempfile.mkstemp "tempfile.mkstemp").
[`mkdtemp()`](#tempfile.mkdtemp "tempfile.mkdtemp") returns the absolute pathname of the new directory.
Raises an [auditing event](sys.html#auditing) `tempfile.mkdtemp` with argument `fullpath`.
Changed in version 3.5: *suffix*, *prefix*, and *dir* may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. *suffix* and *prefix* now accept and default to `None` to cause an appropriate default value to be used.... [read more](https://docs.python.org/3/library/tempfile.html#tempfile.mkdtemp)
mkstemp might be the one you want
@formal schooner the documents folder isn't guaranteed to be named documents
best way to get documents folder on windows is to instantiate an IKnownFolderManager
[i've been working on a module for doing that in a cross-platform way, actually]
and the XDG specification for documents etc is to load ~/.config/user-dirs.dirs
[~/.config is XDG_CONFIG_HOME]
and that file will say sh XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_TEMPLATES_DIR="$HOME/Templates" XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_MUSIC_DIR="$HOME/Music" XDG_PICTURES_DIR="$HOME/Pictures" XDG_VIDEOS_DIR="$HOME/Videos"
apparently on mac you're supposed to execute applescript "return POSIX path of (path to documents folder) as string"
can't test that right now
oh yeah i forgot about those
thats not part of the basedir spec though right?
or is it
i think it's a different spec
also even though the file looks like a shell script defining environment variables, it has to be that exact syntax to work
i.e. XDG_WHATEVER_DIR equal double quote dollar HOME slash [whatever] double quote
no $variables anywhere else but $HOME/ in beginning
I have some c program that also works with python. Like, there is a Py_Initialize() from #include <Python.h>. However, it always start up with the system default python 2 version, but I want to use python 3. I've tried setting PYTHONHOME, PYTHONPATH but to no avail. I feel like it should be easy to configure python version but I'm just not getting it
Do you have the python3 headers installed?
Are you saying that your program is being compiled with Python 2 headers? Or what do you mean that it "starts up" with python 2?
Does that even respect those environment variables?
No, looks like I did not have the headers. Yes it does run with Python 2.
I just took a look at the make file, and I see a python-config. Seems like I need to set this to be python3.8 config or something.
How does one make a sed expression delimmed by ;s execute in a certain order?
I'm not sure how it determines order by default, but it doesn't progress through each expression one by one
Anyone got steps for changing operating system to linux
hardware split two operating systems.
@feral heron do you have 2 storage volumes or are you trying to dual-boot on a single storage device
@heady shore what's an example of it not doing what you want and what you expect?
@heady shore it runs the entire program for every line of input. so if you have s/a/b/; /b/d that will first substitute a for b, then delete the line if it contains b.
more specifically it copies each line of input to the "pattern space" and runs commands on the pattern space until the program ends, then sends the contents of the pattern space to the output
Execution Cycle (sed, a stream editor)
hello
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
/bin/sh: 1: pkg-config: not found
CC Makefile.dep
/bin/sh: 1: pkg-config: not found
make[1]: Warning: File 'Makefile.dep' has modification time 1.3 s in the future
CC adlist.o
/bin/sh: 1: cc: not found
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
I hope that this is the right channel, but when I try to compile redis-server I get this, and if I use apt-get it installs an old version
You apparently need to install pkg-config and cc
Can I apt install them?
It looks like it
Ok, thanks, will try
@fresh saddle It says unable to locate cc
Or did you mean gcc?
But even without installing it at least I got a different error:
(.venv) vagrant@vagrant:/vagrant/redis-6.0.6$ make
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
CC Makefile.dep
make[1]: Warning: File 'Makefile.dep' has modification time 1.4 s in the future
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
#include <jemalloc/jemalloc.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
It seems like the cc not found problem isnt present here
Maybe you should check the build steps again, in case you are missing a dependency
Like the install steps?
Only dependencies working gcc and libc
Might need to check if libc is there
apt already has it as a package, apt install redis-server
yeah but it is good enough
apt has 4.0.9 and latest stable is 6.0.6 so yeah i guess if you really want to be up to date build it yourself
Hi 👋
May I know if i can ask questions here regarding Virtualbox + Xubuntu + python installation?
If it fits the channel description then I'm sure you can
Go for it.
Thanks
So I’m learning programming with python and try to use it in VM and Xubuntu 18.04. I had v2.7 as default version.
Then I follow a guide online to update to 3.8. And I ended up with 3.6 and 3.7 too. So 4 versions together.
I tried to install MU python editor and it didn’t work and I thought I have some many versions. And I deleted 2.7 then 3.6, 3.7.
I tried to google and reinstalled again everything. But nothing worked out. Went through Stackoverflow and AskUbuntu for similar problems, I tried different command lines, when someone said “this command line worked for me”. I tried them all,command after command and ended up in deep rabit hole, whenever I try to install something there will be different kind of errors.
So far when I do the following commands, they are showing like the following:
$ python bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
python3 --version Python 3.8.5
$ python --version bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
Does anyone know how to restore everything or the best way to install python again? Should I delete my VM and creat another one?
Sorry for the lengthy post 🙏
This is the latest time i tried
$ whereis python python: /usr/bin/python /usr/bin/python3.6m /usr/bin/python2.7 /usr/bin/python3.6 /usr/lib/python3.8 /usr/lib/python3.7 /usr/lib/python2.7 /usr/lib/python3.6 /etc/python /etc/python2.7 /etc/python3.6 /usr/local/bin/python3.8 /usr/local/bin/python3.8-config /usr/local/lib/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/include/python3.6m /usr/share/python /usr/share/man/man1/python.1.gz
$ which python3 /usr/local/bin/python3
I don't use Ubuntu but it was likely a bad decision to remove the default Python version
Typically, the OS relies on the default Python version for some features.
I think ubuntu doesn't rely on it, at least the base packages
It is a bad thing anyway
I suggest you start over with a fresh VM. Leave 2.7 or whatever the default is alone. Then, install Python 3.8 only.
You have several options to install it
- Build and instal it from the CPython source code
- Install it via a PPA (if I remember correctly, deadsnakes is the popular one)
- Install it via pyenv
Yep I learned it the hard way @warped nimbus 😦 and also found out something called Anaconda version and another one virtual...something can create a safe and isolated environment. After all this I will try to learn how to do it 😦
pyenv will also compile it from source
Anaconda is indeed another option.
If you're fine with having to install extra stuff (in the sense that, even if you use miniconda, you still have to at least install conda) just to get Python, then go for it.
Using a PPA is probably the simplest option
Yes today I also learned that Anaconda is little heavy and I don’t need many things there as a beginner.
Thanks god i use a VM , i can just delete it and make a new VM
Thanks for your help!
Ubuntu does not rely on Python, no. You did not need to make a new VM, but that works. The deadsnakes PPA is the quickest to update IIRC, right now it is on 3.8.
apt-apt-repository ppa:deadsnakes/ppa
apt-get install python3.8
Thanks for the input @heady shore , I tried apt-apt-repository ppa:deadsnakes/ppa too. The first time it worked, then I deleted all version I believe then installed again. When I type that again it gave me error that I couldn't find answer on google. People provide commands that didn't fix. So I guess I was in a big mess
How were you deleting said versions?
I couldn't remember but I was trying different commands and after I tested it didn't showup when I try python or python3 or python --version...but there was only 1 stuck there but it had many thing missing I believe 😦 I'm so noob and I deleted everything now. That VM has nothing important too.
so i made this little script to change my terminal colors from the shell: https://hastebin.com/uyihetumew.py
however there's a few things i don't quite like about it, maybe you can help me out here...
first of it outputs the data in a different order (seemingly random) than the original config.
secondly it only captures the actual data from the original config. any comments are lost.
these two things alone really hurts readability of the file and make it difficult to maintain/edit.
and lastly: isn't it actually horrible practise to be modifying live config files like this? i suppose i should do some form of validation before i write it back?
like the alternative i could think of would be locating the place in the config where these settings live, and replacing the raw text data, but it seems like there could be all sorts of things interfering with that approach
Not sure if this fits #tools-and-devops a bit more but I currently have a Manjaro + pyenv + system python setup on my machine. Would it be generally more favorable to install tools like pipenv and poetry using pacman in this case? afaik the shebang for said tools points to /usr/bin/python anyways so there shouldn't be any conflicts with pyenv
@ember isle pacman is fine yes. pipx is another option
It's good to keep these things isolated. however if you install any of those tools in your pyenv pythons, pyenv might install shims and things might get messy if you don't have system python activated in pyenv
Since poetry is a build tool there's a valid argument to be made that it should be version pinned per project anyway
Anyone know how this occurs?
Each newline of output has increasing whitespace behind it
It's spaces, not tabs.
i've seen weird shells do that before
This is in RXVT
ZSH + RXVT
I know I broke it somehow, but I'm trying to figure out how.
yeah, i don't use rxvt, so not sure how to help there. My guess is the way it's parsing \n characters, but 🤷
I broke the IO with a weird getch() I believe... Trying to replicate it
https://pastebin.com/Usn6GhpV
I get this error when running make test for redis
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.
hey guys, just joined. I'm trying to run a python script on startup on my Linux laptop. The custom command works perfectly, but the script's purpose is to print some information and startup commands run silently. Anybody know how I can make Linux open a terminal window for that script? I google this and I get a lot of the wrong question
You don't need to open a terminal on startup to do so; use a cron job
what is that
@livid vortex Open your crontab file by running crontab -e.
To run a script on reboot you want to use the reboot flag, so you'd add a line like this:
@reboot /path/to/your/script/
sorry could you explain what crontab is
It's basically a scheduler for your system. You can put entries in it that get run at specific times
I am very new to linux. Where would my script go in this example
First, you wanna edit your crontab file, run crontab -e in your terminal
Let me know when you've got the crontab file open in your editor of choice 😄
Before we continue I just wanna be sure we are on the same page what I'm trying to accomplish
I turn on the laptop, and a terminal window opens with my script running (I need to see the print statements, running silently serves no purpose for my task)
Ah, I see. You would probably have to use anacron to accomplish that, or maybe put it in your startup apps for your DE?
see I am so new to linux I have no idea what any of that is
Cron's @reboot runs on boot, it doesn't wait for a WM, so you probably wouldn't be able to open a terminal
Gotcha @livid vortex. What flavor are you running?
Elementary Os. I tried two things
Added startup line "python </home/user/documents/myprogram.py>
Made custom command that does the same thing
Both of these do in fact run my program (I had it create a file to prove it) if I call them on startup but the terminal does not open for me to watch it.
I'm a little surprised I can't just open the terminal with some text/command automatically pasted similar to a command line argument
What term is it? Most terms support that.
its just called Terminal, whatever comes default on Elementary
basically I need the opposite of executing a command silently (pop up terminal if none is open)
but since startup commands probably technically run in a terminal, just a hidden one, it doesn't make sense to need this.. I just thought it would be cool :( lol
could I accomplish this by installing a second terminal?
hi mans and womans
let's say I have a venv somewhere, and let's say I make a script that uses a module that isn't in the main global python but it is in the venv
would starting the script with #!/foo/bar/venv/bin/python work?
even if u haven't activated the venv?
@heady shore I got it; I installed gnome-terminal and found I can run commands when opening that
Welp tested it and it works
at least it can open load modules, didn't test it thoroughly
Sorry for not responding, had to attend to something @livid vortex. Glad you got it working! 👍
you were very helpful despite my replies lol
You might want to look into RXVT as well, that's my favorite terminal. Requires some setup but it looks great and is pretty handy once you get your config right
Cheers, happy to help
So I am trying to setup redis to work with my django applicationg in vagrant:
I am having troubles with the request taking too long so I am guessing I have it wrongly configured:
Vagrant seems to be running on 10.0.0.2
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('10.0.0.2', 6379)],
},
},
}
These are my channel layers,
In my vagrant file my guest is set to 8080 and host to 5656, I am not sure how I should run my redis-server
Could anyone help with that?
And vagrant is connected to 127.0.0.1
WebSocket HANDSHAKING /ws/chat/test5/ [10.0.2.2:61864]
WebSocket DISCONNECT /ws/chat/test5/ [10.0.2.2:61864]
The problems I keep having
I am not sure which ports/addresses I am supposed to change and what they do, if anyone could help I would be thankful, please tell me if I am posting this in the wrong channel.
Anyone here decent with Regex?
Let's say, my pattern was as follows:
s(al|en|end)
Works great for:
sal
sen
But for something like "send", it'll only pick up "sen", ignoring the better option (end)
You should be able to simply put end before en, or use s(all|end?)
@fresh saddle That was what I ended up doing, was wondering if there was a neater way to ensure en or end with a preference for the latter
How would I install a non-live version of Kali Linux using https://cdimage.kali.org/kali-2020.3/kali-linux-2020.3-installer-amd64.iso ? I just installed a persistence live usb of Kali Linux but it is not what I want. I want to be able to use the USB Stick on multiple computer as a normal OS.
As a normal OS? You mean, installing it?
The best you can get with everything on the USB is persistance
How about using another usb with the installer.iso on it to install kali on the other usb?
Probably something wrong happened when installing grub-install at the start of the process. @main olive
How to solve this?
Yeah i know there are some solutions on9 but i am noob in these things. Please help.
what is kernel development guys?
You mean who are they? All the maintainers are here http://lxr.linux.no/linux/MAINTAINERS
@main olive try opening a terminal and type sudo grub-install /dev/sda
Is it possible with ubuntu live mode because i have nothing left in my system?
@fresh saddle
Yeah sure
Hey, what's up?
Yeah i know there are some solutions on9 but i am noob in these things. Please help.
@main olive how new is your computer ?
had a problem with grub because of efi
which one ?
System got freeze everytime while i am using it
Or everytime when i am updating nvidia graphic driver ... Thts also a headache.
@fallow mist
might be a hw issue
so i'm trying to use gnu screen in order to run a program on a remote server through ssh, but it would always seem to time out or something after a few hours, is there any way to stop that so that it keeps running?
@ me if you have an answer
Its not screen timing out
its the program itself
Just make a bash script that loops running the program
alias junglejim="TMP=$(mktemp -d);cd $TMP"
I also enjoy these for obvious reasons
alias venvinit="python3 -m virtualenv venv"
alias venvact="source venv/bin/activate"
I'm sure you guys have some clever ones
This one is neat
# Generate Output and the pipe to `{cmd} | pastedump`
alias pastedump='curl --upload-file - "https://paste.c-net.org"'
I also enjoy these for obvious reasons
alias venvinit="python3 -m virtualenv venv" alias venvact="source venv/bin/activate"
@main olive there's virtualenvwrapper for these and some more features
I've heard of that but havent looked at it yet.
hello everyone
i currently have a command line tool
and i want to make sure that a command doesn't work if a user hasn't run a command before
for example
package_name supercharge
and only if they run that command before, this should work
package_name superpower
well, command 1 could create a file (via touch probably)
and command 2 only goes forward if that file is present
or set an env variable
so you get a state
https://www.reddit.com/r/Python/comments/ikiqsu/turbocharge_dawn_of_a_new_era_for_package_manager/
Check this out, it's really amazing!
thanks
Tampoco hablo ingles mucho :3
https://www.reddit.com/r/Python/comments/ikiqsu/turbocharge_dawn_of_a_new_era_for_package_manager/
Check this out, it's really amazing!
@thorny sage Are you telling me what this is?
Yeah, just check out the post and that explains it all @main olive
Yeah, just check out the post and that explains it all @main olive
@thorny sage bien ya lo veo muchas gracoas
gracias*
@main olive would you mind checking it out
It really is an excellent package manager
well already I see what it's about
It really is an excellent package manager
@thorny sage
Are you interested in checking it out @main olive
I developed it all on my own, and I would appreciate any feedback
If you would want to contribute please DM me 🙂
If I fit it and give you comment on this, for me it would be an honor to be able to help you in your development and make it more appropriate for the user.
@thorny sage this is like Homebrew? how does it automatically update your PATH without modifying an init/rc file?
what does this mean?
Last but not least. Turbocharge apart from being able to install packages also installs applications! It also tests the command line equivalent for the applications and launches the applications quietly in the background for you, making sure that they work too!
the package installers are hardcoded into the python source?
this is an ambitious project and i admire your enthusiasm. i recommend taking a look at how Homebrew is designed
@thorny sage reddit post's link got removed
@thorny sage this is like Homebrew? how does it automatically update your PATH without modifying an init/rc file?
@formal schooner i have completely updated the code, and it's not hardcoded anymore. With the suggestions of a friend, I have changed the code and now we can add more packages into TurboCharge with ease. Most applications have a command line equivalent to them in Linux, including Opera and Visual Studio Code, which allows them to be tested for installation : ) .
@opaque ginkgo yeah, sorry about that : (
@main olive absolutely. I would request you to dm me so we can see how you would like to contribute : )
Guys if anyone over here has experience with distros of Ubuntu which don't use apt is the app installer, and would like to contribute to a package manager in the works, please dm me
@thorny sage distros of Ubuntu that DON'T use APT don't exist. All Debian derivatives use APT.
exactly, thats why i am working on support for pacman and stuff
but for now, we have a very small dev team, thats why I am requesting
Now, distros of Linux that don't use APT, different story (yum/dnf for RHEL derivatives, pacman for arch derivatives, zypper for OpenSUSE, etc...)
yes @viscid sage would you be interested in helping out extending support to these other distro's? We have a very small team at the moment, and it's rather hard to do so much
if so, I would appreciate it if you could DM me : )
I love the enthusiasm, but there are already a few projects that are just shell script wrappers (see ansible).
checked out ansible, so is that for making it compatible with all the distros of linux?
Huh
it's a development tool right?
we are also working on multithreading, so in that way, you can run multiple instances of turbocharge unlike homebrew
Ansible is a system configuration management tool developed by redhat
But also, you can't multithread APT considering you can only have one active instance of it running at a time.
correct
we have found a workaround
i would not prefer to say here though if you understand : )
I don't understand because your code is public, so it's an unnecessary hoop I refuse to jump through
would you mind dm me @viscid sage
No thx
cool
thanks for the ansible suggestion : )
i appreciate that
has anyone here installed the turbocharge package manager?
hey guys do you know how to solve this error in linux
user is not in the sudoers file
i got some thing like that
yeah, you need to add yourself to one of the groups that are allowed to do sudo
@muted sandal
dude that thing is like i cant sudo myself or root
first su - then cat /etc/sudoers, look for something like the SUDO or WHEEL or ADMIN group, once you know that group, /usr/sbin/usermod -aG <GROUP> <USERNAME> && exit then newgrp <GROUP>
icant sudo itself
right ... su - or su root changes your user to the root user
then you can do root things, like add your user to the sudoers file lol
icant su root also
what error?
sounds like you are using your user password rather than the root password
mm what to do then?
either use the root password, or you are going to have to reinstall or do a root password recovery (which isn't fun)
it's well documented
if you don't want to go through the trouble of reading them, just use Manjaro
manjaro is "arch made easy"
same thing as arch, except they provide an installer
still uses the AUR etc...
i dont' personally like arch distros BECAUSE of the AUR
but that's just me
AUR?
Arch User Repositories
the AUR is a software repo wereby any user and submit a package to it ... and there have been a number of cases where some of those packages are malicious
and a number of cases where they are just broken
yes
dude will you help me learn linux
i learned the basics and more
but i need to master that man
some how
i dont get some thing specific help in that
u seem like a pro some how
lol ... i've been using *nix for like, 20 years, so I guess i'm ok with it
my first PC OS was RHL back in '98
what age are you
32
oh my god
you started linux in 10 year old
you are really great
ok man
how to be pro like you
lol ... i lucked out in having a close family friend that did tech
well i am not that luck to be like that man
some how with your experience can you teach me man
atleast say what should i do
my advise is to use it, and then learn the things you run into trouble with
you said you learned the basics, so just use it
and generally ... find a distro that you like and stick with it
there will be times you need to cross over, but generally, the differences are minimal
Personally, I use Fedora
whoa greatman
dont mind me asking this one
will you accept my friend request
you are some how great man
but mostly because most of the work I do is on RHEL/CENTOS systems. If I was mostly working on DEBIAN/UBUNTU, then I would go that route, if work used SUSE, I would run OpenSUSE, etc...
i never had support like you
i never had support at all man
youspeaking here its like a legend bro
that is what this room is for. I would rather not take these discussions offline because you probably aren't the only one that can benefit from them
that is some matured one bro
i really inspire you pal
i can imagine how you are great in coding stuff
been around the block in that realm too
when i become 32 i want to be more than how pro you are now man
does a curses related question fit here?
curses?
curses library
i dont know that one man
i am sorry after all i am just a noob
@viscid sage hey so for now where to head next man
i kinda heading over to linux sys admin and then linux system programming man
is that ok?
@warped wing probably, what is the question.
@muted sandal seems like a good path to me.
For sysad, take a look at the CompTIA Linux+, LPIC I, and RedHat RHCSA certs @muted sandal
thats the code
and my problem is the arrows do not work
i managed to locate the issue
after i stdscr.move(new_y, new_x) i clear the screen so its discarded
i think i need to make t change the y and x and then when it prints the contents stdscr.move(y,x) as well
i think this solves this issue
where can i get help of vps?
can i make curses disable ctrl-j and ctrl-i?
because they do some funky stuff
and id like them to have different meaning
So if I have a Chromebook with chrome os
That's managed
If I copy the os, then eventually reinstall it back, will it save the fact the device is managed?
where is the windows channel at
@fleet forum you probably won't be able to boot from a different OS at all. If you could though, it would depend on how you copied the OS
No because generally they lock down the mechanisms used to boot into another OS for security and integrity purposes
If it's like a school Chromebook, then unless your IT department is completely incompetent it should at least be more than trivial to get another OS booted
IT department?
What's that
Nah we have no IT department. The government just send out butt tones of Chromebooks and I'm tryna figure an easy way I can play play Minecraft and stuff the last couple days without bricking the Chromebook
It's essentially a manager device that's it
So like if somehow I can copy the managed device os and then replace it, it would be great
@fleet forum no you can't, they are managed via MAC address. As soon as your new install of chrome came online, it would be managed by the same group again
If you installed a different OS tho it would work
Developer mode will probably be disabled though
Hey guys, can we run a Linuxmint application on Ubuntu??
do you have an example? there aren't many Linux Mint application if at all, most of them work across all linux distributions
I don't think that will not work on Ubuntu unfortunately, it's developed by the Linux Mint team to work on the Linux Mint distribution
@fleet forum no you can't, they are managed via MAC address. As soon as your new install of chrome came online, it would be managed by the same group again
@viscid sage oh great, so if I wipe the Chromebook, install a different os and then reinstall chromeos, it'll become managed again?
Your Mac address won't change, you'd have to temper it
Which is think is behind rule 5 at this point
@robust cave so it won't work on Ubuntu?
@robust cave so it won't work on Ubuntu?
@green iron you can try, but there's no guarantee, especially since the actual program itself is in beta
Oh, okay
I got an error
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace XApp not available
Yeah, it looks like a distro error
hello. I recently switched laptops and installed Arch in it with dual booting
my issue here is that I didn't have an audio manager, so I installed pulseaudio by instinct
basically my issue is that it's not really making any sound, both channels are muted and I can't get any sound of it, like if I pressed the mute button that comes with the laptop
any idea of what could be happening?
what are you using to control pulseaudio? is your mute button on the laptop properly bound? (ie. if you're using a window manager rather than a desktop environment, chances are you have to bind it yourself)
I use pulsemixer (CLI tool), mute button is F1 on a Thinkpad T495
but it's crazy; I think that since I installed GNOME on the older PC it had it bound automatically
so you have GNOME running on the thinkpad?
either way, take a look at https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting and see if any of the problems apply to you
so you have GNOME running on the thinkpad?
@robust cave I expressed wrong; I HAD gnome on a Compaq laptop
hello, is it a good practice to export variables in bah scripts? I'm affraid of cluttering my system with that, or having a name which would name a variable used elsewhere
I fixed the issue; didn't have my user on the audio group
@frank coral export is the command to create an environment variable, which will be passed down implicitly by processes descended from the one you run it in. You should only export something if you need to share it with child processes.
Ok, thank you for you answer @summer trail So what's the difference between exporting and creating an .env file? If I export variables manually in the shell, are they lost If I close it?
Yes, they are. They're only inherited by child processes.
uh hope this isnt in the wrong channel
what do i use for variable command line args in python? say suppose $ ./script.py file1 file2 ...
i can use argparse for fixed number of args, but how do i take in variable number of args with it? did i miss it in the docs?
irrc, you have to specify in nargs parameter
I've got a small Linux problem if anyone can be bothered to help. First time using Linux and I've got absolutely no idea how to set new env variables.
Usually on windows you could use the GUI
Tried to enter ~/.profile on the terminal but it says permission denied
export NAME=some/var/value doesn't work either since os.environ.get() returns nothing
what are you trying to set? if it's application specific you could try https://github.com/theskumar/python-dotenv
I am trying to set username and password for the site
and an api key
so they're not hard coded
ah yes that's exactly what dotenv is made for
So linux itself can't do that?
Guys how can I change my snaps location?
It saves everything to /snaps whereas it should save to /home/username/snaps
lemme try ]
see if it allows you
why do you want to install in home dir?
coz i dont have much memory in root
like 2 GB left
whereas home has 28
I installed linux just for fun
i doubt if you can even do that
i doubt if you can even do that
@remote tapir I believe i can, it is linux
ok Linux is driving me crazy. How do you people deal with this?
I keep changing VSCode's python path to /usr/bin/python3.8
keeps reverting
everytime I run the code
@main olive i don't use vscode, but this sounds more like a vscode issue than a linux issue specifically
is there some setting box where you choose the path for the current python?
and it keeps changing to something else? or are you getting errors?
teh path doesn't change. It's as if vscode just ignores it
that means there's no python in /usr/bin/python. Here's what you should do:
type which python in the command line, then copy paste the output into the python interpretor box in bottom left. Thats will set vscode to use the global python installation.
~/Documents/Python/ms-train$ which python
/usr/bin/python
if you need to use a virtual environment, you need to first create a virtual environment, then activate it and then follow the above steps
Yeah it still recognizes python2 instead of 3
~/Documents/Python/ms-train$ which python
/usr/bin/python
@main olive do you have a setting.json file in the current directory? Normally, when you change the settings for a specific workspace, vscode creates a folder called.vscodeand places settings inside it
Yeah it still recognizes python2 instead of 3
@main olive typewhich python3then
Yes I do
I haven't written a single line all day cause of this .-.
I tried with which python3. Put the path in the interpreter selector
Still python 2 lol
@main olive do you have a setting.json file in the current directory? Normally, when you change the settings for a specific workspace, vscode creates a folder called
.vscodeand places settings inside it
@molten wedge also to confirm that vscode does change the location, you should opensettings.jsonand then confirm that there is a line which says something like"python.PythonPath":"your/location/python"
I haven't written a single line all day cause of this .-.
I tried with which python3. Put the path in the interpreter selector
@main olive how about global workspace settings? you might have a python path specified there which could override the workspace specific settings
Sadly no. Either way, I'll just switch to pycharm lol
that's very weird. never seen that problem. well i hope pycharm works for you. good luck!
Pycharm always works ❤
Guys, does anyone have any experience with Arch Linux and specifically archiso? I need some help related to it.
@molten wedge perhaps. What’s your issue?
@lament night When i make an unmodified arch iso with the baseline configuration, I am unable to make a live usb while the releng profile works fine. this leads me to believe that there's some stuff in the baseline profile that makes it work out of the box. Which one do you recommend using - baseline or releng?
and another general Unix question: Why do some distros have wifi working out of the box while some don't? for example my wifi drivers work with Ubuntu. in arch linux, I have to do a simple systemctl enable NetworkManager and it starts working. however in Manjaro, I have to download a bunch of drivers from github and enable them using dkms etc which takes a long time.
So my question- Why do some distros come with wifi drivers pre-installed and others don't?
The single biggest difference between distributions is what they decide to provide packages for and what they decide to install by default. Some distros won't include anything in an official package repository unless it's FOSS, others aim for usability over purity.
that makes sense, thanks! @summer trail
Hello guys, i am fairly new to this so bare with me I have 2 AWS Ubuntu instances that I want to create a privet_pub ssh key for each one of them so I can ssh from one to the other , I did that and generated the key and used the ssh-copy-id and have both of the public keys exchanged but when I try ssh user@host I get Permission denied (publickey) response, any help would be appreciated.
@pure folio if your private key isn't in the default location you need to specify it with the -i flag
@static cosmos thanks, for the answer, I did that but is there any way I can do it with out the flag ?
For automation
Put it in the correct location
~/.ssh/id_rsa
But nothing stopping you from hardcoding the location also
What are you automating with ssh?
@static cosmos thanks for the help just a script that performs some basic bash commands between the two instances
It's ok to set env variables in venv/bin/activate?
I have never seen anyone do that. I think it's a bad idea since other developers working with you won't be able to replicate the same environment since they will have their own different activation script.
and how to hide variables instead of typing them in code? i try to modify ~/.bash_profile but there if i try to get them i get None
I think you need to write them in ~/.bashrc. However if you are using python, there's an easier way to hide these secrets
https://simpleisbetterthancomplex.com/2015/11/26/package-of-the-week-python-decouple.html You can also use this tutorial. it's the simplest way.
Thanks, i will take a look
does anyone use rsync there? I was told to use it instead of cp but I am noticing a very sad inconsistency with it.
I am trying to copy a large 40+ GB file yet the output file has a bit different size
therefore a different checksum too
how are you using rsync?
How to enable tensorflow ROCm in distro Manjaro?
@robust cave always with -a option
sometimes --progress too
but its all
it cant be any file system file flags like creation date and so on
these arent part of the file
so i have 0 clue why is checksum being changed
could it be because of file extension though i doubt rsync would care
how are you checking the size difference/checksum?
you might want to take a look at this https://sanitarium.net/rsyncfaq/#differentsizes
md5sum is how I was checking the file sizes
I read the link you posted
the likely cause is a difference in directory sizes
is there any source where I could read more about that
I am surprised the information about directory where the file is located would be incorporated into the raw file itself
arch is a pain in the ass to get set up, I've spent hours on a vm trying to get it to work
um hey
idk if this is the right place to ask
but one of my lecturers recommended redhat linux for our classes
and that stuff isn't free and i was wondering if i was worth buying for classes, especially since its just for one semester and i already have linux mint booted in one of my laptops permanently
I don't see why anyone would buy any linux distro but if it is a requirement, then you don't really have a lot of options right? @surreal jewel
its not a requirement that's why i was asking
i already have one i installed in my own time, and when i asked her she told me to use redhat for one of the subjects that we were doing
well if I were you, I wouldn't. Don't see why someone would buy any linux distro
thanks man, thats what i was thinking too
Red Hat is designed for enterprises and businesses and you pay for reliable technical support and bug fixes ("backporting")
The upstream distros from redhat are CentOS and Fedora
Fedora is designed to be used by typical users as a desktop OS and not as a server
I highly recommend giving it a try, it's installed on one of my laptops and is generally a reliable system
@surreal jewel
Is it possible to turn my old android 4 tablet into a linux system?
I have rooted it.
Hello, how do we load library functions source code in gdb?
Like , I want to load the source code of malloc written for glibc 2.30 into gdb , for debugging purposes
how to download linux in python?
sorry
how to python in download linux
wth?
how to remove python from linux
😳
well then do you want to remove it or install it?
how to remove python from linux
@main olive I don't like that decision Linus, we want Python support in Linux, don't take it away
Is there any server dedicated solely to linux support?
i dm'ed them, no worries
there is also a partnerd server for linux: https://discord.gg/discord-linux
So I am working on my first real python program and I am wondering how I specify the home directory in linux
~ is the home directory
ty
@main olive what distro
@main olive sudo pacman -S python or sudo apt-get remove python
guys, anybody can help me with ubuntu server?
yeah i can try @fathom harness
oh, Thanks!
i'm really a newbie
first week on linux
took an old notebook of mine to make a server
downloaded ubuntu server 18.04
installed in a vm
it's up and running
i an struggling on configuring ftp
do you have experience at it?
how can i see my ip address?
ip a is showing some inf
but when i try to connect via filezila it's not working
well tbh i dont really know how to do this @fathom harness but I can guide you to appropriate resources
i mean
it's already done
i guess
haha
but how do i get the ip of my server?
ifconfig -a is showing an address
on enp0s3
How to Check IP Address in Ubuntu Linux [Quick Tip] - It's FOSS
itsfoss.com › Tutorial https://www.google.com/url?q=https://itsfoss.com/check-ip-address-ubuntu/&sa=U&ved=2ahUKEwiEv5nb_tXrAhXnzDgGHWzGCJkQFjACegQIBxAB&usg=AOvVaw1ITL8QoSIkmjZrh7yN8Cbk
isn't this what you want?
i mean, i can see the ip "inet"
it's 192.168.10.8
but when i insert it in filezilla
it does not work
maybe consult Filezilla docs? Yhey will probably have a step by step guide
Hi, not sure if this is a python question per se, but I'm trying to write a command that opens up xfce-terminal and runs a python file, here's what I have so far:
xfce4-terminal -e 'python Downloads/Robovish/RobovishMK2.py'
now, the terminal opens, but upon opening, I'm greeted with this error
would anyone be able to help?
Try using the full path to the python binary
ooh i should've tried that
actually i dont think thats the problem
because when i open xfce
im in my user directory
and then its just Downloads/Robovish/RobovishMK2.py to the file
unless im misunderstanding
I believe it's saying that it cannot find python itself, not that it cannot find your script
You're welcome
can someone help me. i installed ubuntu but ment to get kali and need to get windows back. i used the sudo dd command on a normal usb stick but when i restarted my pc it didnt give me the option to choose windows.
im new to linux distros
god, didn't managed to make it work
i'm like 8 hours
trying to make this ftp work
nothing
can someone help me. i installed ubuntu but ment to get kali and need to get windows back. i used the sudo dd command on a normal usb stick but when i restarted my pc it didnt give me the option to choose windows.
@frank estuary you will probably have to have to disable safe boot in your bios setup. basically press F5, F10 or F12 (different machines have different key bindings ) while your computer is booting up. then find something which saysSAFE BOOTand disable it. Maybe that'll work.
Another way you can try is searching up "how to disable safe boot on <laptop name>" on google. You'll probably find answers
trying to make this ftp work
@fathom harness did you try this? https://wiki.filezilla-project.org/FileZilla_Client_Tutorial_(en)
i dont think you need the ip address at all
okay ill try it out
Hi, how to generate timestamp in this format: 2019-08-30T14:56:08.069Z
You can do this easily using python strftime @vast pine
@molten wedge hey! i'll try it later!
the tuto makes sense, i'll just finish my worktime and go to the server again, thank you!
@fathom harness yeah np
@fathom harness How is the VM getting internet?
can you show me the network adapters page
in its settings
Actually think its just network
You shouldn't need to
I would just set the network to be bridged with your normal network adapter
rather than through a NAT
that way it's just another device on your private network, with its own IP
Why not just install a server OS on it
There's a hacky way to do it without one with raw disk access but you can potentially corrupt your original OS if you do it wrong
Yeah It happened
Installing kali
I managed to make my Windows work again
Is that It?
@static cosmos
Yep
NAT means the VM is on a seperate network, with your host acting as the router between them
you want to select bridged adapter
and then the network adapter you use
@fathom harness
Should i use the adapter from the host PC?
the adapter you are getting internet through yes
yeah, i guess the network part is ok
now i'm editing that sftpd.conf file again
i can connect trough my server, but i'm not managing to connect via my notebook
@static cosmos do i need to open any firewall port on my notebook?
all the ports are opened in the ubuntu server
No it should be completely seperate
@fathom harness Can you ping from your notebook?
i guess i can
but when i ping the address
ok, i do:
ping 192.168.25.8 (the ip of the ubuntu server)
the response is
ping to 192.168.25.4 <- why 4?
oh, actually it returned a ping
stats:
sent = 4
received = 4
loss = 0%
is it good?
but it says that the host is inaccessible
paste the output of the ping
can you screenshot an ipconfig on the windows machine and a ip a on the ubuntu server?
ok, but your internal IP's don't mean anything to anybody not connected to your network
guys is it possible that some laptops cannot boot from usb at all? I have this 10 year old laptop running windows 7,and it works fine but I cannot get it to boot from USB at all. The BIOS menu is quite different from what I am used to as well.
I want to install fedora on it just for fun but since it doesn't boot up the live usb at all, it doesn't work :/
the live usb itself is fine, I have checked on other machines already
You may have created a UEFI-only live USB. An old machine like that wouldn't support UEFI. Ensure your live USB supports BIOS/MBR
is the default arch linux is UEFI only? @warped nimbus
Arch? I thought you're trying to install fedora
In any case,I don't know what the live CDs support
I don't know,I never used it
can anyone help changing resolution in arch linux kde running in vmware as guest?
it changes but reverts back to default resolution after a split sec
In my experience, the cd image will support both and it'll just depend on how you configure the tool you use to write it to the USB drive
i created the archiso usb using dd
@icy flicker I have the exact same setup and no issues. Have you seen the wiki page on using arch ad a guest on vmware? There are some packages you need to install. They take care of the resolution for me
@molten wedge it should support both, but try the stuff in this section https://wiki.archlinux.org/index.php/USB_flash_installation_medium#Other_methods_for_BIOS_systems
ill try this, thanks @warped nimbus
@icy flicker I have the exact same setup and no issues. Have you seen the wiki page on using arch ad a guest on vmware? There are some packages you need to install. They take care of the resolution for me
@warped nimbus are you talking about the vmtools?
Yeah but there's also some stuff for X if you're using that as your wm
@warped nimbus hi, are you talking about this? https://wiki.archlinux.org/index.php/VMware/Install_Arch_Linux_as_a_guest#Xorg_configuration
Yes, I was
There's also a "Window resolution autofit problems" section
@icy flicker
@icy flicker
@warped nimbus hi! i wasn't talking about the autofit problem. i was asking about changing the resolution of the guest within the guest. :--(
why can't you use a normal email client? @vast arch
gmail, yahoo mail type things
i have the domain, i have my website, i want to setup my own email server for it.
@vast arch that's no easy deed. You wanna make your own email service like Gmail? that's an entire project by itself and not the best idea too
just use what the industry uses, Gmail if you're going small, sendgrid etc if you are going big
talk to whom?
yeah i understand
trust me implementing your own email service is no small deed
it will sidetrack you from your present project completely
so far ive found iredmail
@vast arch yep use their service, if they provide a free one that's even better
oh that way
yeah many do
idk about them myself
but you can start with smptlib
you will be better off sending automated emails with python
much easiesr that way
well then i helped you as i could
otherwise I'd just copy paste the gmail address into the "to" bar and be done
I don't think anyone really cares
but yeah it could look a bit unprofessional
They are correct. Setting up a mail server is a lot of work if you're doing it from scratch, especially if you have no prior experience.
I know of a Docker image that can run a mail server https://github.com/tomav/docker-mailserver
I don't think it has any sort of web interface though
I imagine you could set up a web interface on top of the server once you get the basic server running
@vast arch i just use fastmail w/ my custom domain
at which point all you need to send emails is a sendmail implementation like postfix
Hello , I've been trying to create a basic listening socket which would act ask an nginx-socket proxy and for this , I create a file named ,nginx-proxy.socket in /etc/systemd/system with the content ```[Socket]
ListenStream=80
[Install]
WantedBy=sockets.target```
I've also created an empty container using nginx official image with docker create --name nginx8080 -p 8080:80 nginx
now when I try to start the ngnix proxy with systemctl start nginx-proxy.socket , systemd logs say ```nginx-proxy.socket: Socket service nginx-proxy.service not loaded, refusing.
Failed to listen on nginx-proxy.socket.
Im kind of new to this , so Im really not sure if I;ve missed something trivial , can someone give an insight into this?
hey guys, how you doing
i was here some days ago to configure my ftp server, got help and now it's fine,
now it's working nicely, i've installed ubuntuserver 18.04 in an old notebook's vm, the notebook has 2gb ram, 1gb is dedicated to the vm, what can i do with this?
i want to format this old notebook soon, i'll put ubuntu desktop in it, but what can i host in this server? :x
music files?
@tender plinth I dont understand how that container plays into this
Do you also run it?
because nothing screams professional like an
@gmail.com contact email
@vast arch rofl @ random ping.
I use this: https://mailu.io/1.7/
It's not that easy to set up if you don't know docker, but it handles essentially everything.
now when I try to start the ngnix proxy with
systemctl start nginx-proxy.socket, systemd logs say ```nginx-proxy.socket: Socket service nginx-proxy.service not loaded, refusing.
Failed to listen on nginx-proxy.socket.
@tender plinth sounds like it failed to bind to the socket on port 80. Did you run it as root? (sudo)
Also, check that nothing is already bound to that socket (ss -lt)
guys does someone know how to use dlsr cam as webcam in linux?
i am currently using linux mint
@tender plinth I dont understand how that container plays into this
@main olive the aim is to load the container on demand using systemd , like whenever a connection is recieved , only then the container should spin up
@tender plinth sounds like it failed to bind to the socket on port 80. Did you run it as root? (
sudo)
@hollow venture yes everything is run as root
Also, check that nothing is already bound to that socket (
ss -lt)
@hollow venture yes I also make sure that nothing is running on that port , I've even updated firewall rules
Interesting. In that case, no idea. Never really worked with systemd sockets.
the aim is to load the container on demand using systemd , like whenever a connection is recieved , only then the container should spin up
Wouldn't that add considerable delays to every connection?
Spinning up a container for each and every request would be impossible, yeah
Wouldn't that add considerable delays to every connection?
@hollow venture but that is an idea way of utilizing resources by keeping only the currently used ones active, the thing is , our services are not very huge ones and the requests we expect wouldnt be more than 20 concurrent at a given time
Spinning up a container for each and every request would be impossible, yeah
@fresh saddle No the idea is , spin up one container for the first request and use it for all subsequent requests , and when all connections have been stopped , the container would be brought down
else , we'd be high on resources/bills if all containers keep running year long
here's what I was going through in case u find it interesting https://blog.developer.atlassian.com/docker-systemd-socket-activation/
linux mint users, does discord work just fine in your system?
coz it crashes sometimes
It also crashes in mine (latest mint) but only when using a lot of functions
Is it possible to have ~/Projects and ~/PyCharmProjects have all of their contents recursively merged into ~/projects without complicated use of symlinks for every file?
Like... the contents of those dirs still exists and are there, but the all projects dir is just a path I can navigate to and enter commands, giving me info about all the various projects in my "PROJECTS_PATH" you might call it.
@main olive you can use overlayfs to accomplish that if you're on Linux.
how do i add a variable into env table (arch linux) with lots and lots of characters eg. ~&$%^(
cause it tends to have the habit of cutting off at points which hampers my ability to add this
I'll look into that. @summer trail
@wild kraken env table?
those things doesnt seem as effective for special characters
where i am trying to add the variable at ~/.pam_environment
however i am currently using an alternative of swapping special characters with regular ones
right, I have a problem. I'm running a discord.py program on a raspberry pi running python 3.7.3 and I can't seem to set the environment variable for the discord api key so that os.environ["key"] can find it. Help

oh nevermind I was stupid and didn't execute the program in the same enviroment
@wild kraken ah, the escaping for that file is messy. it's not parsed by a shell or anything, it's parsed inside PAM itself. the spec is here https://linux.die.net/man/5/pam_env.conf
The /etc/security/pam_env.conf file specifies the environment variables to be set, unset or modified by pam_env(8). When someone logs in, this file is read ...
you have to escape $ and @ at minimum
so much archaic linux tooling out there...
hey guys uhm I know that's not the place where I should ask, but on my arch linux system I can't seem to connect to a local smb1 server
thanks saltrock for the answer c:
Python help: Available
What is echo $?
What is echo $?
@lavish hemlock prints the return value of the last statement you executed.
$ false
$ echo $?
1
$ true
$ echo $?
0
(It may sound counter-intuitive, but false is non-zero and zero is true in return codes, by convention)
What are you using
@lavish hemlock it's bash shell (or some other shell).
Ok
I also use bash
But it doesn’t append a $ to each line
Only user@host the PS1 environment variable
maybe that's just your bash theme?
PS1 formats the bash prompt, yes.
You can customize it: https://wiki.archlinux.org/index.php/Bash/Prompt_customization
Hello, I sometimes see in job offers that they require basic familarity with linux? How much is there to learn? Which distro would you suggest for complete beginner? I was trying sometime long (like 10 years ago) ago fedora or mandriva but was too used to windows.
@cursive walrus Ubuntu if you're a beginner
thanks. Can you also tell me how different is programming on linux with python apart from different paths and sings "" "/" folders? Is a whole different beast or you just do few adjustments?
tbh it's very different according to how deep you wish to go. But basic commands kinda remain the same @cursive walrus
for eg windows cd remains the same.
dir becomes ls
thanks @molten wedge , i assume it's best to check with my own eyes than ask questions 🙂
yeah
another thing you will notice right away will be passing options
for eg windows shutdown /t
will become shutdown -t
btw shutdown -t is not valid option i think but this was just an example @cursive walrus
yeah np, thanks for help anyway
How long do pm2 processes run for
Hello,
Does someone know how to really clean a terminal? Not using the clean command which only put previous results out of the screen, but deleting them from the terminal. It's tedious when debugging with programs with long output not be sure you're looking at the latest attempt. I've seen reset but id does nothing for me (mac OS)
