LinuxQuestions.org
Visit Jeremy's Blog.
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 04-22-2021, 03:01 PM   #106
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 556

Rep: Reputation: 220Reputation: 220Reputation: 220

I learned how to use nmcli to connect to 802.1X protected network.

I learned that you can use xrandr to configure 2 monitors connected by the daisy chain as you would normally do.
 
Old 04-22-2021, 03:33 PM   #107
pinqvin
LQ Newbie
 
Registered: Dec 2008
Posts: 12

Rep: Reputation: 1
I have learned that my (?) Linux distro has a native hash checking utility with many options... Don't need to download and install one separately.

Code:
[sha|md5]sum
 
Old 04-23-2021, 06:30 AM   #108
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Apples
Distribution: Apple-selling shops, markets and direct marketing
Posts: 1,143
Blog Entries: 29

Rep: Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652
Quote:
Originally Posted by pinqvin View Post
I have learned that my (?) Linux distro has a native hash checking utility with many options.
They are normally different programs. shasum uses to be implemented in Perl, md5sum appears to be a C-program.

Code:
brillat@savarin:~$ man md5sum
Quote:
BUGS
Do not use the MD5 algorithm for security related purposes. Instead,
use an SHA-2 algorithm, implemented in the programs sha224sum(1),
sha256sum(1), sha384sum(1), sha512sum(1), or the BLAKE2 algorithm, im‐
plemented in b2sum(1)
 
1 members found this post helpful.
Old 04-24-2021, 08:46 AM   #109
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,263
Blog Entries: 1

Rep: Reputation: Disabled
Code:
% command -v ls
 
Old 04-25-2021, 01:21 AM   #110
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,264
Blog Entries: 10

Rep: Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161
^ or
Code:
type ls
 
Old 04-25-2021, 05:55 PM   #111
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,263
Blog Entries: 1

Rep: Reputation: Disabled
Code:
% wget http://remote/file & tail -f wget-log
 
Old 04-25-2021, 11:35 PM   #112
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,263
Blog Entries: 1

Rep: Reputation: Disabled
To test csum (md5um, sha...) on the fly, eg.
Code:
% mkfifo /tmp/csum
% wget -O - http://remote-site/hybrid.iso | tee /tmp/csum | dd of=/dev/sdb & (md5sum /tmp/csum > hybrid.iso.md5)
 
Old 04-26-2021, 06:55 PM   #113
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,745

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Let bash do an automatic fifo (or device) by using a "process substitution"
Code:
wget -O - http://remote-site/hybrid.iso | tee >(md5sum > hybrid.iso.md5) | dd of=/dev/sdb bs=1M
Or
Code:
wget -O - http://remote-site/hybrid.iso | tee >(dd of=/dev/sdb bs=1M) | md5sum > hybrid.iso.md5

Last edited by MadeInGermany; 04-26-2021 at 07:06 PM.
 
2 members found this post helpful.
Old 04-30-2021, 11:27 AM   #114
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 488
Blog Entries: 4

Rep: Reputation: 237Reputation: 237Reputation: 237
Just learned about csplit, thanks to shruggy in the programming forum. Very good to know about this when uploading multiple files in one text file, as is commonly done in the programming forum.
 
Old 05-02-2021, 12:34 AM   #115
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,464

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Emergency print kludge

While I was working on a system and wanted a hard copy of a config file to compare to another system's, I discovered that no print queues had ever been set up. And... the CUPS config software crashed while trying to set one up (now I know why no queues). Yes, I could have sftped that config file to another system with a working print queue but that gets old fast -- and I always forget to get rid of those copies -- then I thought: Ah ha! netcat!
Code:
$ cat path-to-file | netcat -C printer-ip-addr 9100
It appears to hang when the above command is issued but when you enter Ctrl-C, the printer kicks into action. No fancy printing (and maybe not duplexed even if the printer supports it) but works in a pinch.
 
Old 05-06-2021, 08:42 PM   #116
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,165

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
I use the following which allows passing options to the printer. Needs ssh authentication but as with the netcat solution is also just a one liner (no scp, ssh, lpr, rm, exit).
Code:
cat path-to-file | ssh hostwithprintqueue lpr [lpropts]
Evo2.
 
Old 05-15-2021, 02:48 PM   #117
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 747

Rep: Reputation: 295Reputation: 295Reputation: 295
Parameter Expansion in Bash (or probably all major shells) is amazing! I've used some parameter expansion in the past while manipulating text but this week I dove in to learn more. Time well spent!

https://www.gnu.org/software/bash/ma...Expansion.html

Enjoy!
 
Old 05-15-2021, 11:15 PM   #118
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,264
Blog Entries: 10

Rep: Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161Reputation: 5161
Quote:
Originally Posted by Chuck56 View Post
Parameter Expansion in Bash (or probably all major shells) is amazing! I've used some parameter expansion in the past while manipulating text but this week I dove in to learn more. Time well spent!

https://www.gnu.org/software/bash/ma...Expansion.html

Enjoy!
Oh yes!
There's a few I didn't know, esp. the last paragraph "${parameter@operator}".

Just keep in mind that many of these do not translate to other shells, e.g. dash, the default startup shell for Debian systems.
 
Old 05-16-2021, 12:45 AM   #119
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,745

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Apropos parameter expansion,
the term parameter means variable aka ${varname} or positional parameter aka ${1} ${2}

The following is from the ksh man page - it is missing in the previously posted URL and in man bash
Quote:
If the colon ( : ) is omitted from the above expressions, then the shell only checks whether parameter is set or not.
What does it mean?
An exercise:
Code:
var="hello"
[ "${var+x}" ] && echo "var exists"
[ "${var:+x}" ] && echo "var is not empty"
var=""
[ "${var+x}" ] && echo "var exists"
[ "${var:+x}" ] && echo "var is not empty"
unset var
[ "${var+x}" ] && echo "var exists"
[ "${var:+x}" ] && echo "var is not empty"
 
Old 05-16-2021, 06:03 AM   #120
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,263
Blog Entries: 1

Rep: Reputation: Disabled
Personally I dislike hello world examples. It is of no use - so one cant easy memorize learned features. I think even difficult examples are better. Not easy to understand them - but once you do - whoooa - that expression of full amazement. And from now on it sits in head. That whoooaaa moment is an anchor.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:31 AM.

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