LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-19-2022, 12:03 AM   #241
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350

Quote:
Originally Posted by MadeInGermany View Post
@////// Missing a +1 ?
The following allows special characters in filenames,
and avoids playing a title twice in a row.
Code:
#!/bin/bash
PL=$( find /xxx/music -name "*.mp3" -type f )
NUM=$( echo "$PL" | wc -l )
{
while true; do
  until
    r=$(( RANDOM%NUM + 1 ))
    [ $r != $lastr ]
  do :
  done
  lastr=$r
  s=$( echo "$PL" | sed -n "${r}p" )
  echo "HTTP/1.0 200 OK\nContent-Type: audio/x-mp3stream\n\n"
  cat "$s"
done
} | nc -l -s address -p 8020
thanks man

i tried to make it as small as i could, there is character limit at LQ's profile/signature.
all those COLOR tags ...
 
1 members found this post helpful.
Old 01-20-2022, 11:54 AM   #242
cjspizz
LQ Newbie
 
Registered: Nov 2018
Location: Rock hurtling through space-time
Distribution: Linux Mint 20.3 "Una"
Posts: 21

Rep: Reputation: 2
Question

Quote:
Originally Posted by ////// View Post
it is mp3 server that you can listen at 127.0.0.1:8020
Do you mean I can setup a local server to broadcast and listen to my music remotely with this script? Where can I find more info on setting that up?
 
Old 01-22-2022, 08:52 AM   #243
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by cjspizz View Post
Do you mean I can setup a local server to broadcast and listen to my music remotely with this script? Where can I find more info on setting that up?
Really all the info is there in the script.

I once tried it, it works - remotely too, if you know your external IP address and can tell your router to open port 8020 (or whichever port you choose).

The script is very limited though - if you want to set up your own streaming radio station, I suggest starting with exactly that as a search term.
I found: https://www.linuxuprising.com/2019/0...net-radio.html
 
3 members found this post helpful.
Old 01-23-2022, 11:11 PM   #244
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Quote:
Do you mean I can setup a local server to broadcast and listen to my music remotely with this script? Where can I find more info on setting that up?
Quote:
Originally Posted by ondoho View Post
Really all the info is there in the script.

I once tried it, it works - remotely too, if you know your external IP address and can tell your router to open port 8020 (or whichever port you choose).
yea, it works, i suggest you to use ondoho's solution tho.
 
1 members found this post helpful.
Old 01-27-2022, 08:49 AM   #245
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I just learned from another thread that if you use df with the pathname of some file as an argument, it gives a one-line answer relevant to the partition that file is on. I never thought of using an argument for df before, though I do regularly use the -h option.

Last edited by hazel; 01-27-2022 at 08:51 AM.
 
Old 01-28-2022, 06:13 PM   #246
Trihexagonal
Member
 
Registered: Jul 2017
Posts: 362
Blog Entries: 1

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
That the same command to spoof your Ether MAC on FreeBSD does not work on Linux.

That Linux was vulnerable to the polkit pwnkit exploit before patching and FreeBSD usr accounts were not.

How the Linux file system hierarchy differs from FreeBSD and where those files are housed in the Linux directory tree.

That sudo is for forgetful people like su is for people who don't forget to log out of the root account when working from the terminal. I've never used sudo or doas on FreeBSD and am very comfortable and competent working as root.

If I could just get the syntax right for that launch command

root@jigoku: # launch nuclear strike --DC
sh: launch: not found
root@jigoku: #
 
1 members found this post helpful.
Old 02-18-2022, 03:58 PM   #247
Trihexagonal
Member
 
Registered: Jul 2017
Posts: 362
Blog Entries: 1

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
This week I learned there is something called an "impossible situation". This encountered while using apt, it's similar to a situation encountered while using ports informally referred to by FreeBSD users as "no big deal". The biggest difference that you have to track it back several error messages to determine what needs done to fix it in ports.

I saved the output of the impossible situation, doing the impossible and back to business as usual:
Code:
┌──(jitte㉿itachi)-[~]
└─$ sudo apt update                                                                 16 ⨯
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Get:2 http://kali.download/kali kali-rolling/main amd64 Packages [18.0 MB]
Get:3 http://kali.download/kali kali-rolling/main amd64 Contents (deb) [40.6 MB]
Fetched 58.7 MB in 26s (2,237 kB/s)                                                     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
48 packages can be upgraded. Run 'apt list --upgradable' to see them.
                                                                                         
┌──(jitte㉿itachi)-[~]
└─$ sudo apt upgrade         
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libwacom9 : Depends: libwacom-common (= 2.0.0-2) but 1.12-1 is to be installed
E: Broken packages

┌──(jitte㉿itachi)-[~]
└─$ sudo apt-get remove libwacom2 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  fonts-roboto-slab
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libinput-bin libinput10 libwacom-bin libwacom-common libwacom9
The following packages will be REMOVED:
  libwacom2
The following NEW packages will be installed:
  libwacom9
The following packages will be upgraded:
  libinput-bin libinput10 libwacom-bin libwacom-common
4 upgraded, 1 newly installed, 1 to remove and 44 not upgraded.
Need to get 244 kB of archives.
After this operation, 30.7 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

*snip*

┌──(jitte㉿itachi)-[~]
└─$ sudo apt-get update           
Hit:1 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
                                                                                         
┌──(jitte㉿itachi)-[~]
└─$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  fonts-roboto-slab
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
  default-mysql-server gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-0
  php-common
The following packages will be upgraded:
  apparmor binutils binutils-common binutils-x86-64-linux-gnu cpp-10 cpp-11 exploitdb
  g++-10 g++-11 gcc-10 gcc-10-base gcc-11 gcc-11-base lib32gcc-s1 lib32stdc++6
  libapparmor1 libasan6 libatomic1 libbinutils libcc1-0 libctf-nobfd0 libctf0
  libgcc-10-dev libgcc-11-dev libgcc-s1 libgfortran5 libgomp1 libitm1 liblsan0
  libobjc-10-dev libobjc-11-dev libobjc4 libquadmath0 libstdc++-10-dev libstdc++-11-dev
  libstdc++6 libtiff5 libtsan0 libubsan1 python3-dataclasses-json
40 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 125 MB of archives.
After this operation, 322 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

*snip*

┌──(jitte㉿itachi)-[~]
└─$ cat /etc/os-release                                                              1 ⨯
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2022.1"
VERSION_ID="2022.1"
VERSION_CODENAME="kali-rolling"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"
                                                                                         
┌──(jitte㉿itachi)-[~]
└─$
 
Old 02-18-2022, 04:09 PM   #248
Reziac
Member
 
Registered: Aug 2018
Location: Brendansport, Sagitta IV
Distribution: PCLinuxOS
Posts: 152

Rep: Reputation: 42
Today I learned that KDE-Neon (not an everyday system) loses passwords, a problem I haven't run into since RedHat6.

It was set to autologin.

The password is either one very short word, or none at all.

Updated it. Rebooted after. Surprise! You now have an unknown password!
 
Old 02-21-2022, 07:17 AM   #249
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369
Blog Entries: 1

Rep: Reputation: 49
so it was true then

 
3 members found this post helpful.
Old 02-21-2022, 08:27 AM   #250
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
For years I've followed practices of:
  1. From with emacs using grep I've always searched pwd for strings and used the emacs search results to browse the located results
  2. From the command line I've always used find to locate relevant files in a tree and exec'd grep to search for a string
I've learned that emacs supports the find grep as part of it's search mechanism, ergo the results can now also be able to be more directly browsed.
 
1 members found this post helpful.
Old 02-21-2022, 09:41 AM   #251
Reziac
Member
 
Registered: Aug 2018
Location: Brendansport, Sagitta IV
Distribution: PCLinuxOS
Posts: 152

Rep: Reputation: 42
Quote:
Originally Posted by ychaouche View Post
so it was true then
Yes!!

I also learned that resetting the password from the bootup-command-line does not work. It looks like it works; it says it works; it does not work. It even writes a new /etc/shadow, where the password is kept, but it still does not work.

For my next trick, I tried renaming /etc/shadow to try to force it to demand a new password, and then boot stalls at the point where it would ask for a login. So I today learned that you cannot have a null /etc/shadow.

Foiled again, I thought to try replacing the contents of /etc/shadow with a known-good /etc/shadow, and then I learned that while I can rename it and view it, I cannot paste a file into /etc. Nor can I edit it. Not even with that HD attached to another system, where Take Ownership appeared to work, and says it works, but it still does not work.

So today I learned that I still hate Ubuntu (and by extension, Debian), which is what Neon is under the hood.
 
Old 02-21-2022, 11:59 AM   #252
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
I also learned that resetting the password from the bootup-command-line does not work.
Do you mean from live media? You'll need to chroot in, mount your partitions, then edit the files on the machines hard drive/ssd, not the files on the live media.

Quote:
I cannot paste a file into /etc. Nor can I edit it.
You'll need to be root to access anything in /etc. Look at the directory and file permissions.

What do you get from
Code:
ls -l /etc
root.

What are the perms on
Code:
ls -l /etc/shadow
Only root can read/write it.

Could that be the problem that you had?
 
1 members found this post helpful.
Old 02-21-2022, 06:19 PM   #253
Reziac
Member
 
Registered: Aug 2018
Location: Brendansport, Sagitta IV
Distribution: PCLinuxOS
Posts: 152

Rep: Reputation: 42
Addendum: apparently it's not just me. There are several complaints over in reddit/kdeneon about being unable to log in after the latest update, tho I seem to be the only one who gets as far as a login screen. The others either get a black screen or the endless gear spinner.

Quote:
Originally Posted by teckk View Post
Do you mean from live media? You'll need to chroot in, mount your partitions, then edit the files on the machines hard drive/ssd, not the files on the live media.
I've tried it thus:
-- boot itself into root prompt
-- boot live media, mount HD
-- as an external USB drive on another installed system
See below. XFE-root mode worked when nothing else did.

Instructions I found went thus:

Grub, recovery mode, root shell.
Got a root prompt. Did not require password. (Appears I did not set one. None in shadow.)

mount -o rw,remount /
passwd username
produces the pair of password prompt and "updated successfully".
And it rewrites shadow.

shutdown -r

reboots. Same problem. Neither "root" nor "rez" and password, nor any combo thereof, can log in.

Tried nuking the password with the apparent blank password (bunch of numbers with colons mixed in) and that didn't work either.

Quote:
Originally Posted by teckk View Post
You'll need to be root to access anything in /etc. Look at the directory and file permissions.
What do you get from
Code:
ls -l /etc
root.
Forgot to check when I had root prompt up but in XFE it showed owner root, group root, -rw-rw-rw-

Turns out while it's mounted as an external USB drive, I can edit /etc/shadow in XFE-root mode, but not in Dolphin-root mode. (Have run into this before.)
But wasn't helpful.

Quote:
Originally Posted by teckk View Post
What are the perms on
Code:
ls -l /etc/shadow
Only root can read/write it.
-rw-rw-rw- root root

Quote:
Originally Posted by teckk View Post
Could that be the problem that you had?
Well, apparently not, Looks like it's hosed itself somewhere other than /etc/shadow.

Just from doing an update. (It was running before the update, no problem.)

I wonder if it's a variant of the Ubuntu/Mint bug from a few years ago, where just LOOKING in "video driver" settings, without touching anything, would hose GRUB. (Yes, really.)

Thanks for trying to help... I'd like to know how to fix this, but I suspect it's buggered somewhere not so obvious.

Last edited by Reziac; 02-21-2022 at 06:51 PM.
 
Old 02-22-2022, 04:44 AM   #254
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I wonder if it's a PAM thing. Maybe you've fallen foul of one of PAM's login conditions. You can find out those conditions by looking at the files in /etc/pam.d. There was a recent thread by someone who could get to root by using su but not by logging in as root. That turned out to be due to PAM setting stricter conditions for login than for su. But istr he was using a serial console, not a local one.
 
1 members found this post helpful.
Old 02-22-2022, 12:26 PM   #255
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Could Reziac please open a dedicated thread for this?
I don't like seeing this thread polluted with support requests.
(seems they've done it before, too)
I have reported Reziac's post #248 in the hope that a mod will move or remove these posts, incl. mine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alright, it's Wednesday. What is something you have learned *new* about Linux within the past 7 days? KGIII General 120 06-15-2021 05:19 AM
What is something new that you have learned about Linux this week? KGIII General 19 05-26-2021 01:51 PM
How do I grep my /var/log/secure file for the past 7 days or so many days? johnmccarthy Linux - Newbie 5 01-04-2013 09:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration