tunawasherepoo

joined 1 year ago
MODERATOR OF
[–] [email protected] 65 points 7 months ago (1 children)

i interpreted it as the user's first DE was gnome :)

[–] [email protected] 10 points 7 months ago

Lock screen

Home screen (i applied a black tint since i had trouble reading white text against it)

I got them from lurking r/wallpaper though I wish i knew more of their original sources

[–] [email protected] 3 points 8 months ago (2 children)

try https://github.com/zhichaoh/catppuccin-wallpapers/blob/main/landscapes/tropic_island_morning.jpg

if you look in the same folder there's also ones for day, evening, and night

[–] [email protected] 0 points 8 months ago

What is the freakout?!?!?!?!?!?!?!? Maybe i want to read other people's code in a wacky comic-looking silly goofy totally awesome monospaced font!?!?!?!

[–] [email protected] 29 points 9 months ago

__LINE__ returns the line of code its on, and % 10 means "remainder 10." Examples:

1 % 10 == 1
...
8 % 10 == 8
9 % 10 == 9
10 % 10 == 0 <-- loops back to 0
11 % 10 == 1
12 % 10 == 2
...
19 % 10 == 9
20 % 10 == 0
21 % 10 == 1

In code, 0 means false and 1 (and 2, 3, 4, ...) means true.

So, if on line 10, you say:

int dont_delete_database = true;

then it will expand to:

int dont_delete_database = ( 10 % 10 );
// 10 % 10 == 0 which means false
// database dies...

if you add a line before it, so that the code moves to line 11, then suddenly it works:

// THIS COMMENT PREVENTS DATABASE FROM DYING
int dont_delete_database = ( 11 % 10 );
// 11 % 10 == 1, which means true
[–] [email protected] 3 points 9 months ago (1 children)

I'm curious on the context for this one... to me i read it as not blaming your dog directly for e.g. farting on you, instead you just blame doggo's asshole for being an asshole 🤣

[–] [email protected] 2 points 9 months ago

Aw thanks! I'm glad I was able to help :)

[–] [email protected] 2 points 9 months ago* (last edited 9 months ago) (2 children)

It's two tools: c and v for copy and paste respectively.

Say you want to copy an output of a command, say

grep -i 'abc' file.txt | sed 's/b/d/'

then you can easily add | c to the end to get:

grep -i 'abc' file.txt | sed 's/b/d/' | c

and this will copy to clipboard, specifically for KDE's clipboard manager, Klipper. If you wanted to see the help text for more ways to copy, you'd run c on its own

The benefit is the tool won't break between x11 and wayland, but the downsides are that it's tied to klipper, and you cant see more clipboard metadata, like mimetypes

If you only use wayland, i'd recommend using wl-clipboard, and alias c=wl-copy and alias v=wl-paste it's a better tool, imo.

Should you still want to use my lil snippet, you will need to create these files yourself, i suggest either in your $HOME/.local/bin/ or /usr/local/bin/. And don't forget to chmod +x them so they are executable.

Happy experimenting :)

[–] [email protected] 3 points 10 months ago

maybe bring back the hyper key! (Wikipedia link)

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Sorry 😅 I probably could have taken a closer look at other comments, but in any case this paints a nice picture for me, thank you :)

Edit: Actually I decided to boot into Windows and test this a little myself, and turns out when bluetooth is on it is discoverable (Windows is a peripheral, the BlueZ device is a central wanting to connect). When i connected from my phone to my computer, It seemed more accurate to what you described too. If you dont use bluetooth disable it, or make your device not discoverable. 😅

It does help to know it was a notification and to know what was in it. I was able to find an image which looked similar and led me to find a Windows feature called Swift Pair. It lets you connect to a bluetooth device via notification, rather than in the settings. You can try disabling Swift Pair if it is enabled.

Here is my conclusion:

As others said, BlueZ is essentially the program that allows bluetooth to run on Linux. The name alone doesn't tell you if the person behind has malicious intent.

It's possible that somebody was making a swift pair compatible device using Linux. Maybe they thought 5AM was early enough that the swift pair notification would only show up on their computer since they wouldn't be able to prevent other people from seeing it otherwise 🤷

It could also just be some device rebroadcasting itself on a clock. I'm not sure why or what you would do with this other than to annoy people?

If you especially don't trust your neighbors and want to imagine a worst case scenario, it could be spoofing something like a bluetooth keyboard, rebroadcasting until someone connects, and runs a series of shortcuts / commands to infect your computer to replicate the virus further. ((Issue is, it doesn't make sense they'd develop on Linux with BlueZ even though the virus could only propagate on Windows. Kinda fun to think about regardless though))

I hope that answers your question :)

[–] [email protected] 1 points 1 year ago (3 children)

I think i'm still confused on how you came to know the device was trying to connect to you :D Was there a Windows notification? Did it ask you to enter or confirm a code? Were you using bluetooth in general at the time?

I guess my main proposal is that central device can't begin to initiate to another central device. In the discovery phase, a central device is like an ear, and a peripheral device is like a mouth. Ears can't speak to other ears, and mouths can't listen to other mouths. Mouths don't know if ears are even there to listen, only the ears can initiate a connection.

In most cases Windows is like an ear. Neither a central nor peripheral can initiate a connection to you. Only you can initiate a connection to some other peripheral.

However Windows can act like a mouth under specific circumstances, specifically I found that you can use your computer as a hotspot and share over bluetooth. Sharing over bluetooth means Windows opens its bluetooth mouth to tell anyone willing to listen that it is connectable. So if you were doing something bluetooth related at the time it could have allowed a foreign (central) device to initiate a connection

[–] [email protected] 2 points 1 year ago (5 children)

This does sound very unusual that it would try to connect, so I wanted to add more context about how bluetooth works, which might help figure out where to look next or if you should look into it at all

In bluetooth there is the idea of a central device and peripheral device. Peripheral devices advertise of their existence in hopes that a central device establishes a connection. The central device always has the final say. For example, a phone (central device) connecting to bluetooth headphones (peripheral device).

Your computer should really only act as a central device. So you get to choose which devices are allowed to connect .. but there are two exceptions:

  • a device can auto-connect to a previously paired device. Maybe you accidentally paired with the Linux device, or thought it was another device. You can unpair / forget the device if you did.
  • special software which auto-connects to devices. For example the nintendo switch auto-connects to controllers when the "change grip/order" menu is open. I think this would be very unusual, even for malware.

Technically, the bluetooth spec does allow bluetooth devices to be a central and peripheral at the same time. In theory if Windows is advertising itself as a peripheral, then the Linux device could connect as a central. The issue is, I don't know if or when Windows is sending these bluetooth advertising packets. Maybe when bluetooth settings are open or if you have a wifi hotspot enabled?

Also, not all devices support running both modes at the same time, so you can rule it out if the device can't be a peripheral. According to this guide, this is how you check that: https://www.howto-connect.com/see-if-windows-10-pc-supports-bluetooth-low-energy-peripheral-role/

If it just appeared in the connectable device list, then there is nothing to worry about really, bluetooth has some range to it, and it could just be a neighbor's device.

 

$ cat /usr/local/bin/c

#!/bin/sh
if test -n "$1"; then
	STDIN="${1}"
elif test ! -t 0; then
	STDIN=$(cat)
else
	echo 'Usage:'
	echo '	c &lt; /path/to/file'
	echo '	c text-to-be-copied'
	echo '	command | c'
	exit 1
fi

qdbus org.kde.klipper /klipper setClipboardContents "$STDIN"

$ cat /usr/local/bin/v

#!/bin/sh
qdbus org.kde.klipper /klipper getClipboardContents

This is what I like to use :)

0
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

I'm doing a solo coding project for work. It's a tool that you interact with similar to npm or cargo, where you can create a new workspace, run / test etc. Importantly, you have to be in the working directory for the commands to work...

Yesterday I decided to go home early to do remote work at home. Before i left i quickly did git add ., committed and pushed. I turned on my computer this morning, ran git pull, and noticed that... only some files got pushed, but more importantly none of the code i wrote yesterday made it through. Yup, I was still cd'd into my workspace folder and not at the project root, so I only committed the mock workspace folder 😄

Luckily i didnt write or change much this time, but lesson learned: git add -A or git commit -am '...'

view more: next ›