Linux - Reddit – Telegram
Linux - Reddit
759 subscribers
4.18K photos
207 videos
39.8K links
Stay up-to-date with everything Linux!
Content directly fetched from the subreddit just for you.

Powered by : @r_channels
Download Telegram
Some tips for limiting damage remote users can do through OpenSSH
https://distrowatch.com/weekly.php?issue=20210405#qa

https://redd.it/mk8duk
@r_linux
Can someone tell me why my while loop never ends

Hello team

I created this noscript to increment IPs and Vlans to copy to a text file and copy and paste on switches. The numbers are incrementing, the only issue is that it doesn't stop. I want the third octet in my IP to stop at 250 and I was the last Vlan to stop at 1250. The third octet start is entered as 1 and the starting VLAN is 1001. Im a bit of a starter on Shell noscripts, so any help will be appreciated.

\#!/bin/sh -x

MaxValue=250 # highest valid IP octet value

MaxValueVlan=1250

Vlan= 1001

\#echo -n "Enter IP address: "; read IP

echo -n "How many IP addresses do you need: "; read count

echo -n "Which Vlan: "; read VLAN

echo -n "Whats network: "; read Third

​

Pre=10

Sec=150

Fourth=1

while [[ $count -gt 0 \]\] || [[ $vlan -gt 0 \]\] || [[ $Third -gt 0 \]\]

do

if [[ $Third -eq $MaxValue \]\] || [[ $vlan -eq $MacValueVlan \]\] ; then

\# here you'll need to increment the third level IP value,

\# but that might cascade into the second, or the first.

\# consider the case of 17.255.255.255 + 1

echo "edge case needs to be written"

fi

\#echo $baseaddr.$lsv

echo $vlan

echo $Pre"."$Sec"."$Third"."$Fourth

\#lsv=$(( $lsv + 1 ))

vlan=$(( $vlan + 1 ))

Third=$(( $Third + 1 ))

count=$(( $count - 1 ))

done

exit 0

https://redd.it/mk592e
@r_linux
CLI replacement for Baobab (disk usage analyzer)?

my current method is slow and clunky, but I guess I could noscript it into a solution. I'll do sudo du -chs / to see the overview and a total, then will do a du -bcs / | sort -n (show in bytes and then sort numerically) to see the worst offenders at the bottom, then will continue the process the with one or two of the worst offender folders, until i've developed a sense of where the problem is...

I don't need something with a pretty display of where the problem is, but it would be nice to have a MC view of the system, and be able to go down the tree to see where the largest files are. Sometimes I may have a suspicion of where the problem is (/var/logs/ or something), but many times i do not.

https://redd.it/mk9wuq
@r_linux
uhh can someone tell me what's going on
https://redd.it/mkbh07
@r_linux
Emacs Tutorial It's semantic how Emacs binds all keys

From the prelude, Emacs big-bang its universe simply from M-x. It invoke interactive functions with M(Meta)-x(Execute).

Then it go one more step, replaces the double keys of M-xwith the single key of Ctrl, and even further truncates function’s name to its initial letter.

Now instead of redundant M-x forward-char, we straightforwardly strike C-fto move cursor forward a character.

The logic here is obvious: C (Ctrl) substitutes for M (Meta)-x, while f for forward-char.

We pause a moment here to organize our thoughts.

​

1. Key “Meta” has source meaning in etymology, so it is applied to invoke full-name functions,
2. Key “Ctrl” corresponds to “Command”
3. Key “f” is abbreviated for “forward-character”

So differs from Vim, we could easily conclude that Emacs was designed to bind keys semantically.

With such semantic key bindings, we could manipulate Emacs smoothly as veterans even without remembering one key binding.

The subsequent sessions starts to the cursor movement semantically from:

1. Character and Word
2. Line and Sentence
3. Vertical movement
4. Vertically Page down and up
5. Buffer
6. Logic Text Unit
7. Keys layout
8. Concepts

read the complete github project

#

https://redd.it/mjw3to
@r_linux
Bash noscript to set wallpapers from your favourite subreddits

Not sure if this is the right place to post this, but I'm guessing this might be useful for some people.

#!/usr/bin/env bash
# This noscript needs imagemagick and feh

SUBREDDITS=$(cat <<-END
earthporn/top
cityporn/top
skyporn/top
beachporn/top
waterporn/top
auroraporn/hot
exposureporn/hot
END
)

SUBREDDIT=$(echo "$SUBREDDITS" | shuf -n 1)

echo "Choosing $SUBREDDIT"
mkdir -p ~/.wallpapers
wallpaperlocation=~/.wallpapers/current-wallpaper.jpg
urls=$(wget -O - -o /dev/null
http://www.reddit.com/r/$SUBREDDIT/.rss | grep -oP 'https://i.redd.it/\w{13}\.(jpg|png)')

for url in $urls; do
wget -O $wallpaper
location $url
islandscape=$(identify -format '%[fx:(w>h)]' $wallpaperlocation)
resolution=$(feh -L "%p" $wallpaperlocation)
is
highres=0;
if [ $resolution -gt 1000000 ]; then
ishighres=1;
fi;
if [[ $is
landscape = 1 && $ishighres = 1 ]]; then
feh --bg-scale $wallpaper
location
break;
fi
done;

https://redd.it/mkf4kt
@r_linux
My hospital's TV uses Debian lol
https://redd.it/mkhajk
@r_linux
Looking for advice

Hey everyone, I need advice with choosing a distro that would run fairly decent on my late 2008 Macbook Pro. It has a core 2 duo 2.66GHz CPU with 4GB DDR3 memory and an Nvidia Geforce 9600M 256MB GPU.

I don't want to run osX lion anymore and doing a Dosdude1 Sierra causes the mac to overheat severely and I'm not ready to retire the machine yet since it still looks and works perfectly. But my issue is I cannot find a decent OS that I feel comfortable with that doesn't cause performance / overheating issues.

I've tried the following distros:
Ubuntu: Not fond of the desktop environment
Elementary OS - looks similar to mac
OSMint Cinnamon - it runs fairly well but has some performance issues
Pop! OS - runs okay but takes a while to boot and I'm not fond of the distro TBH
Solus Budgie - I like the UI but I'm having weird freeze issues when I connect it to the net.

I'm currently considering Manjaro, Arch or Deepin. What are your suggestions? I want a lightweight and responsive distro, but I do want something that still looks good.

https://redd.it/mkkt57
@r_linux
dd command linux

If I want to clone one compact disk “A” to compact disk “B”, will the data from “A” be deleted?


If so, how to do it without losing data?


I need to clone very important data and I can’t lose it.

~~filler filler filler filler filler filler filler~~

https://redd.it/mkp0pg
@r_linux
KDE e.V. is hiring 2 positions for environmental sustainability project
https://mail.kde.org/pipermail/kde-community/2021q2/006846.html

https://redd.it/mks1mg
@r_linux
Turkish government using linux on their school computers and smartboards (They made a special distro named pardus)
https://redd.it/mksn5i
@r_linux
Occasional audio hiccups

I would like to touch a sensitive topic that has plagued my setup for many years, sometimes more frequently, other times less frequently. I think it's an issue that many users might experience here and there.

I use gentoo for many years (more than 10) with this setup lately, which seems to be the best I ever had in terms of low latency/snappy desktop feel even during load:

1. Xanmod Kernel https://github.com/xanmod/linux/releases with custom config, based on default xanmod's config.
2. https://github.com/hamadmarri/cacule-cpu-scheduler scheduler
3. https://github.com/Nefelim4ag/Ananicy to optimize nice values for programs
4. kde with pulseaudio

I experience once or twice per day a hiccup during audio playback, mostly on youtube via firefox. I have ruled out network, since the buffer is full and the hiccups might happen also on strawberry player. The hiccup can happen also during low load average, no cpu/io usage. I don't recall any hiccups, when viewing movies via vlc/mpv.

I have experimented on the past with MuQSS as well.

What is your experience? Do you experience in general, occasional hiccups too? Could it be players' issue?If your setup is flawless, share it!

https://redd.it/mkv0l7
@r_linux
Interesting thought using CDRs as USB keys

I know this is just nostalgia talking. But it would be like 90s kid cool to use a CDR to log into Linux. Also to remain logged in it would have to re-read the disc periodically, or to check sudo privileges.

My question is would it be just a drop-in replacement or do I need to do some weird things for it work.

Thanks in advance and Linux rules. : ]

https://redd.it/mkqzxn
@r_linux
Who watches the watchers?

bye linux community. recently published information about pocketchip a device that until two days ago did not interest anyone. Thanks to my post, many discovered it, but WHAT IF SOMEONE CONSIDERS THAT IT IS NOT RELEVANT, WOULD THEY DELETE IT? under what criteria? then in another post I talked about bunsenlabs heir to another distribution called crunchbang #! which for many users is mythical. apparently it was deleted as irrelevant when I see daily other posts with desktop screenshots just for posturing and totally irrelevant. It does not seem correct to me since in these times of economic madness many people are acquiring cheap computers that are useful. What better than a thinkpad considered an armored tank such as the x230 model as well as a Netbook that is technically garbage but thanks to bunsenlabs it would allow many people at least to have a working computer. All these computers allow me to compose music, draw, write, browse, edit photos, and many more functions. it doesn't seem irrelevant to me. for this reason I think it is not worth staying here. I had plans to continue publishing information on things that surely many young users do not know, even preparing a post on how to build a piratebox with pocketchip to share files anywhere anonymously, an important issue in these times of massive surveillance worldwide. but I am not going to endure censorship from strangers. I thought it was a good community but I was wrong. This is why I will delete all my posts in this community. Regards, and thank you very much.

https://redd.it/mknrkw
@r_linux