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

Powered by : @r_channels
Download Telegram
finnaly switched

I finally made the switch to Linux from windows last night and loving it so far, I can't believe how much easier it is to connect Bluetooth devices in Linux, it's a snap

https://redd.it/czn07o
@r_linux
Trying to set up an Open University LUG. Anyone else here who's also a student?

I'm starting the Open University, next month, and was surprised that there's no Linux or Open Source group. So I'm wondering if there were any other OU students here that would like to help me get an OU LUG off the ground?

https://redd.it/czioak
@r_linux
stringhasher - A simple utility to get an int hash in a certain range from a string.

[stringhasher](https://gitlab.com/RobertZenz/stringhasher) allows you to hash a given string to an int hash in a certain range. You can grab [1.0 from the GitLab releases](https://gitlab.com/RobertZenz/stringhasher/-/releases). For example:

$ stringhasher "abcde"
450550038

$ stringhasher -l4 -u12 "abcde"
9

Internally it uses [murmurhash1](https://en.wikipedia.org/wiki/MurmurHash) to hash the given value.

Why did I need such a thing? Well, I've collected a few contacts in my NextCloud addressbook over the years, and some "modern apps" are so nice and don't display the name of the contact but only the photo, if there is any. Otherwise they only assign a color to the contact, which doesn't do anything for figuring out who it is. So I wrote a shell noscript which generates automatic avatars for all my contacts with the first three letters of the first and last name in it. I also wanted to them to have a random color picked from a certain set, so I needed a way to derive a number from the name, hence this tool. Simplified usage example:

COLOR_1=eeeeec
COLOR_2=fce94f
COLOR_3=fcaf3e
COLOR_4=8ae234

hash=$(stringhasher -l1 -u4 "contact name")
color="COLOR_$hash"

echo ${!color}

And for every ones sake, here is the whole noscript that I used (it assumes the displayname to be in the format "lastname, firstname", though):

#!/usr/bin/env bash


COLOR_1="#fce94f"
COLOR_2="#edd400"
COLOR_3="#c4a000"
COLOR_4="#fcaf3e"
COLOR_5="#f57900"
COLOR_6="#ce5c00"
COLOR_7="#e9b96e"
COLOR_8="#c17d11"
COLOR_9="#8f5902"
COLOR_10="#8ae234"
COLOR_11="#73d216"
COLOR_12="#4e9a06"
COLOR_13="#729fcf"
COLOR_14="#3465a4"
COLOR_15="#204a87"
COLOR_16="#ad7fa8"
COLOR_17="#75507b"
COLOR_18="#5c3566"
COLOR_19="#ef2929"
COLOR_20="#cc0000"
COLOR_21="#a40000"

COLOR_F_1="#2e3436"
COLOR_F_2="#2e3436"
COLOR_F_3="#eeeeec"
COLOR_F_4="#2e3436"
COLOR_F_5="#eeeeec"
COLOR_F_6="#eeeeec"
COLOR_F_7="#2e3436"
COLOR_F_8="#eeeeec"
COLOR_F_9="#eeeeec"
COLOR_F_10="#2e3436"
COLOR_F_11="#2e3436"
COLOR_F_12="#eeeeec"
COLOR_F_13="#2e3436"
COLOR_F_14="#eeeeec"
COLOR_F_15="#eeeeec"
COLOR_F_16="#eeeeec"
COLOR_F_17="#eeeeec"
COLOR_F_18="#eeeeec"
COLOR_F_19="#eeeeec"
COLOR_F_20="#eeeeec"
COLOR_F_21="#eeeeec"

CONTACTS_FILE="$HOME/contacts.vcf"
AVATAR_DIRECTORY="$HOME/contacts"


grep --extended-regexp "^FN:" "$CONTACTS_FILE" \
| sed --regexp-extended "s/\r//g" \
| sed --regexp-extended "s/^FN://" \
| while read name; do
simpleName="$(/bin/echo -n "$name" | sed --regexp-extended "s/(.*)/\L\1/g" | sed --regexp-extended "s/[^a-z]+/-/g")"

if [ ! -f "$AVATAR_DIRECTORY/$simpleName.png" ]; then
shortenedName="$(/bin/echo -n "$name" | sed --regexp-extended "s/^([A-Z][a-zA-Z]{2}).*, ([A-Z][a-zA-Z]{2}).*/\U\1\L\\\n\U\2/p" | head -n 1)"
hash="$(stringhasher -l1 -u21 "$simpleName")"

echo "$name => $simpleName => $shortenedName => $hash"

background="COLOR_$hash"
fill="COLOR_F_$hash"

convert \
-background "${!background}" \
-fill "${!fill}" \
-font "Liberation-Sans-Narrow-Bold" \
-gravity center \
-pointsize 196 \
-size 512x512 \
label:"$shortenedName" \
"$AVATAR_DIRECTORY/$simpleName.png"
fi
done

https://redd.it/czq6pl
@r_linux
Is Windows update really that bad in comparison to Linux?

One of the main gripes you can be sure to hear about as to why someone switched is automatic updates. I hear you and I get it that Windows does push small updates rather frequently. Most of which are security updates. Security is a never ending battle. Given the target Windows is for malware it doesn't seem too unreasonable. If Linux had the same market-share on the desktop I would imagine similar update measures would need to be adopted. If we ever got that point I don't think many Linux distributions would be free anymore anyway. Someone has got to fit the bill for all that backend work. Microsoft has recently made some changes giving the user more control over how they manage their updates and if you are hell bent on not updating at all there are a number of ways to completely disable windows update. One claim I have heard is some people saying their files were deleted by Windows update. I'm not trying to discredit anyone but I have never experienced this on my work or personal machines, I know of no one who has ever experienced this, I worked IT during my undergrad and never experienced this. I have quite a few friends who have careers in IT and manage thousands upon thousands of Windows machines who have never experienced this. I've asked many coworkers and they have never experienced this. I have searched the internet for this issue and all I have found was a bug in the 1809 October update that may have deleted files but it appears more so that it created a Windows.old directory for no reason and moved files there and people couldn't find it. Regardless it has been fixed and is no longer an issue. Also we all know one of the main rules of computing is to keep backups of your important files no matter what operating system you are using.

https://redd.it/czj8tg
@r_linux
My personal Linux story and a thank you

I was talking to a friend earlier, after we were talking about some early games we played and what kind of hardware we had back then, a flood of memories came crashing over me. I wanted to share that with you today, for no real particular reason other than that I feel thankful and hope it'll do something for you.

I grew up incredibly poor as the only child of a single mother (who was a teacher's assistant, which pays squat here.) Our very first computer was an Amiga, I am not sure which exactly, perhaps a 1000 or 2000? It was already kinda outdated back then, and it was a gift from a friend who owned a computer shop - stock he couldn't sell anymore.

In the late 90s, however, is when my story with Linux began. A friend of the family from the US came over to visit, he was a programmer working for IBM. Little me back then told him that I wanted to make video games later, because I had played some games on a NES at a friend's house. He told me that if I wanted to do that, I would have to learn programming.

Later he would talk to my mother, offering to give us his IBM computer since he was going to be getting a ThinkPad soon anyway; my mother agreed to pay for the overseas shipping costs and a month or two later a couple of massive boxes arrived at our house. Inside of it were the following:

* An IBM Personal Computer 350
* An assortment of floppy disks with software: a Linux distribution, and a C compiler
* A copy of K&R's C Programming Language book

The book had a note written inside of it too: "If you want to make games, you better begin early."

The PC was preinstalled by him with the Linux distribution that was on the floppy disks, I think it was Yggdrassil but I am not sure, but I do know it was running WindowMaker as the desktop environment; or at least something close to it.

That gift changed my life, I am a programmer these days and do indeed make small games in my spare time, though my day job is much more boring than that! I grew up in a family where opportunities were rare and we barely got by, but thanks to his generosity I stood a chance at making something of myself; rather than going outside in a crime ridden neighbourhood.

But not just him, but all the developers who made the Linux kernel, GNU and all the many projects I relied on. I was much too poor to afford things like Windows back then; and I didn't need to. Thanks to the free software movement I was not only liberated in my freedoms, but it also gave opportunities to people like myself who didn't have many; and continues to open opportunities for many poor people to this day.

Without GNU and Linux, I wouldn't be where I am today, and I am not sure I'd like to know where I would be.

Thank you.

https://redd.it/cztidt
@r_linux
Why do you use linux as a casual user?Do you use linux only or do you dualboot?

there are obvious benifit to linux such as The linux kernel for exemple. The customisability and (for some distro) ability to install and get all your things updated with a single command. But do you think you miss something from windows? if so do you dualboot?

https://redd.it/czv05f
@r_linux
State of touch support on linux in 2019

I've been using linux for a few years already, but none of my laptops had touch capability. I've been thinking about getting one with touch and 2-in-1 abilities. How is touch integration in linux? I mainly used GNOME over the years and it seems to be designed for touch, and the scaling is also good at least for integer sizes. I also wonder if it works at all on other environments like KDE or WMs like i3.

https://redd.it/czvwcv
@r_linux
[OC] code and comment weight: linux kernel 5.1.14 source code (link to used noscripts in comments)
https://redd.it/d00c3c
@r_linux
Linux in the Porsche Taycan

A little nugget in yesterday's news about the launch of Porsche's electric car, the Taycan: its information and entertainment system is [built](https://www.theverge.com/2019/9/4/20849437/porsche-taycan-turbo-ev-photos-mission-e-car-hands-on) on Linux.

https://redd.it/d019gy
@r_linux