#unix

1 messages · Page 1 of 1 (latest)

wet folio
#

Hi guys, anyone can help how to fix this issue on my vim terminal. I tried to find swap file, but I can not locate it. I used ls -alh * but did not find swap file:) any help please

#

When try to save the file, it shows this, But I have enough space in my storage:)

wet folio
#

bash: cannot create temp file for here-document: No space left on device

#

not sure, suddenly my terminal not working as it does before:)

fallow tusk
#

Where is /tmp located? It is looking for space on that partition, I assume

#

df -h /tmp

trail sapphire
# wet folio

that is ram and swap, in other words memory, not disk space

trail sapphire
# wet folio

instead of running free, run df -h . to see disk space for the device that the current directory lives on

wet folio
#

Thanks. I removed some files and dir, now it able to make it work

frosty depot
#

also i would suggest using fzf to find files instead

muted halo
#

hi
ive got the latest os for my raspberry pi 3

ive set up my wifi adapter like this https://www.youtube.com/watch?v=oM2kAnITNyE

im not sure its being used over the internal antenna bc:
-i still see the wifi signal in the task bar
-when i do ip -br link wlan1 doesnt show instead i see wlan0 is up
-when i did iwconfig i see the same thing before and after rebooting (that it is connected to the desired wifi)

wet folio
tribal pelican
trail sapphire
#

@fast stag start by checking your routing table with ip route and then try to ping -n 1.1.1.1 and ping -n 8.8.8.8 and see if you got basic routing and reachability

peak badge
#

Hello, I'm trying to use WSL with archwsl, but my neovim is not showing icons in telescope or with the lualine, does anyone knows what am I missing?

lavish storm
#

you need a font that supports those glyphs

#

look into nerdfonts

peak badge
#

Great! but how can I install that on archwsl? I mean I know how to do it on windows... just go to releases pick a .zip that you want and just double click the font... but on archwsl how do I install it?

lavish storm
#

(as WSL)

peak badge
#

yes!

lavish storm
#

the README in that repo i linked above offers some options

#

you can either use install script, or use AUR

#

if you are nitpicky, you can always patch your own

peak badge
#

Thanks a lott!!

lavish storm
#

let me know if you have any hiccups

peak badge
#

mmm it didn't work

#

However I can see the font on the folder

#

it also has this config file

#

however my ~/.fonts file is empty?!

peak badge
#

added more fonts and ran fc-cache -f -v but it didn't work either... :/ maybe is just the WSL, thanks for the help anyways

lavish storm
#

not really a Windows user so i might've missed a detail

peak badge
#

I'm running the windows terminal

lavish storm
#

ah

#

you ought to install the font on Windows then

peak badge
#

but it works on powershell

lavish storm
#

and then select the font accordingly on Windows Terminal

#

hmm

#

powershell is a type of shell, not a terminal emulator

#

let me check if it's a Windows TErminal issue

peak badge
#

nvm, that was my issue!!! omgg XD

#

I was doing a clean install again and forgot to put the font on the windows terminal settings

lavish storm
#

ah!

peak badge
#

now its showing the icons

#

Thanks a lot my friend!

lavish storm
#

❤️

frosty depot
peak badge
nocturne trout
trail sapphire
#

you probably want the rm -f file1 to be rm -f -- "$1" and that the other strings that $1 is used in should also be inside double quotes

#

the dubbel dash marks the end of the command options to a command so that whatever comes after will always be treated as a filename even if the value of $1 would start with one or more dashes

#

i think that should work 👍

#

but do you want testdir to be static like that or another parameter to the script

#

then it's probably fine as it is

main olive
#

hey, can anyone help me writing a script that runs on a .log and calculates average time?

trail sapphire
trail sapphire
steep sequoia
#

^^

ember quiver
hasty prairie
#

Hey guys

#

I try looking up this error, but I can't understand it from a theoretical standpoint. Coould anyone please help?

#

@ me if so! ❤️

opaque ginkgo
#

it means you're missing a library for running python itself

#

what distro? @hasty prairie

flat echo
#

I am trying to troubleshoot my flask app deployment on centOS7 using gunicorn and nginx. This is the entry in my nginx log for a request to login page: 2022/07/27 09:59:46 [error] 23436#23436: *9 open() "/home/adankert/archives_app/archives_application/static/main.css" failed (13: Permissio n denied), client: 128.114.223.157, server: 128.114.128.27, request: "GET /static/main.css HTTP/1.1", host: "ppdo-dev-app-1.ucsc.edu", referrer: "http://ppdo-dev-app-1.ucsc.edu/login" 2022/07/27 10:00:01 [error] 23436#23436: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 128.114.223.157, server: 128.114.128.27, request: "POST /login HTTP/1.1", upstream: "http://[::1]:8000/login", host: "ppdo-dev-app-1.ucsc.edu", referrer: "http://ppdo-dev-app-1.ucsc.edu/login"Permissions for that main.css file are full:-rwxrwxrwx. 1 adankert nginx 1182 Jul 20 10:25 main.css...and this is the nginx.conf file: ```
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   65;
types_hash_max_size 4096;
client_max_body_size 500M;

default_type        application/octet-stream;
include             /etc/nginx/mime.types;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

}```

#

...and my nginx app conf file (archives_app.conf):```
server {
listen 80;
server_name 128.114.128.27;

location /static {
    root /home/adankert/archives_app/archives_application;
    }

location / {
    include /etc/nginx/mime.types;
    proxy_pass http://localhost:8000;
    include /etc/nginx/proxy_params;
    proxy_redirect off;
    }
}
inland idol
#

Hello,
I'm trying to install the Nvdia's Imaginaire Librarry
Using the instructions for Conda from https://github.com/NVlabs/imaginaire/blob/master/INSTALL.md
I'm stuck at this step

# install third-party libraries
export CUDA_VERSION=$(nvcc --version| grep -Po "(\d+\.)+\d+" | head -1)
CURRENT=$(pwd)
for p in correlation channelnorm resample2d bias_act upfirdn2d; do
    cd imaginaire/third_party/${p};
    rm -rf build dist *info;
    python setup.py install;
    cd ${CURRENT};

Details of the system are as follows:

python=3.8.6
pytorch = 1.10.1+cu111
cudnn = 8005
torchvision=0.11.2+cu111 
torchaudio=0.10.1
cudatoolkit=11.1.1

OS Details:
Operating System: Red Hat Enterprise Linux Server 7.9 (Maipo)
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0

This is the error I'm getting

  File "~/.conda/envs/imaginaire/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "~/.conda/envs/imaginaire/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 404, in build_extensions
    self._check_cuda_version()
  File "~/.conda/envs/imaginaire/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 777, in _check_cuda_version
    torch_cuda_version = packaging.version.parse(torch.version.cuda)
  File "~/.conda/envs/imaginaire/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
    return Version(version)
  File "~/.conda/envs/imaginaire/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

Full Traceback : https://paste.pythondiscord.com/ucuxurizaw

GitHub

NVIDIA's Deep Imagination Team's PyTorch Library. Contribute to NVlabs/imaginaire development by creating an account on GitHub.

flat echo
inland idol
#

I'm getting the following traceback

ImportError: /jmain02/apps/gcc/5.4.0/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by $HOME/mambaforge/envs/imaginaire1/lib/python3.8/site-packages/scipy/linalg/_matfuncs_sqrtm_triu.cpython-38-x86_64-linux-gnu.so)
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 33636) of binary: $HOME/mambaforge/envs/imaginaire1/bin/python

Full traceback: https://paste.pythondiscord.com/poxanigapu
I'have tried this for gcc 9.1.0 (CUDA 11.1) andgcc 5.4.0 (CUDA 10.2)but both give the same GLIBCXX_3.4.30' not found and 'GLIBCXX_3.4.26' not found respectively.
both gcc's are available as modules that can be loaded individually
The results for libstdc++.so.6 are as follows
strings /jmain02/apps/gcc/5.4.0/lib64/libstdc++.so.6 | grep GLIBCXX

GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21

Full: https://paste.pythondiscord.com/edobizociv

And for gcc-9.1.0
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
cyan plaza
#

find . -iregex '.*\.\(jpg\|gif\|png\|jpeg\)$'

#

Why is the period literal when escaped but the parentheses literal when NOT escaped?

#

I'm a bit confused

fickle granite
#

can you give an example of what you mean by "literal when NOT escaped"?

fallow tusk
#

That depends on the re standard. PCRE treats (as a group, and \( as a literal paren

#

BRE (iirc) is a bit perverse.

#

You can tell find to use PCRE .... it's in the docs somewhere!

#

-regextype is the option I was thinking of.

This option controls the variety of regular expression syntax understood by the ‘-regex’ and ‘-iregex’ tests. This option is positional; that is, it only affects regular expressions which occur later in the command line. If this option is not given, GNU Emacs regular expressions are assumed.

#

posix-extended is the type for using the PCRE standard.

inland idol
#

I want to add a path to LD_LIBRARY_PATH if it already doesn't exist.
I added the following to .bashrc, however it keeps adding path even if it is already there

if [ -d "$HOME/mambaforge/envs/imaginaire11_test/lib64/" ] && [[ ! $PATH =~ (^|:)$HOME/mambaforge/envs/imaginaire11_test/lib64/(:|$) ]]; then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mambaforge/envs/imaginaire11_test/lib64/
fi
inland idol
#

I got it!

toxic sentinel
#

hello, could someone help me loop this last script?

#!/usr/bin/env bash

export "NAME=$(whoami)"
export BOT=MochiBot

printf "\nWelcome, %s\n" "$NAME!"
printf "My name is %s\n" "$BOT"
sleep 1
printf "\nI will be helping you with your initial server set up!\n" 
echo -e "What would you like to start with?"
echo -e "   ---------------------------------
1. | User Management               |
2. | Distro Update                 |
3. | SSH Configs                   |
4. | Custom Installation           |
5. | Exit Menu                     |
   ---------------------------------
For help option try \"1 -h\" or \"2 -h\" and so on.
" 

export one="User Management"
export two="Distro Management"
export three="SSH Configs"
export four="Custom Configuration"
export five="Exit Menu"

read -r USERINPUT

# MochiBot telling the user his/her option
for USERINPUT in $USERINPUT
do
    if [[ $USERINPUT == "1" ]]; then
        echo -e "You have selected: $one\n"
    elif [[ $USERINPUT == "2" ]]; then
        echo -e "You have selected: $two\n"
    elif [[ $USERINPUT == "3" ]]; then
        echo -e "You have selected: $three\n"
    elif [[ $USERINPUT == "4" ]]; then
        echo -e "You have selected: $four\n"
    elif [[ $USERINPUT == "5" ]]; then
        echo -e "You have selected: $five\n"
    else
        loop
fi
done

sleep 1

# This "if" statement is used for User Management Option
if [[ $USERINPUT  == "1" ]]; then
    printf "Please Enter A User Name\n"
    read -r custom_user
    echo -e "The User Name will be: $custom_user"
    sleep 1
    echo -e "Would you like to add a discription to this user? (y\\\n)"
    read -r discription_answer
        if [[ $discription_answer == "y" ]]; then
            printf "What discription do you want to add to this user?"
            read -r discription
        fi
    useradd -m -s /bin/bash -c "$discription" "$custom_user"
fi```
#
# MochiBot telling the user his/her option
for USERINPUT in $USERINPUT
do
    if [[ $USERINPUT == "1" ]]; then
        echo -e "You have selected: $one\n"
    elif [[ $USERINPUT == "2" ]]; then
        echo -e "You have selected: $two\n"
    elif [[ $USERINPUT == "3" ]]; then
        echo -e "You have selected: $three\n"
    elif [[ $USERINPUT == "4" ]]; then
        echo -e "You have selected: $four\n"
    elif [[ $USERINPUT == "5" ]]; then
        echo -e "You have selected: $five\n"
    else
        loop
fi
done```
#

This one ^^^^^^

rotund pier
toxic sentinel
#

I wish it was the same as Python 😭

#

So I have to use while loops instead of for loops?

rotund pier
#

then just call python with the $USERINPUT string 🙂

toxic sentinel
#

Wait… could I integrate my .sh with .py ?

rotund pier
toxic sentinel
#

As long as I put an installation command inside of my .sh of py

#

Wait what’s the “pass” command do?

#

Or that’s just an example

#

For Python

rotund pier
toxic sentinel
#

Ahh I see

#

But I don’t want to make them to break or exit

#

I want it so that the whole if statement repeats

#

If the input doesn’t match with any “if statement”

#

Is that possible with bash?

rotund pier
#

the above code should do that, but it is untested and I may be misunderstanding what you are trying to do

#

and yes, I assume the above should work fine in bash

#

just need to translate the syntax

toxic sentinel
#

Okiee okiee thank you so much! I’ll tinker with that code 🙏🙏

quaint bone
#

Hi, this will be kinda out of the topic but I will try to ask anyway. I am trying to learn basics of bash scripting and I have come across a strange thing. On the internet ,it is written that when you create a script with touch it should not be executable by default. But when I create it, it is already executable and it seems to have all permissions. So I would like to ask what is the reason behind that. I know that it is probably nothing important, but I would like to understand it. I run Bash with Ubuntu on my windows computer.

toxic sentinel
#

anyone know how to make this stop after first match?

toxic sentinel
#

I found another way to do it 😮

#
export "MOCHIHOME=$(pwd)/test.sh" # PLEASE RE EDIT THIS EVN PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
export "NAME=$(whoami)"
export BOT="\"MochiBot\""
export LOOPEND=""
clear
printf "\nWelcome, %s\n" "$NAME!"
printf "My name is %s\n" "$BOT"
sleep 1
printf "\nWould you like to save me as a shell command? [y/N]\n"
read -r COMMAND
while [[ $LOOPEND == true ]]; 
do
if [[ "$COMMAND" == "y" ]]; then
    alias mochibot='$MOCHIHOME'
else 
    $LOOPEND -eq true
fi
done```
#

I just did like this

#

lmao

pearl coral
#

Every time I restart my linux installed on TX3Mini TV Box, there is some error regarding the ethernet connection.In 3/5 of the cases it does connect but 2/5 times it fails to "establish connection". Point to note here is that the Connector is perfect, the Lan Cable is also not moved. However if Lan Cable is disconnected and then connected, the connection is "established". Recently I figured out that even if I restart the network adapter internally by turning off LAN, and turning it back on again fixes the issue - "Connection Established". This made me think that there might be some bug in the network adapter (idk what). How do I check (prolly check weather the device has got ip or not )this on every boot? and reset the Network Adapter accordingly automatically without being the root user (i.e. not using systemctl
)?

#

Thanks in adv

feral rock
#

Heyy, I just switched to Mac (Apple Silicon), from linux and am not being able to install numpy or pandas. using the pip install command.
I am getting system legacy errors, I have checked github issues and stack overflow too, but nothing could solve my problem. Can someone help me out here?

fickle granite
#

post a transcript (as text, not a screenshot) showing what you're doing and what you're seeing

#

I've installed those packages on Apple Silicon and had no trouble

feral rock
#

Thank you for the prompt reply. I'll add my shell logs here.

Collecting pandas==1.2.4
  Using cached pandas-1.2.4.tar.gz (5.5 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
..........
clang: error: the clang compiler does not support 'faltivec', error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -arm64-3.8/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-12.5-arm64-3.8/numpy/core/src/multiarray/alloc.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure
      
      × Encountered error while trying to install package.
      ╰─> numpy
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
      note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
#

This is just some part of it.
If we could connect on a help channel (or over a screenshare) and you could guide me, it would really help me

#

I am a newbie to mac, so might be missing a very basic thing too.

fickle granite
#

sure get a help channel

lofty sorrel
#

hi, im using ubuntu to host a flask webserver - usually i use screen so i can work on it while and have it run on the side. but now i want to set up the web server to restart daily so it stays smooth. i am thinking of either using a cronjob, or setting up the server as a service. but in either case, i am not sure how i would be able to access the "running log" of the script?

lofty sorrel
opaque ginkgo
#

you could, but that seems like more effort for the same result

#

you can always just tail -f the log file if you need to follow the log

trail sapphire
lofty sorrel
#

man, i need to set up some firewall rules...

wise forge
# lofty sorrel hi, im using ubuntu to host a flask webserver - usually i use screen so i can wo...

If I would be doing it...
It would be flask app running in docker container with policy restart always

And there should be also second container (side car) that has access to docker Daemon though TCP or grabbed sock by volume. It would be having scheduled Cron job or Celery beat, or even dead simple while true script with sleeping for 24 hours, and launching script to kill first container, which will invoke its autorestart

#

Advantage? Zero dependency on OS. Everything is packed into one docker compose application with easy later migration to k8s (side car container would be still needed adjusted to work thorough k8s control instead of using docker Daemon though)
Application with autorestart is installed(or deinstalled) in one command

fickle granite
wise forge
lofty sorrel
lofty sorrel
wise forge
wise forge
# lofty sorrel hi, im using ubuntu to host a flask webserver - usually i use screen so i can wo...

Just for the sake of regular Linux non docker situation, which is completely awful but I should mention:

U just need to have then in /etc/systemd script to run your flask app as Daemon(background task). systemctl start/enable my_app

And... I guess using Cron job is simplest to run command systemctl restart my_app from time to time?
Or while true script that does the same as second systemd Daemon.

Due to being awful non docker situation, I would wish to have it at least auto installed with configuration management tool like Ansible. U will be able to auto setup app, and restart, and daemons as part of one installing script

tepid iron
#

What to do!!!

#

Help

#

Which one

wise forge
tepid iron
#

Ok done

#

***running grub-install /dev/sda

#

***running "update-grub"

wise forge
#

Remove installer when it finishes, and restart PC. U will be able in grub choosing Linux or Windows (if u kept it installed) on start to launch

tepid iron
#

Ok

#

I am installing grub now right?

#

It's on "[finishing the installation]"

#

Ah installation complete

wise forge
tepid iron
#

Ah ok

#

Should I continue or go back?

#

Installation complete

#

@wise forge

wise forge
#

I can't see what u see

tepid iron
#

Wait

#

Continue?

#

I am going with continue

#

Oh it rebooted

#

Thanks for helping

wise forge
#

Then press continue

tepid iron
#

@wise forge

#

I almost forgot my username

wise forge
# tepid iron <@370435997974134785>

xD now be a good boy and install 50 more Linux distros to try everything. Just kidding.

Highly recommending Kubuntu anyway for nice GUI and easy to install stuff

tepid iron
#

Hello?

wise forge
#

It is faster to download through qbittorrent xD

wise forge
tepid iron
wise forge
#

i live in linux for 2 years and still have no idea how to use Wine at that level xD

tepid iron
#

Damn

wise forge
tepid iron
#

Yeah yeah

#

Well thanks anyway

#

I will learn it's basics and then I'll clear the doubts here maybe

wise forge
# tepid iron Damn

Linux has different set of easy to install programs.
Linux is best if u a web developer, or Linux developer, may be even Android devs will feel themselves cool here

#

Windows is best to play video games and creating programs for Windows

#

They have different ecosystem of applications, which sometimes can be installed at both, sometimes only at one of them

#

U can sort of consider Linux being operational system as full scale IDE (like pycharm / vscode), but your whole OS is a development environment

dusky nymph
#

Hi guys can anyone tell me? I'm using Ubuntu since 3 months , with 4Gb RAM and 256GB SDD but while i use chrome or any browser with multiple tab then my ubuntu become get slow and freeze ? kindly anyone know?

slate crypt
#

Try using a lighter browser, like firefox.

#

or does it happen with firefox too?

#

4GB of memory is not a lot

trail sapphire
# dusky nymph Hi guys can anyone tell me? I'm using Ubuntu since 3 months , with 4Gb RAM and ...

if you run ubuntu there's a good chance you are running gnome, you might consider using a lighter weight desktop environment as well (it might be a little bit more basic but will also preserve some of your ram) like LXDE or it's qt based sibling LXQT, or possibly Xfce which might be better looking but not as lightweight
or even install a lightweight linux distribution made for low memory systems to begin with that comes with such a desktop environment as default among other things designed to run on resource constrained systems

slate crypt
#

i3 is also pretty lightweight

#

Though that's basically a fancier version of tmux

trail sapphire
#

yeah, a hard-core tiling desktop environment might not be very user-friendly if you never used one before and are coming from windows/mac/chrome book previously

#

but sure, it's a pretty good fit for low mem systems if i remember it right

flat echo
#

nginx is not able to access the files in the static directory of my flask app. Here are most recent logged nginx errors: 2022/08/01 12:01:01 [error] 2651#2651: *47 connect() failed (111: Connection refused) while connecting to upstream, client: 128.114.221.1, server: 128.114.128.27, request: "GET /login HTTP/1.1", upstream: "http://[::1]:8000/login", host: "ppdo-dev-app-1.ucsc.edu" 2022/08/01 12:01:01 [error] 2651#2651: *47 open() "/home/adankert/archives_app/archives_application/static/main.css" failed (13: Permission denied), client: 128.114.221.1, server: 128.114.128.27, request: "GET /static/main.css HTTP/1.1", host: "ppdo-dev-app-1.ucsc.edu", referrer: "http://ppdo-dev-app-1.ucsc.edu/login" I was wondering how I can best serve the file from its location inside the user home directory instead of "/usr/share/nginx/html"?

flat echo
#

I'm unsure why nginx is not able to access these files. The permissions are as permissive as possible: ```drwxrwxrwx. 3 adankert nginx 59 Jul 20 10:25 static

#

Would i need to change permissions for the entire user directory structure from home up-to and including static/ for the nginx user to access them?

tribal pelican
#

Hi svengoolie 🙂 Are you sure that static is looking at the same directory as you are? If you change user to the nginx user can you access the files there?

flat echo
tribal pelican
#

Great 👍

flat echo
# tribal pelican Great 👍

odd that none of the instructions for standing up this stack mentioned having to do that and that it wouldn't have worked even if the files and static directory itself was chmod 777. Very frustrating.

tribal pelican
#

I can imagine. I believe we use www-data as our nginx group ownership

trail sapphire
#

you don't really need to (and should) give everyone full read permissions and absolutely not write permissions

trail sapphire
# flat echo odd that none of the instructions for standing up this stack mentioned having to...

777 is a very bad idea for almost anything when it comes to security
nginx only need read permissions to the static files and execution permissions for the directories (not the files)
i don't think it even needs read permissions on the directories if you aren't going to support presenting a directory listing
it's best to give these permissions to a group that nginx is a member of instead of using "everyone"

flat echo
trail sapphire
flat echo
# trail sapphire then that is a good group to use for your static directory tree

Does it need to own it the entire path, from user directory to the static file? because it already was the group: ```
(.venv) [adankert@ppdo-dev-app-1 ~]$ stat -c "User:%U Group:%G" archives_app
User:adankert Group:nginx
(.venv) [adankert@ppdo-dev-app-1 ~]$ stat -c "User:%U Group:%G" archives_app/archives_application/static
User:adankert Group:nginx
(.venv) [adankert@ppdo-dev-app-1 ~]$ stat -c "User:%U Group:%G" archives_app/archives_application/static/main.css
User:adankert Group:nginx

slate crypt
#

if 777 is a bad idea, what about 7777?

trail sapphire
slate crypt
#

Yeah, go ahead and execute this file as me. It's ok.

trail sapphire
#

hehe, yeah, not the best idea ever

slate crypt
#

I actually learned about that flag because ping was giving me errors

#

the solution: chmod 4744 /usr/bin/ping

trail sapphire
#

the sticky bit (1xxx) is typically used for /tmp

trail sapphire
slate crypt
#

I didn't.

#

All I did was ```console
$ ping google.com -v
ping: Operation not permitted

#

I'm going to blame it on installing fedora into WSL from scratch

trail sapphire
#

oh, wsl...

slate crypt
#

by scratch, I mean I used the fedora docker image as a base

trail sapphire
#

and i don't know about how complete of a system the docker image is
so, might not be the best starting point for a system

slate crypt
#

I was following a guide. It seems to work fine after I did dnf group install "Minimal Install"

#

and the guide was technically for windows 11 while i had 10

trail sapphire
#

still, [the docker image] might not be the best starting point either way

slate crypt
#

Honestly, My laptop isn't the best to use WSL.

#

There's a bug with Cisco AnyConnect that causes wsl's default gateway and dns servers to be wrong.

#

I have to disable wsl networking and configure it manually

trail sapphire
#

you mean that the wsl system won't use the VPN?
that is unfortunately quite common with both wsl and virtualization together with VPNs

slate crypt
#

even if I'm not connected to the VPN, it won't work

trail sapphire
#

oh, that's a twist, usually it's just that it will not use the VPN and use the normal network as if there was no VPN connection

slate crypt
#

anyconnect is used by corp to make sure our laptops are compliant before we can access any internal resources.

trail sapphire
#

that is also quite common, then it can be a problem using the network with any virtual systems

#

depending on how it's setup in the enterprise network you might be able to workaround that, in other setups you more or less can't

slate crypt
#

I workaround it by disabling wsl networking and configure it manually

wet folio
#

Hi guys, I am having an issue to create ext4 file, before I used similar command and it worked but now its not working:) Can you please help, what could be the reason. The command i used as follows:

#
$ mke2fs –t ext4 –c ext4-04.img -F -I 128 –O inline_data
mke2fs 1.44.1 (24-Mar-2018)
mke2fs: invalid blocks 'ext4' on device '–t'
wise forge
# dusky nymph Hi guys can anyone tell me? I'm using Ubuntu since 3 months , with 4Gb RAM and ...

just increase swap https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04 (to utilize your SSD as RAM)
and optionally enable ZRAM https://www.maketecheasier.com/configure-zram-ubuntu/ if u have fast CPU (to utilize your RAM.... as more RAM through data compression)

ZRAM is a great solution to trade some CPU horsepower to gain more RAM. Here is how you can configure ZRAM in Ubuntu for better performance.

quasi scroll
#

Hey All, having some issues with a library.
I wonder if anyone recognizes the issue below and could help?

[ERROR] OSError: [Errno 8] Exec format error: '/var/task/ffmpeg'
Traceback (most recent call last):
  File "/var/task/CreateThumbnail.py", line 101, in handler
    create_video_thumbnail(bucket, key, file_name, extension)
  File "/var/task/CreateThumbnail.py", line 74, in create_video_thumbnail
    resize_video(thumb_download_path, thumb_upload_path)
  File "/var/task/CreateThumbnail.py", line 32, in resize_video
    with VideoFileClip(video_path) as video:
  File "/var/task/moviepy/video/io/VideoFileClip.py", line 88, in init
    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
  File "/var/task/moviepy/video/io/ffmpeg_reader.py", line 35, in init
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
  File "/var/task/moviepy/video/io/ffmpeg_reader.py", line 257, in ffmpeg_parse_infos
    proc = sp.Popen(cmd, **popen_params)
  File "/var/lang/lib/python3.9/subprocess.py", line 951, in init
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/var/lang/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Additional bits of info:

Value for proc: [‘/Users/Tom_Hanks/Documents/CreateThumbnail/ffmpeg', '-i', '/tmp/-866f0413-cb25-4f7d-8916-f8104c03fb5cunicorndrops-public-drops---sample-video.mp4']

executable binary value: os.environ["IMAGEIO_FFMPEG_EXE"] = f"{CWD}/ffmpeg"

lavish storm
#

i reckon you should make a help channel for this mate

dusky nymph
lavish storm
#

which ubuntu

trail sapphire
#

looks like mac to me

tepid iron
#

The hell

#

I can't access internet on linux

#

Help anyone

tepid iron
#

Help!!

#

Someone

#
cat /etc/resolv.conf

cat: /etc/resolv.conf: No such file or directory

#

What to do

tepid iron
#

Nvm

#

I solved it

#

I had to recreate resolv.conf

wispy ingot
#

I've just ran top, and got this (not my VPS): PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2573975 sammy 20 0 3375900 2.3g 3008 S 793.4 7.8 10229:36 kswapd0There's no way this is normal, is it?

slate crypt
#

You mean 793% cpu?

#

it means the process is using close to 100% of 8 cores

wispy ingot
#

Ah I see, I wonder what the cause of it would be. I just ran this: dan@vmi840593:~$ sudo find /home -name kswapd0 /home/sammy/.configrc/a/kswapd0

#

Though I'm not entirely sure what it means

#

I ran cat on that file and it's just a bunch of weird symbols, the rhombusus (rhombusi?), as though you're looking at a corrupted file on Notepad, and there's just so much of that, took 10 seconds until it stopped scrolling automatically.

#

I've seen some posts about people hacking in and using cryptominers on VPS', it's not my own VPS, so I'm not quite sure what security measures are in place. No SSH keys for all I know.

slate crypt
#

kswapd0 manages virtual memory

toxic sentinel
wise forge
#

Writing complex CLI interfaces in Bash? That's just a recipe for disaster

#

recommending stuff like argparse library since we are in python server

#

it is possible to build a python program without any dependencies if desired, or having it actually compiled to binary for reusage at any distro

#

with python it w ould be possible to have it written architecturaly nice? 🤔

wise forge
#

firstly i would like to see actually unit tests for your program? 🤔

#

using argparse or similiar libraries usage of your thing would be self documented, as it auto builds help information and which choices can be made in CLI interface

toxic sentinel
#

Ahh I see thank you so much, I don’t really mind if you bash on that code since it’s the very first code I ever made 🤣

#

I’ll try to redo it with Python

sudden socket
wise forge
#

people like clean readable code

#

where each variable / function / class name are carefully chosen and linked to each other to try telling... in human language what is going on

#

together with tests, which describe usage cases, it makes almost complete self documentation

#

which is having filled gaps with comments in difficult places, and docstrings to describe usage more fully

#

writing code is about writing something that u will be able to read and remember what it does a year later (or by other programmers)

prime magnet
fickle granite
#

I hope there's a better way, but until you find it -- ```
find /tmp/ -name '*.log' -print | while read lfn; do (cd $(dirname $lfn) && grep -q galloc $lfn && echo $lfn); done

#

one problem that leaps out at me: if the file name contains spaces, it'll break

#

this is the sort of thing I'd use python for, not bash, just sayin'

prime magnet
#

this is another way for each in $(ls -1); do echo "$each";done

#

use find instead of ls -1 of course 😄

wet folio
#

Hi guyes any idea why I am getting such error while this works before but now its showing this error:)

$ dd if=/dev/zero of=ext4.img bs=8k count=2048
$ mke2fs –t ext4 –c ext4.img -G 16 –N 32 –O flex_bg 
mke2fs 1.44.1 (24-Mar-2018) 
mke2fs: invalid blocks 'ext4' on device '–t' 
weak oyster
#

your dash characters seem wrong somehow

#

look at the -G. That's a normal dash. The other ones are longer

#

idk how that would happen

#

– vs -

#

looks like it's an En Dash character

#

@wet folio

brazen peak
#

hi everyone, i have this bash script which im trying to write on python but after hours of reading i cant find a way

#

#!/bin/bash
for i in seq $2 $3
do
ip="${1}.${i}"
[[ -n $(ping -n -q -c2 ${ip} | grep -w ms) ]] && echo $ip
done

#

for example seq $2 and $3

#

how can i add them on python to my script?

wet folio
fickle granite
#

btw what do you mean by "on python"? Do you mean you want to translate that script into python?

brazen peak
#

thanks

fickle granite
#

also: any reason you're not simply using nmap?

lofty sorrel
#

can someone tell me if there is a good list of compatiblities between ubuntu versions and python? e.g. 20.04 only supports python 3.9 apparently, and ubuntu 18 only 3.8

wise forge
wise forge
#

plus i added to the end of file ~/.bashrc

alias python='python3.10'
alias python3='python3.10'
#

which ensured it being my default python in CLI interface

formal schooner
#

personally i don't recommend using the system-provided python at all if you care about what version of python you are using

#

that alias should be mostly safe though

#

in general, python should be considered a core system dependency, much like libc and perl. if you want a specific version, use a separate package manager like pkgsrc or homebrew, or a version manager like pyenv or asdf-vm

#

obviously it's fine for just plunking around, but if you're doing serious software dev you'll want a bit more control than "whatever is in my os package repos"

lofty sorrel
#

i know but i thought that python 3.10 just wasnt compatible, after all python 3.8? doesnt run on win7 either

formal schooner
summer coral
wise forge
# formal schooner obviously it's fine for just plunking around, but if you're doing serious softwa...

For serious package manager version, I just attach my IDE to running app container in docker compose, which has grabbed current project folder in volume for hot reloading. All project dependencies including necessary installed compiling libraries are surely present and documented as code xD and required dB versions and etc

I still wish installed python3.10 so I could run my small scripts which use match-case syntax and new typing

main olive
#

@loud crypt Sorry i think i met with the wrong guy

loud crypt
#

okay

lofty sorrel
#

20.04

#

Because im pretty sure i tried to install 3.10 on 20.04 and it didnt work, but maybe i did something wrong (i did change repo)

wise forge
formal schooner
wise forge
cyan plaza
#

what's this *~

fallow tusk
#

Filenames that end with ~ - usually temporary build files or similar

lofty sorrel
lofty sorrel
# lofty sorrel thanks, that worked just fine!

actually, seems like it doesnt really work fine? i could install python3.10, but the venvs seem to be broken, and pip isnt included either - i also had to install python3.10-venv, so the venv works at least now

formal schooner
# wise forge vscode, official free Remote Containers plugin from microsoft. + pytest explorer...

pytest explorer is also a vs code extension? i had heard that vs code had good support for working in containers.. i really do NOT want to use vsc though, so maybe i'll stick to docker exec -it for now 😛

if you don't mind, i had two more questions about container workflows:

  1. pip install and wheel caching across containers and image rebuilds, beyond what you can do by just ordering dockerfile stages cleverly. i read some articles showing that it was possible, but it seemed like it required some pretty advanced knowledge of docker. is it actually complicated or not that bad?

  2. handling a project in a monorepo with multiple local dependencies. i always ended up having to rsync files into my current source tree, and use an entrypoint.sh script with some version of pip install --no-deps -e . -e ./.sync -- is there a better way?

wise forge
wispy ingot
#

Its been pretty annoying to type in the password for sudo every single time I use it, is there a way to disable it safely, I know I could disable the prompt for sudo enabled users - but is this really a good idea? I could set up an AHK hotkey to paste it in, though prior to this I thought I'd ask.

prime magnet
ember quiver
formal schooner
wispy ingot
wise forge
formal schooner
wise forge
formal schooner
prime magnet
formal schooner
prime magnet
wispy ingot
formal schooner
formal schooner
prime magnet
formal schooner
#

again, docker layer caching mostly fixes it, but not always (and not at all in CI, where it was the biggest annoyance & i felt like we were really abusing pypi)

prime magnet
formal schooner
prime magnet
formal schooner
#

i've been wanting to run a local pypi mirror at least as a workaround

prime magnet
#

I know we have images mirrors, not for python packages though we have our own packages in a kinda pypi server

wise forge
#

also as a choice... CI can be using persistent docker daemon, then it would be natural docker caching, then there will be no abuse at all.

formal schooner
prime magnet
brittle garnet
#

Why can't root see modules installed as non-root?

#

I installed pythonping without root, now since python needs root to be able to ping I need to install pythonping AGAIN now with root

#

same with every other library

steep sequoia
#

cd to the directory where it is, and ls -a

#

root should be able to read all files

fickle granite
#

when you installed as non-root, the modules went into ~/.local; when you're root, that directory isn't on the PYTHONPATH

brittle garnet
#

oh ok

warped nimbus
wet folio
#

Hi guys, I got a question, Why is flex_bg in mke2fs used in place of (-G) blocks_per_group? Isn’t flex_bg a feature that doesn’t take values?

main olive
#

Can someone recommend a linux centered discord server? I want to ask a few questions about user management in linux

main olive
fickle granite
#

🤷

#

I didn't enroll so I don't know

#

probably just a survey

lofty sorrel
#

does anyone know the best way to query an AD from a python script on linux? ldap3 only works on windows, and i couldnt find which other module works as well and is as simple as ldap3 but runs on linux

wise forge
#

<@&831776746206265384> swearing

hushed ivy
#

Random screen shots of code is off topic and not appreciated.

ruby moon
#

hey !

#

can anyone help with harmattan conky set up??

#

I tried but it's not working

weak hill
#

hey,
I've updated my VS a few weeks ago, and I'm having weird visual glitches in VSC since.

#

On the left it can be seen that selected sections overlap, and on the right.. well..

weak hill
#

Forgot to mention, I'm running PopOS (Ubuntu 22 04 LTS), that's why I posted it here.

#

But sure, thanks

ember quiver
spice iris
#

I've been using a VM for my Arch install forever now, but i'm spending so much time in it that I should just dual-boot.
Is it worth sharing an NVMe with Windows if I don't have a second or should I just chuck it on my 860 EVO?

#

I heard windows updates fuck with grub.

fallow tusk
# spice iris I heard windows updates fuck with grub.

Windows used to make a mess of GRUB, iirc. At worst all you need is a boot USB stick to rewrite the grub/EFI partition. I think Windows is better now, but I can't swear to that as I don't have any recent dual boot experience.

spice iris
#

Yeah, I used to share linux and windows on a drive and had some boot problems but this was years ago now.

wise forge
#

Windows having alocated its booter at the beginning of one disk

#

Linux is alocated at another physical disk

#

no problems to run both xD

spice iris
#

Feels like a waste not to utilize this free space on my NVMe

#

😩

#

Just gonna slam it in there for now

#

If they don't play nice i'll move it

flat echo
#

Trying to use a windows share on a centOS7 server. I mount it with this command:

0777 //ppcou.ucsc.edu/Data /home/adankert/mnt``` ...but when I try to use it with python I get ```ConnectionRefusedError: [Errno 111] Connection refused```
#

I am using the correct user: ```py

os.getuid()
233846

#

Any thoughts on what might be amiss?

fair flare
#

sed -nr '/[A-Z]*mouse/,/[A-Z]*mouse/{s/.*/Lamb/;gIw lambout.txt' alice.txt I am trying to replace all the text inbetween case insentive *mouse and a second *mouse with the word Lamb. I believe I am on the right track, but I keep getting errors

#

Any ideas?

ember quiver
slate crypt
#

You'll need an extra package (available on AUR) to enable pylance

tepid iron
#

Uh

timber wave
#

how do i install the python3-config command on linux ec2 instance?

ember quiver
timber wave
#

not the python3-config package

#

the command

#

and it is amazon linux

ember quiver
#

Maybe dnf install python-configparser but I'm not sure

timber wave
#

dnf command not found

ember quiver
#

How about yum ?

timber wave
#

need to be root user, which i am not

#

i just tried sudo yum install python-configparser, it says there is no package named "python-configparser"

#

nvm i installed it

#

python3-config

wet folio
#
$ mke2fs -t ext4 -c ext4.image -O casefold 

mke2fs 1.44.1 (24-Mar-2018) 

Invalid filesystem option set: casefold 

Hi guys, any idea why this command is not working:)

fiery juniper
#

what kernel are you running?

#

is says that casefold needs 5.2+

wet folio
#

how do I check which kernel I am running? Do i need to install latest mke2fs?or update?

wet folio
#

$ sudo mke2fs.ext4 -V sudo: mke2fs.ext4: command not found

#

Isnt is the latest one?

fiery juniper
#

no idea if latest but new enough. no idea why it's not working then, was just a blind shot. and it's mkfs.ext4 -v i think

summer trail
wet folio
fiery juniper
#

i believe mke2fs -t ext4 just calls mkfs.ext4

wet folio
#

yes

#

I tried to use the correct syntax or command, but its not working:0

fiery juniper
#

@wet folio still no idea why it's not working for you. it work in my setup:

10+0 records in
10+0 records out
10485760 bytes (10 MB, 10 MiB) copied, 0,0812773 s, 129 MB/s

% mkfs.ext4 -c xxx.img -O casefold
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 2560 4k blocks and 2560 inodes

Checking for bad blocks (read-only test): set_o_direct: Invalid argument/0/0 errors)
done
Allocating group tables: done
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

% mkfs.ext4 -V
mke2fs 1.45.5 (07-Jan-2020)
        Using EXT2FS Library version 1.45.5

% uname -a
Linux logrus 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux```
#

just nearly fully upgraded ubuntu 20.04

wet folio
#

Thank you for trying on your end to verify it. Its helpful

#

Does uname -a or -r is same as check LKL version as well?

#

Or it needs different command to check LKL version

wet folio
#
$ mke2fs -t ext4 -c ext4.img -E encoding=3 -O casefold
mke2fs 1.45.5 (07-Jan-2020)
Invalid encoding: 3
Bad option(s) specified: 

Extended options are separated by commas, and may take an argument which
    is set off by an equals ('=') sign.

Valid extended options are:
    mmp_update_interval=<interval>
    num_backup_sb=<0|1|2>
    stride=<RAID per-disk data chunk in blocks>
    stripe-width=<RAID stride * data disks in blocks>
    offset=<offset to create the file system>
    resize=<resize maximum size in blocks>
    packed_meta_blocks=<0 to disable, 1 to enable>
    lazy_itable_init=<0 to disable, 1 to enable>
    lazy_journal_init=<0 to disable, 1 to enable>
    root_owner=<uid of root dir>:<gid of root dir>
    test_fs
    discard
    nodiscard
    encoding=<encoding>
    encoding_flags=<flags>
    quotatype=<quota type(s) to be enabled>

#

Why its showing invalid encoding 3, isnt it right number to use?

#

Any suggestions please:)

wet folio
fiery juniper
#

encoding=3 was not working for me either, same error

wet folio
inland idol
#

Hello guys, How can I execute a pyqt script through ssh on a remote deskop?
When ever I run the script, I get xhost: unable to open display
I have a remote desktop open on the side. I want to launch the script on this remote desktop rather than the actual monitor.
Running xrandr --query on the rdp client gives

Screen 0: minimum 256x256.....
rdp0 connected primary 1980x1080+0+0 0mmx0mm
   1920x1080      50.00*

I then exported the name rdp0 using the command export DISPLAY=:rdp0
and When I run xhost +username I get xhost: unable to open display ":rdp0"
What am I doing wrong ? is this not possible ?

fallow tusk
#

Try :${rdp0} maybe?

#

(I assume rdp0 is actually a number…)

inland idol
inland idol
fallow tusk
#

Try it, see what echo $DISPLAY says

inland idol
wise forge
fallow tusk
#

So $rdp0 is not set

inland idol
#

I got it. I was doing echo $DISPLAY on the ssh lemon_zipped

#

instead of the rdp client

#

which returned me :10.0 and using that it start the session

#

Thank you

fallow tusk
#

;)

wet folio
#

Hi guys, anyone could help, how to install or update mke2fslatest version on my Ubuntu 18

ember quiver
white charm
#

Hey guys, Does any of you know of a good Linux Distro for hacking and etc..

bright shadow
#

kali or parrot

#

both come with all the tools you would need for "hacking"

#

but definitely not a good idea to daily drive

wet folio
wet folio
fiery juniper
#

@wet folio it says that by default it's UTF8 and when I use -E encoding=utf8 it works. I found one page (from 2020) that says there's no plans for other encodings, not sure if it's legit or not, you have to look in kernel code to be sure I think

wet folio
#

Thank you so much

wet folio
fiery juniper
#

@wet folio ⬆️

wet folio
wet folio
#
$ sudo apt-get install e2fsprogs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
e2fsprogs is already the newest version (1.44.1-1ubuntu1.4).
The following package was automatically installed and is no longer required:
  linux-hwe-5.4-headers-5.4.0-121
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ e2fsck -V
e2fsck 1.44.1 (24-Mar-2018)
    Using EXT2FS Library version 1.44.1, 24-Mar-2018
``` Not sure, why its not updating the version to 2020 one, still keeping the old 2018
#

Is there any way to update LKL version?

main olive
#

is there a way to put an if statement in this so if theres more than 10 connections it will just reply with the amount of connections?
ex:15 total connections

netstat -tn | grep tcp
ember quiver
main olive
#

instead of echoing over and over which fills up the screen, is there a way to keep the TCP connection(s): part and replace the $est part?

INTERVAL="0.5"
host=`hostname -I`
IF=$1
while true
do
        est=`netstat -a | grep established | wc -l`
        echo -e "TCP connection(s): $est"
done
shrewd stratus
#

use a carriage return (\r) perhaps

ember quiver
wet folio
#

Guys, please help, how can I debug such file below on gdb or llvm:)

$ ls
id:000000,src:000247,op:fs-havoc-generate,rep:4

wet folio
#

So when I type like this it gives me such output
$ file id:000000,src:000247,op:fs-havoc-generate,rep:4
id:000000,src:000247,op:fs-havoc-generate,rep:4: Maple help database

main olive
#

anyone using dwm?

#

can someone help me out with setting up things like dunst, redshift etc?

glad stirrup
lofty sorrel
#

does anyone know how to get a python script running in a screen session via crontab? im on ubuntu 22.04 and sudo crontab -e -> @reboot /usr/bin/screen -dm python main.py doesnt work - i think i need to tell it the correct path, but whats confusing me is that there is no screen session open at all when i use screen -r which i would expect

wise forge
#

why not to run python script just in crontab? without session?

lofty sorrel
wise forge
# lofty sorrel so that i can see stdout without having to pipe the output to a file (its a flas...

hmm... a more proper way within baremetal linux way would be to put your script into systemd service (google guides like https://unixcop.com/how-to-create-a-systemd-service-in-linux/ ) and activating your crontab as systemctl start service_name
and then requesting short logs as systemctl status service_name
or full logs as journalctl -u service_name.service (https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs there is flexibility to choose in which time range)
then it is configurable to have log time retention. or may be it is even in default

wise forge
#

it is much more proper than hacking session which is meant for users TUI usage only

lofty sorrel
#

yea thatd be the best case but as it is really not a big application i wanted to avoid a large logging or service backbone, but i guess then i am stuck with just running it directly in cron with piping the output

wise forge
#

get used to creating systemd daemons. that's easy

#

if u run stuff in baremetal linux that's best way. everything else is just a hack and you risk overfilling your logs or reinventing more hacks. If you use proper tools, you get results out of the box

#

a trully best way would be to run as docker container, but that's already entirely another story.

wet folio
#

Hi guys, any idea how can I further investigate the information shown in hexdump -C of the hangs? any suggestion please

#

How do i read or find out the reason for the hangs from hexdump results:)

wet folio
#
$ for i in `find id:000000,src:000247,op:fs-havoc-generate,rep:4 -type f`; do echo$i; done
echoid:000000,src:000247,op:fs-havoc-generate,rep:4: command not found```
wet folio
prime hawk
#

I'm trying to loop over arguments to call a command with different ones for POSIX shell, yet shellcheck keeps warning about word splitting (https://www.shellcheck.net/wiki/SC2086).

I've tried using pseudoarrays, and playing with IFS too, with no luck. I understand you can try fit the arguments in $@, but then you'd need to do a second pass to group together each option with its value set -- autobackup 0 docfiles 1, and I'm not sure of a way to solve this without resorting to bash/ksh arrays

Help much appreciated 🤍

#!/bin/sh

setopts() {
    for i in 'autobackup 0' 'docfiles 1'
    do
        sudo tlmgr option ${i}
    done
}
fiery juniper
#

if it does what you want it to do why are you bothered anyway?

#

besides there is exceptions section on that page you linked and there's exactly your case there:

north bronze
prime hawk
prime hawk
#

I found out that by using eval it will also work and I won't get the warning

#!/bin/sh

setopts() {
    for i in 'autobackup 0' 'docfiles 1'
    do
        eval "sudo tlmgr option ${i}"
    done
}
formal schooner
#
#!/bin/sh

setopts() {
    for i in 'autobackup 0' 'docfiles 1'
    do
        sudo tlmgr option "${i}"
    done
}

this is all you need i think

#

the warning about word splitting is probably because $i was unquoted.

i='autobackup 0'
foo ${i}

you want this to expand to foo 'autobackup 0', two "words", but it actually expands to foo autobackup 0, three "words".

this is because the shell performs word splitting on the results of parameter expansions

#

you need to quote the parameter expansion to prevent word splitting

#

hence the shellcheck warning

dreamy shell
#

What do you use to get email notifications in Ubuntu’s system tray? I use thunderbird but I don’t get notifications unless it’s already running which seems stupid.

formal schooner
#

i thought it did, but i'm not sure

dreamy shell
#

I think Birdtray will do that I just have to set it up

#

Probably the best I can get

dreamy shell
#

Has anyone used it before? I read the GitHub read me and got the impression that Birdtray shows you a notification when you get an email or anything email related. The install and setup is very simple. Am I wrong about what it’s meant to do?

formal schooner
#

seems like that's exactly what it does

dreamy shell
#

I must’ve done something wrong then I’ll try to figure it out. I’m still only getting a notification while thunderbird is open.

wet folio
#
(gdb) run
Starting program: ~/afl-image-syscall/afl-fuzz -S fuzzer_ext4-cpu4log10grp1 -b shm_ext4-4 -s fs/ext4/ext4_wrapper.so -e img/ext4-01.img -y seed -i in-ext4-1 -o out-ext4-1 -u 4 -- lkl/tools/lkl/ext4-combined-consistency -t ext4 -i img/ext4-01.img -e emulator/emulator.py -l /tmp/mosbench/tmpfs-separate/10/log -d /tmp/mosbench/tmpfs-separate/10/ -r -p @@
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
afl-fuzz 2.52b by <lcamtuf@google.com>
[+] [fs-fuzz] shm name to store image buffer: shm_ext4-4
[+] [fs-fuzz] target wrapper (.so) path: fs/ext4/ext4_wrapper.so
[+] [fs-fuzz] seed image path: img/ext4-01.img
[+] [fs-fuzz] syscall input directory: seed
[+] You have 16 CPU cores and 3 runnable tasks (utilization: 5%).
[+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
[+] Found a free CPU core, binding to #4.
[*] Checking core_pattern...
[*] Checking CPU scaling governor...
[+] [+] Open shm shm_ext4-4 success.
[+] [+] Map shm shm_ext4-4 at 0x7ffff5c15000 size: 0x800000.

[-] image img/ext4-01.img compression failed.
Location: compress(), ext4_fuzzer.cc:222
[Inferior 1 (process 41441) exited with code 01]
(gdb) bt
No stack.
#

Guys, any idea why my bt command showing nothings?

prime hawk
prime hawk
# formal schooner ```sh #!/bin/sh setopts() { for i in 'autobackup 0' 'docfiles 1' do ...

I appreciate the effort. When double quoted the "${i}" var it won't work:

tlmgr: option autobackup 0 not supported!
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr: option docfiles 1 not supported!
tlmgr: An error has occurred. See above messages. Exiting.

but when no quoted (${i}) it will :

tlmgr: setting option autobackup to 0.
tlmgr: updating /usr/local/texlive/2022basic/tlpkg/texlive.tlpdb
tlmgr: setting option docfiles to 1.
tlmgr: updating /usr/local/texlive/2022basic/tlpkg/texlive.tlpdb
formal schooner
#

in that case then this warning is just telling you what your code is doing

#

i would not try to work around it with eval, just annotate that line to silence it

prime hawk
floral slate
#

#web+

carmine aurora
#

Any ideas of how I could merge these two loops together?

    @for file in ./src/pb/*.cc; do\
        sed -r -e 's/(#include "[a-zA-Z.]*\.pb\.h)"/\1pp"/g' -i $$file;\
        mv "$$file" "$${file%.??}.cpp";\
    done

    @for file in ./src/pb/*.h; do\
        sed -r -e 's/(#include "[a-zA-Z]*\.pb\.h)"/\1pp"/g' -i $$file;\
        mv "$$file" "$${file%.?}.hpp";\
    done 
wet folio
wet folio
sinful idol
#

Is anyone around developing on Mac? I want to compile some C++ code using boost-python and can't get pkg_config to work properly ..

formal schooner
formal schooner
#

also why use -i but then also mv?

#
src/pb/%.cpp: src/pb/%.c
    sed -r 's/(#include "[a-zA-Z.]*\.pb\.h)"/\1pp"/g' $< > $@

src/pb/%.hpp: src/pb/%.h
    sed -r 's/(#include "[a-zA-Z.]*\.pb\.h)"/\1pp"/g' $< > $@

build/pb/foo.o: src/pb/foo.cpp src/pb/foo.hpp
    ...

also did you intend to make the patterns different? the .h pattern has [a-zA-Z] and the .c pattern has [a-zA-Z.]

sinful idol
formal schooner
sinful idol
#

I found the place(s) where boost stores the .pc files, but there are none for boost

formal schooner
#

ah, that's annoying

sinful idol
#

ah, sorry! I found the place where homebrew store them

formal schooner
#

i find that a lot of homebrew and macports packages both are missing the .pc files you would want

sinful idol
#

I was under the assumption that they could somehow be created automagically from the information available at build time..

#

so I am really flabbergaster to find that that's an actual issue

formal schooner
#

btw in general you can write brew list <pkg> to list all files in a package, if that helps

#

you can also look in brew --prefix <pkg>

sinful idol
#

yeah, I learnt that and that's where I noticed boost does not have any .pc file

formal schooner
#

yeah i don't know why some libraries don't have .pc file in their packages

#

if it makes you feel better i don't even see boost-python at all in macports, so i guess nobody has gotten around to packaging it yet

carmine aurora
#

I ended up just keeping the two loops

formal schooner
#

plus -i isn't really portable, this won't work on macos for example unless you do SED = gsed and use $(SED) -i

carmine aurora
formal schooner
#

i mean suit yourself, it's your makefile! but i think my version is more robust, more portable, and less complicated

sinful idol
formal schooner
#

a lot of homebrew packages include (or used to include) a "caveat" section telling you to add -L... -I... when compiling stuff

#

maybe file an issue on the homebrew issue tracker? i guess it's also easy enough to write your own .pc files. i don't know if homebrew has a way to generate them when defining a package

sinful idol
#

I'll dig into that, it's too intriguing to let it slip by. Thanks for your help!

formal schooner
#

@sinful idol i also don't really know if there is other dark magic that powers pkgconfig. try brew install pkg-config and then specifically invoking the version installed w/ homebrew using its full path

sinful idol
#

I was already using the brew version of pkg-config but re-installed anyway. No effect, though. And /opt/homebrew/lib/ is full of pc files, but none for boost, so it seems it's really a package related thing, like you said

#

Good that the .pc files are plain-text and not too complicated, I might roll my own for the time being

formal schooner
#

it might be an upstream thing too

#

so it's possible that apache arrow just includes them in their build/install process

sinful idol
#

Wow! lemon_angrysad

#

This jam stuff again ..

#

Maybe I should be looking for a replacement for boost then. I ended up with it for writing Python modules in C++ and there might be other, more portable libs supporting that.

formal schooner
#

there's a recipe for a python script that will generate .pc files for a boost installation. idk if it's a bad idea for any reason

sinful idol
#

where?

formal schooner
sinful idol
#

ah, ok, I'll have a look, thanks

wet folio
#
afl-fuzz: ../mutator_wrapper.cpp:23: void mutate_havoc_init(uint8_t*, uint32_t, uint32_t): Assertion `havocStage == nullptr' failed.cpy a2 read inline(0x7ffe30280690, 0x55d65304a478 + 53183, 8);
Aborted memcpy a2 read inline(0x55d651ffdbc0, 0x55d65304a478 + 53191, 1);

Guys, anyone knows what could be the reason for such error?

fickle granite
#

yeah: havocStage is not == to nullptr

#

semi-snarky, but that's C++ code, not python

wet folio
#

🙂

narrow smelt
#

Can I upgrade kernel to 5.18 on Fedora 36 without any problems?

narrow smelt
#

When will linux mint 21 edge come?
Will it come with 5.18 kernel?

wet folio
#
char v2[] = ".";
char v3[] = "foo";
...
v12 = syscall(SYS_open, (long)v2, 65536, 0);
syscall(SYS_chmod, (long)v3, 3072);

Anyone, please explain the last two lines based on the first two lines? Usually second last one should open the syscall using v3 but it's using v2.

main olive
#

I was trying to connect my usb to a windows 10 VM so
I went here https://wiki.archlinux.org/title/USB_storage_devices
first added the current user of the vbox users group, rebooted then
entered this mount -o gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick
successfully mounted, no problems on my host machine, so I went and checked the virtual box settings, nothing wrong as far and as I know. But when I boot into
my windows 10 VM I don't see my usb, I just can't access it. Any clues? about what's wrong?!?

main olive
main olive
#

macports or homebrew?

shrewd stratus
#

Homebrew is the more popular and supported choice, I think

#

you can also manage packages using Nix, but I haven't tried that

fickle granite
#

homebrew for sure

#

I don't know anyone who uses macports -- and popularity matters

near ravine
#

How can I start the ssh service on boot?

fickle granite
#

which distro? Any sane distro will have done that for you already

#

@near ravine this

wise forge
#

in debian family, systemctl status service_name allows to check if it is already enabled for auto start
if not, it can be enabled as systemctl enable service_name to be booted at start
there is always an option to add anything into systemd daemons for auto start and etc

#

though as it was said, any distro adds ssh automatically into auto start

near ravine
fickle granite
#

well kali is probably weird

#

on ubuntu it starts by itself

ember quiver
#

It makes sense to me that Kalli would keep services like that disabled by default... It's definitely not a normal distro

near ravine
#

Yeah

#

Ubuntu doesnt neither i started my docker container and sshd is not runnig

ember quiver
near ravine
#

Oh yeah

#

Sorry completly fortot to mention i was using docker

fickle granite
#

a docker container is generally a single process, or 2 or 3 very closely related processes.

#

it's not at all the same as a "real" computer

fickle granite
#

why what?

#

why don't I know anyone who uses macports? I dunno.

#

Why does popularity matter? Because a more popular platform will attract more and better developers, and because you're more likely to find someone who can help you use it.

near ravine
main olive
#

it works similar to flatpacks

fickle granite
#

🤷

#

I've used a Mac for work for many years, and my coworkers do too, and I cannot ever remember any of us using macports.

near ravine
#

Also, having an error with ssh keys. Used ssh-keygen to generate an rsa key. It automatically saved it at ~/.ssh. I created the authorized_keys file (added rw perms) and copied the public key inside it. When i try to ssh with the key, it asks for a password

fickle granite
#

re-run ssh with -v, post the output

near ravine
#

Alright

#

Also from clients side id rsa file shoyld have rw perms right

fickle granite
#

of course

#

rw for you but nobody else

#

you created the authorized_keys file on the remote machine, right?

#

forgive me if that's an insulting question, but I have no idea how familiar you are with ssh

near ravine
#

1 sec

#

Too big to upload. Something tht might be interesting is id rsa type 0 and id rsa cert type minus 1

fickle granite
#

I think minus 1 means "I couldn't find that file"

near ravine
#

After that tries uthenticate as my current user and then some fails trying to open known hosts file

fickle granite
#

it'd help to see the file. Did you try

#

!paste

shy yokeBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

fickle granite
#

?

#

but that's OK, you don't need to use a certificate.

#

ssh is filled with rarely-used features; I think that's one of them

near ravine
#

Im making a ctf thats why

fickle granite
#

that's the whole output?

#

also I have no idea what "a ctf" is

#

if that's the whole output, my best guess is that you did not properly create the authorized_keys file

near ravine
#

Capture the flag game

fickle granite
#

how is that relevant?

near ravine
#

?

fickle granite
#

now that I know you're making a "capture the flag" game, how does that help me diagnose your ssh problem?

near ravine
#

Based on the scenario the attacker shall gain acces to an admin page of a vuln web app and gajn a eession using the idrsa file

fickle granite
#

let's take this one step at a time

#

let's see if we can get ssh working at all before we worry about attackers and stuff

near ravine
#

No i was answering to your what is a ctf questin

fickle granite
#

well sure

near ravine
#

Yeah i can gain a session usinga password

fickle granite
#

here's an idea:

#

get that session, recreate the authorized_keys file just like you did last time, but this time capture your session in a transcript so I can see it.

#

you may have done something wrong.

#

make sure it doesn't have any secrets in it before you show it to me, of course

#

[it probably won't]

near ravine
#

Thanks for the help

fickle granite
#

and I have to go to work soon, so ... sigh

main olive
#

i want to parse this so it so it says size:23G - used:2.8G - available:19G - used:14% but i dont know how to split the data up, can anyone help

fickle granite
#

@main oliveNot exactly sure what you want, but this seems like a good start

#
import pprint
import subprocess

cp = subprocess.run(["df", "-h"], capture_output=True)
fields, *data = [line.split() for line in cp.stdout.split(b"\n")]
pprint.pprint([dict(zip(fields, datum)) for datum in data])

# python3 yoria.py
# [{b'Avail': b'13G',
#   b'Filesystem': b'/dev/disk3s1s1',
#   b'Mounted': b'/',
#   b'Size': b'229G',
#   b'Use%': b'95%',
#   b'Used': b'216G'},
#  {b'Avail': b'13G',
#   b'Filesystem': b'/dev/disk3s6',
#   b'Mounted': b'/System/Volumes/VM',
#   b'Size': b'229G',
#   b'Use%': b'95%',
#   b'Used': b'216G'},
# ...
#

you'll have to collect the "Available" or "Used" fields yourself; probably best to not pass the -h flag, so that you get something you can easily do arithmetic with

main olive
#

oh thanks, this is somewhat what i needed

fringe canyon
#

Hey guys I have a question about ubuntu I configure my NetworkManager.conf file like in the following snip but for some reason I'm still facing with mac leakage how can I stop it. The following snip is working completely fine on kali """[device]
wifi.scan-rand-mac-address=no
[connection]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve
"""

exotic otter
#

What discord rich presence lib do u use on linux systems?
Pypresence seems to not working

frosty depot
near ravine
#

!paste

shy yokeBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

deft plover
#

Someone here can help me with deploying django website?
I've already wrote all in #help-mushroom

near ravine
#

Try 127.0.0.1

#

@deft plover

deft plover
#

It's localhost

near ravine
#

Ye

deft plover
#

So what i suppose to do?

near ravine
#

Does the localhost work

deft plover
near ravine
#

Check if nginx is running

#

Errors?

deft plover
deft plover
#

)

near ravine
#

Uhm can you post all the output

#

Also post the log file

#

!paste

shy yokeBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

deft plover
#

There is small output: Restarting nginx (via systemctl): nginx.service.

deft plover
near ravine
#

Yup seems fine

#

Idk what really is the problem here. Have you changed the default nginx port

tender plinth
#

Hello, I was trying to programmatically detect if a certain process is waiting for input or not, my idea was to epoll the fd and verify if there's a block, but then the issue here is, we don't know for how long to poll the fd before verifying if the input is read or not

#

does anyone know anything better than using epoll here?

fickle granite
formal schooner
#

any preference between these two?

  ## Option 1
  1>&2 printf '%s\n%s\n' \
    'Command `brew` not found!' \
    'You must run `./scripts/install-system-requirements.sh` before running this script.'

  ## Option 2
  1>&2 cat <<\ERR
Command `brew` not found!
You must run `./scripts/install-system-requirements.sh` before running this script.
ERR
shrewd stratus
#

I prefer heredocs

#

why do you have \ there though?

weary bramble
#

consider echo since it's a almost always a shell built-in

#
echo -e 'Command `brew` not found!\nYou must run `./scripts/install-system-requirements.sh` before running this script.' >&2
clever burrow
#

my linux hyper-v vm doesnt boot properly. it starts up, loads GRUB, boots, prints some text, shows the startup animation, prints some more text, and then gets stuck on the terminal interface with a flashing cursor and nothing else. any ideas what might be wrong here?

#

before it gets stuck, i see the login: flash for a split second, which is normal before the gui loads, but for some reason the gui fails to load and the login prompt disappears

weary bramble
#

try ctrl-alt-f1

clever burrow
#

nice. that let me log in through the terminal, but is there a way i can get the desktop environment to work?

#

its xfce iirc

weary bramble
#

sounds like you are probably using X11 but there are so many configurations. it's very hard to make generic suggestions

#

i'm not sure what distribution you are using

clever burrow
#

i downloaded kali from their page, the "bare metal" image, since they dont have a prebuilt for hyper v

weary bramble
#

did it work at one point in the past? they might just not have a display driver that's compatible with Hyper-V's virtual display adapter. I'm not very familiar with Hyper-V. You could also try running it from VirtualBox instead

clever burrow
#

it worked when i had a different kali vm on vbox

#

that was a prebuilt image

weary bramble
#

if it's an iso-type image it's probably difficult to impossible to reconfigure. I would recommend trying in a different hypervisor unless you're absolutely tied to Hyper-V for some reason

#

i'd guess they probably eliminated a bunch of possible display drivers in an effort to keep the image reasonably small, and hyper-v's emulated display adapter just isn't supported

clever burrow
#

i am, unfortunately this pc is quite old and for some reason its having issues running vbox, runs into bluescreens often, while hyper-v at least doesnt crash it

#

i dont think display drivers are the issue here, since it shows the startup animation just fine, and terminal interface works too

#

probably an issue with xfce

weary bramble
#

the startup animation is completely unrelated to the drivers X11 will need to run, and xfce is just a window manager that runs on top of X11 and doesn't actually display graphics on its own

#

a lot of blue screens and crashes tend to point to hardware issues, though. possibly heat buildup or a bad connection on a RAM module

#

or try to go back to an older release of Kali

#

I just don't think Hyper-V is very popular among the linux crowd so it's not too surprising if they haven't tested it or built images for it

clever burrow
weary bramble
#

you can also just try a different distro other than kali such as lubuntu. they also have a live image available.

formal schooner
formal schooner
weary bramble
#

printf is fine to use

formal schooner
clever burrow
main olive
#

How do you guys install python on macos?
installer from python
homebrew
macports

shrewd stratus
#

pyenv

formal schooner
#

the one thing i like about brew that macports doesn't have is its system of Cellar->opt->root symlinks

#

but macports is overall a nicer user experience

main olive
#

oh its in homebrew

#

pretty sure in macports you can switch python versions

#

does it take a long time to recieve python update

#

b/w brew and macports

formal schooner
main olive
#

from what i read
brew depend on the system libraries

#

and if there is was update to those

#

it can break stuff

formal schooner
main olive
#

macports "containerise" stuff like flatpack

formal schooner
#

but yeah that's the other difference. homebrew tries to reuse as much as possible provided by macos, whereas macports explicitly doesn't

formal schooner
#

i don't believe they use any form of isolation like flatpak

main olive
#

All apps and dependencies are self-contained and managed by MacPorts. Any kind of MacOS update that changes library versions will never affect an app installed by MacPorts. Kind of the same concept as Flatpaks

#

it was from reddit

#

so

formal schooner
#

that's a really weird analogy

#

macports is like literally every other package manager in that regard

#

flatpak is a completely different design, don't believe everything you read on reddit

main olive
formal schooner
#

it's only like flatpak in that flatpak isn't connected to your system's package manager

formal schooner
formal schooner
main olive
#

ok
what about the part where macos update to system libraries

#

can break stuff with brew

formal schooner
#

that is true. when you update macos you might need to reinstall all of your brew packages

main olive
formal schooner
#

macports, homebrew, pkgsrc, nix, guix all fall into the category of package managers that live alongside your main os. they all differ in how much of the main os they depend on.

#

pkgsrc requires you to have bsd make, svn, and a c compiler w/ libc. that's literally it. everything else is built up.

main olive
#

im new to macos
but experinced in windows and linux

so how these macos packages differ to package mangers like apt,dnf

formal schooner
#

macports i don't think even requires a c compiler technically as long as binary packages are available for your system, you just need a tcl installation that can connect to the network

main olive
#

or choco & winget

formal schooner
main olive
#

so more similar to choco
than to aopt

#

apt*

formal schooner
#

yes. but choco only differs from apt in that apt assumes it has full control over / whereas choco only assumes it has full control over a specific part of the filesystem

#

in deb and rpm packages, the filenames are literally hard-coded relative to /. that's why if you want to run a separate apt installation (e.g. to install specific dependencies for building debian packages), you have to do it in a chroot, because all the packages have / hard-coded as the root installation prefix

main olive
#

does it make ports faster?

formal schooner
# main olive is this an advantage?

it's a tradeoff. fewer dependencies on the host system means that the developers have more control over their own system. but then it means that there might be some incompatibilities or inconsistencies with the host system.

formal schooner
#

homebrew has come a long way in terms of its design, but it's still insultingly slow even on my m1 mac with an ssd

#

brew info <pkg> takes 2-3 seconds whereas port info <pkg> is nearly instant. there is no reason why brew info <pkg> should not also be nearly instant.

#

so ultimately i recommend macports over homebrew because macports is a much nicer user experience because it's a better-designed piece of software. however i also recommend keeping homebrew around anyway in case there is something missing from macports. on m1 mac they install to /opt/local and /opt/homebrew so as long as you set up your PATH correctly they should not really conflict

#

(i wish they would give you the option to install to /opt/homebrew on non-m1 systems too, installing to /usr/local was also a very sloppy design choice, although understandable at the time they did it)

#

homebrew is great because it has so many packages and they are usually kept very up-to-date

#

i even install it on linux ("linuxbrew" was merged into homebrew a few years ago)

#

whereas pkgsrc has approximately nothing i need and sometimes straight up didn't work even when following the exact installation instructions, on linux. i'm sure it's good too but i'm more practical than that. macports does a much better job on macos for my purposes, and on linux i usually just don't need it. although it'd be pretty cool to have a solid cross-platform pkgsrc setup you can take with you anywhere.

main olive
formal schooner
#

you will also need to make sure that MANPATH, INFOPATH, PKG_CONFIG_PATH, etc. are also all set up the way you want them

#

you can even write a shell script that "activates" homebrew and/or macports by setting env vars, much like activating a python venv

main olive
#

/opt/homebrew

formal schooner
main olive
#

sound like a root directory

formal schooner
#

/opt is specifically designated as a "do whatever you want" location in the unix filesystem hierarchy, and macos respects that. it will not mess with /opt

#

/usr/local kinda-sorta used to be like that historically, but macos uses it for some things so it's a good decision that homebrew was forced to move away from it due to security restrictions

main olive
#

btw what about the location ports uses

formal schooner
#

/opt/local

main olive
#

k

formal schooner
#

i wish it was /opt/macports but that decision is stuck

main olive
#

i've check the packages i want to install
and they seems to be on macports
which is python and hugo

formal schooner
#

yeah you should be able to do sudo port install python hugo and be able to use it

main olive
#

cool
thanks so much clarifying this stuff

#

btw one more question
prob not related to unix
what poetry do?
ive seen that on replit

#

is like venv

#

also how is the experince with conda
on macos

#

i didnt like it much when i used it in windows

#

kinda found it confusing

#

and the ui it had was very slow

formal schooner
formal schooner
formal schooner
# main olive and the ui it had was very slow

it's particularly slow on windows for some reason. i use Mamba which is a reimplementation of Conda written in C++ and it's much much much faster. you can use Conda envs with Mamba and it's basically drop-in replacement

main olive
main olive
#

another question about ports vs brew
for homebrew

Every installed package is cleanly sandboxed into its own cellar so you don't have stray files all over your system, just symlinks from bin, man, etc.
is this true for macports?

#

it is 10 years old

#

so

#

sorry gtg to bed now
i'll reply to any messages tmr

formal schooner
# main olive another question about ports vs brew for homebrew > Every installed package is c...

that's what i was talking about before with the homebrew model vs. the macports model. no, it isn't true about macports. macports also doesn't put files "all over your system", but they don't have isolated trees for individual packages that are symlinked into the primary tree, everything just gets put directly in the primary tree. so it's a bit less well-isolated, but in practice it shouldn't matter much because packages shouldn't come into conflict

#

admittedly i don't know what happens if you install both moreutils and parallel for example, since they both have a parallel binary. it's possible that macports refuses to install one or the other, or uses port select. i'll look into it

near ravine
graceful mountain
fringe canyon
#

Hey are there any risks for using chocolatey package manager?

graceful mountain
#

Depends on how much you like fudge

fickle granite
weary bramble
# fringe canyon Hey are there any risks for using chocolatey package manager?

Chocolatey has the largest online registry of Windows packages. Chocolatey packages encapsulate everything required to manage a particular piece of software into one deployment artifact by wrapping installers, executables, zips, and/or scripts into a compiled package file.

Package submissions go through a rigorous moderation review process, including automatic virus scanning. The community repository has a strict policy on malicious and pirated software
There are always risks to everything. It sounds like they try to make a good effort at securing things, but nothing's perfect. No way of automatically knowing if they do a better job than, say, Debian or Canonical, but it seems unlikely.

#

I don't see anything on here about unix anyway, so is this even what you're talking about?

main olive
#

and the only advantage it brings is everything organzied

#

like in windows application can store their config all over the place
but in linux based distros application put their config in config folder
and when i uninstall an application only the stuff in the config are not deleted

what about in macos

shrewd stratus
#

Linux doesn't restrict an application from storing it all over the place either

#

nor does macOS

main olive
#

oh ok

near ravine
#

I did what i mentioned above to an ubuntu server and it worked.

fickle granite
#

yes, authorized_keys lives on the server.

#

it's a list of keys that are authorized to log in to that account on that server.

near ravine
#

Yeah.

near ravine
#

Welp i should have deleted the id rsa file so it would become obvious

fickle granite
#

it's weird to create your private key on the server, and then ship it back to the client.

#

the server doesn't need, and shouldn't have, the private key.

#

generate the keys on the clients instead.

#

private keys should never traverse the network. That's why they're called "private".

formal schooner
formal schooner
# main olive like in windows application can store their config all over the place but in lin...

windows applications usually store configs either in their install directory (e.g. C:\Program Files\The App) or somewhere in your user directory, e,g, %LOCALAPPDATA, or sometimes the windows registry

linux/bsd (and other unix-oriented) applications usually store configs in /etc (or whatever their installation prefix is, e.g. /usr/local/etc or ~/.local/etc) or in a "dot directory" in the home dir, or more recently under ~/.local and/or ~/.config

macos applications use /Library or ~/Library, e.g. ~/Library/Application Support/The App. however, a lot of applications that are written with linux in mind, or that are cross-platform, use ~/.config which is perfectly acceptable and common on macos.

sometimes you even see %USERPROFILE%\.config on windows too, but that's rarer. usually porting an application to windows requires so much "internal" work that you can afford to use a different config directory that is more conventional for the windows platform

#

and yes, like moyenperson said: there is no requirement to store configs in any particular place. this is all dictated by convention

hallow herald
#

If this hasn't been mentioned there is a library perfect for this purpose

#

!pypi appdirs

shy yokeBOT
#

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

hallow herald
#

combined with

#

!pypi EasySettings

shy yokeBOT
main olive
#

but dont ask for permission to use the library folder

#

like any app could change the library folder without perimission

#

like AppCleaner

#

does the Library folder also contain binaries for applications?

main olive
#

oh there is two different Library folders

#

btw how do i get pip?

#

kinda surprised mac doesn't come with python installed

#

but comes with git

plush sparrow
#

example.txt

a
2
start
a
b
615
b
d
end
f
a
g
start
610
h
i
end
b
3
start
e
e
615
s
s
end
a

How would you go about deleting blocks of [start;end] if the block contains 615?

magic example.txt > output.txt

output.txt

a
2
f
a
g
start
610
h
i
end
b
3
a
shrewd stratus
light gorge
main olive
shrewd stratus
#

and now try python -m pip

atomic ember
#

Hello, a quick way to install all python developer dependencies on fedora? I encounter a problem when try to install numpy. edit: I resolved this, it was a problem with an old version of numpy

main olive
shrewd stratus
main olive
#

Oh ok

#

I uninstalled every package in ports
And installed python again. Pip seems to be working

plush sparrow
# light gorge probably looking for more clever solution, anyway this is not nice but it works ...

Hey, thanks for your effort, couldn't get your solution to pass my test though, so my WIP solution so far is:

from pathlib import Path


class BlockPruner:
    def __init__(self, start: bytes, end: bytes, needle: bytes) -> None:
        self.start = start
        self.end = end
        self.needle = needle

        self._temp: list[bytes] = []
        self._save: list[bytes] = []

        self._keep_block = True
        self._inside_block = False

    def prune_file(self, input_file: Path) -> bytes:
        with open(input_file, "rb") as input_fp:
            for line in input_fp:
                self._feed_line(line=line)
        return b"".join(self._save)

    def _feed_line(self, line: bytes) -> None:
        if line == self.start:
            self._inside_block = True
        if self._inside_block:
            self._temp.append(line)
            if line == self.needle:
                self._keep_block = False
        else:
            self._save.append(line)

        if line == self.end:
            self._keep_or_disregard_block()

    def _keep_or_disregard_block(self) -> None:
        if self._keep_block:
            self._save.extend(self._temp)
        self._temp = []
        self._keep_block = True
        self._inside_block = False
#

Which passes the test:

from pathlib import Path

import pytest

from block_pruner.block_pruner import BlockPruner


class TestCase:
    __test__ = False

    def __init__(
        self,
        start: bytes,
        end: bytes,
        needle: bytes,
        expected_fname: str,
        input_fname: str,
    ) -> None:
        self.start = start
        self.end = end
        self.needle = needle
        self.expected_file = Path(f"tests/data/{expected_fname}")
        self.input_file = Path(f"tests/data/{input_fname}")

    def actual_matches_expected(self, compare: bytes) -> bool:
        with open(file=self.expected_file, mode="rb") as expected_fp:
            return expected_fp.read() == compare


test_cases = [
    TestCase(
        start=b"start\n",
        end=b"end\n",
        needle=b"615\n",
        expected_fname="simple-expected-output.txt",
        input_fname="simple-input.txt",
    ),
]


@pytest.mark.parametrize("test_case", test_cases)
def test_prune(test_case: TestCase) -> None:
    pruner = BlockPruner(start=test_case.start, end=test_case.end, needle=test_case.needle)
    actual: bytes = pruner.prune_file(input_file=test_case.input_file)
    assert test_case.actual_matches_expected(actual)
#

Need to come up with a clever solution for supporting bytes and strings though haha, and have regex support for the needle I guess

weak sorrel
#

I have lines like this in my text file:

--More-- ^M         ^M

How do I find and replace them to blanks in vi?

I tried

:%s/--More-- ^M ^M//g

But it doesn't work. I don't know what that ^M is

lavish storm
#

you were kinda there, but don't type ^M verbatim, do ctrl + v (hold) then m

shrewd stratus
#

Ctrl-V (insert raw character) then press Enter/Return

frosty depot
lost knot
#

Which Linux distro I can use for programming?

wise forge
lost knot
#

What about fedora?

prime magnet
#

I have used KDE over Debian for ages but couple of weeks I started using Linux Mint and is a beautiful experience

#

I have also tried Ubuntu and is good too

lost knot
#

Hmm

prime magnet
#

I prefer deb over rpm (answering your question), no scientific reason. I found deb management more natural

wise forge
#

it is common to use debian family and alpine for container images

#

but alpine is really not meant for development

#

debian is way more stable and easier to use

prime magnet
#

oh good point about docker images. Most of images you find out there are debian based, including official python images 😄

formal schooner
#

personally i recommend fedora, i find that administering a fedora system is much easier than administering a debian system. i also think dnf is easier to use than apt.

wise forge
prime magnet
formal schooner
#

oh i see! i totally misunderstood what you meant

prime magnet
#

probably you understood fine and I explained it wrong

lost knot
#

kubuntu hmm

signal ibex
#

How does software like lshw get data from memory module SPD?

#

Looking at the source code, I am not sure if it gets it from a device file.

main olive
#

Hi

main olive
#

Hi

fickle granite
main olive
#

hey i am using netcat does anyone know what nc -ul does
ping me if you know

weary bramble
# main olive hey i am using netcat does anyone know what nc -ul does ping me if you know

https://www.unix.com/man-page/Linux/1/netcat/
-u says use UDP mode
-l means behave as a listener
you'll also need to supply a port number or the command won't work

near ravine
#

Need help deploying a flask application with apache2.followed lots of guides nothing seems to work

shut olive
#

Hello Guys. I am trying to install ubuntu on my HP Compaq dc5800 but it is giving me an Kernel Panic Error 0x00000009
does anyone knows what it is and how can i fix ?

weak oyster
# shut olive

Was this after going through the installer and rebooting? What Ubuntu version is this?

shut olive
#

the latest 22.04.1 LTS

#

through installer

wise forge
#

Lenovo ftw

jovial patrol
#

os: panic

wise forge
shut olive
#

i tried

#

same issue

#

tried lubuntu but still the same

wise forge
#

Oh I remember something

jovial patrol
#

I've heard POP os is a pretty good alternative for HP laptops.

wise forge
#

During installation of HP manually downloaded drivers can be required inserted before installation start

jovial patrol
#

Since HP dev one it also has all drivers supported.

shut olive
#

so because it is an old pc it needs an older version of ubuntu for like 18 lts version maube

proper vigil
#

If I have Zsh + OhMyZsh installed, and need to install the Poetry auto completions, which one do I install?
The one for Zsh or the one for OhMyZsh?

Mostly can someone help me understand in general where do I install when plugins come for both of them?

fickle granite
#

If there really are two, I'd pick the OhMyZsh one, on the assumption that it's newer and shinier

main olive
#

Hi, how can I copy a file -> replace all instances of a certain text from that file and paste than new replaced file in a new directory

opaque ginkgo
#

that looks like homework

#

though I will suggest taking a look at the sed command

main olive
#

This is a task on this udemy course self paced

#

I am just lost that's why I am asking if someone could point me in the right direction

main olive
#

hoping to pipe things together

static silo
#

Hello,

I'm writing a Bash script and I'm trying to get both the PID and the output of a process executed in a subshell (thanks to command substitution). I was able to get the output of the process but I can't seem to figure out how to get its PID (I'm still a beginner in regarding to subshell behavior).

This is what I've done so far

# Assuming that cmd_to_run is the process to run
my_command_output=$(cmd_to_run)

# How do I get the PID of cmd_to_run? I've tried $! but it doesn't work in subshells) 

Thank you so much!

wise forge
#

it has pid as resulting process ID

#
from subprocess import Popen
print(Popen("ls", shell=True).pid)

P.S. the process can be not finished at that time, it requires waiting for its end with prod.wait(), it already has assigned pid though

p.S. and
Popen.pid
The process ID of the child process.
Note that if you set the shell argument to True, this is the process ID of the spawned shell.

main olive
#

Hi

#

How can I pipe this

#
sed -i -r 's/\-{3}/\s\-\s/g' ./test/CainsJawbone.unix.utf8 ```
#

to a new file

#

like whatever the output is

#

i put it in a new file

#

in bash

wise forge
#

> redirects output and creates new file

#

>> adds to the end of file if possible
| redirects output to a next chained command

main olive
#

Oh okay

main olive
#

Here

#

I did

#

Cp file newfile

fading ferry
#
Last login: Tue Sep  6 18:16:37 on ttys004
You have new mail.
/Applications/Python\ 3.8/Install\ Certificates.command ; exit;

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
user-MacBook-Air:~ user$ /Applications/Python\ 3.8/Install\ Certificates.command ; exit;
 -- pip install --upgrade certifi
Collecting certifi
  Using cached certifi-2022.6.15-py3-none-any.whl (160 kB)
Installing collected packages: certifi
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/certifi'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 21.1.1; however, version 22.2.2 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "<stdin>", line 44, in <module>
  File "<stdin>", line 24, in main
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8', '-E', '-s', '-m', 'pip', 'install', '--upgrade', 'certifi']' returned non-zero exit status 1.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
main olive
#

hi

#

how to match accented characters

#

#

à

#

stuff like this

dapper musk
#

wdym by match? if you want to match Á specifically just put it in regex. if you want A to match Á then as far as ik there is no way of doing this just using pure regex however you can try converting input to ASCII from wharever encoding that you are using(for example by using iconv) and then running regex on it. if you want to match word with Á then you probably should use [^\s]+ ie any character that is not whitespace

main olive
#

alright

#

is there a way to convert byte array to string in bash?

fickle granite
#

I don't think bash has byte arrays as a type

main olive
#

oh okay

#

I converted hex to bytes

#

and i am stuck there

#
grep --color='auto' -P -o "[^[:ascii:]]" ./data/CainsJawbone.utf8 | sort | uniq -c | sort -r | cat -v | od -x | tail -4 | head -1 | xxd -r -p```
dapper musk
#

you want to convert hex to sring?

main olive
#

yes

main olive
main olive
dapper musk
#

then you can just convert hex to byte and then byte to char and just print it. or you can do it the C way and just print byte directly skipping abstractions

main olive
#

how to od byte to char?