luthis

joined 1 year ago
[–] luthis@lemmy.nz 4 points 7 months ago

Already happened in China in 1958, but I don't believe ballots were involved...

[–] luthis@lemmy.nz 1 points 7 months ago (1 children)

centering the mouse on the game

Maybe I'm missing something, but.. why is this a problem? You can just like, move the mouse to where you want it?

I can't replicate this issue on mine. I recently somehow broke Gnome (again) during an update, so I finally went back to a tiling WM (awesome this time). I start the game in a separate desktop, and then when I need to do things outside of the game, I just change to another desktop using the keyboard shortcuts. Pretty sure this is possible in all WM/DEs on Linux.

[–] luthis@lemmy.nz 6 points 7 months ago

Apple will make you pay for anything apparently

[–] luthis@lemmy.nz 91 points 7 months ago (4 children)

Being a monarch or some kind of royalty seems to be excellent financially and often overlooked.

[–] luthis@lemmy.nz 2 points 7 months ago (1 children)

I think something like that would be an edge case. We aren't talking about Karen-land, people are worried about drugs, violence, and abuse.

[–] luthis@lemmy.nz 1 points 7 months ago

re-education camps.

shudder

Yes, exactly.

[–] luthis@lemmy.nz -1 points 7 months ago (1 children)

using sufficiently long passwords is your best defense

No, using 2FA is your best defense, along with wise recovery questions. It matters nothing if you know someone's password, but can't get the 2FA code.

[–] luthis@lemmy.nz 1 points 7 months ago

Brute force is only a thing when either they have the password hash, or the login portal is susceptible to brute force (ie shite). Both cases are rare.

[–] luthis@lemmy.nz 1 points 7 months ago

It doesn't matter in the slightest if you use 2FA.

[–] luthis@lemmy.nz 1 points 7 months ago* (last edited 7 months ago) (2 children)

Define 'strength'... against a dictionary attack? Brute force? Social engineering? 'forgotten password/recovery questions' hack? Stolen session cookie? Keyloggers?

If you're not aware of the above, take some time to learn about each of those things and how good security practices counter each one.

The question is kind of like, 'can you bake a cake?' .. probably yes, but it's really missing a lot of essential information, like what kind of oven, what ingredients do you have, what's your skill level, do you have arms, etc.

Any 'passphrase' can be secure or insecure, depending on the other surrounding factors. 2FA solves many security weaknesses.

 

Sony is Sony is about to delete Mythbusters, Naked and Afraid, and tons of other Discovery shows from PlayStation users’ libraries even if they already “purchased” them.

So, if you bought a DVD licensed by Sony, can they now legally enter your house and take your DVD?

Or can Sony have some sort of DRM that prevents the DVD from playing when Sony loses the license agreement?

I'm just trying to reconcile how digital purchases can be subject to license terms changes, while a DVD apparently can't be.

 

So let me get this straight...

Lease some piece of gravel and put a shitty drive thru coffee stand on it. Fine people when they drive thru to get the coffee. Get $$$.

It's so simple! Instead of selling $5 coffees, you're selling $100 'parking' fines! Genius!!

Anyone else want to go in on this with me?

 

 

Good morning all, in today's episode of "What I learned during work hours"...

I was playing around with wxHexEditor and realised that if something catastrophic happened, I would really struggle with any data recovery if I lost the inode tables for any drive.

A quick duckle pointed me to e2image, which says in the man:

It is a very good idea to create image files for all file systems on a system and save the partition layout (which can be generated using the fdisk -l command) at regular intervals


at boot time, and/or every week or so.

I couldn't find any prebuilt solutions for this online, so I wrote a systemd service and timer to do this for me. I save the fdisk to a text file, run e2image on a couple drives, and compress it all together in a dated 7z that can get uploaded via rsync or Mega or Dropbox etc.

The metadata image from a 500gb drive is 8gb, but compresses down to 40mb. Backup takes a couple minutes.

~~Unfortunately this does not work with my raid drives, but they are RAID1 so already resilient.~~

Apparently I was being a derp somehow. ...Anyways,

My RAID drives are 16TB, e2image of this is 125gb, and 7z'd it comes down to just 63mb.

I'll post the service, timer, and backup script in a comment, let me know if you can spot anywhere for improvements!

 

Again, please tell me if there is a better way to do this.

While testing docker, frequently I need to start/stop/rm containers. I got real sick of having to ls them and copy paste the container ID.

Using this alias, I just have to remember a single part of the name of the container, and I will get the container IDs that can then be included as part of another command:

$ alias dcl='_dcl(){ docker container ls -aq -f name="$1";}; _dcl'

$ dcl snikket
b3fcbc808cc9
1947885fbb24
054d67d2e8b9
d8fe9df5f61f

So now that I'm getting a list of IDs, I can easily, for example, pause all of them:

$ docker container pause $( dcl snikket )
Error response from daemon: container  is not running
Error response from daemon: container  is not running
Error response from daemon: container  is not running
Error response from daemon: container  is not running

The containers weren't actually running, but this shows the alias working.

dcl obviously stands for 'docker container ls'

 

Someone tell me if there is a better way to do this, but I don't see how.

I needed a way to see which services I have enabled that I have manually stopped.

There oddly isn't a way to do this in one command, so I had to take the output of list-unit-files 'enabled', and use that to filter for 'list-units'. The command is here:

alias sysstop='systemctl list-units --state=failed,dead,exited $( systemctl list-unit-files --state=enabled --type=service | awk "/.*\.service/ {print }" )'

So now I can remember that I need to restart mariadb and nginx at some point:

$ sysstop
  UNIT                                 LOAD   ACTIVE   SUB    DESCRIPTION                                             
  blueman-mechanism.service            loaded inactive dead   Bluetooth management mechanism
  mariadb.service                      loaded inactive dead   MariaDB 11.2.2 database server
  NetworkManager-wait-online.service   loaded active   exited Network Manager Wait Online
  nginx.service                        loaded inactive dead   A high performance web server and a reverse proxy server
  systemd-homed-activate.service       loaded active   exited Home Area Activation
  systemd-networkd-wait-online.service loaded active   exited Wait for Network to be Configured

My other aliases are here, in case anyone finds these helpful. I use them frequently myself.

alias sysdis='systemctl list-unit-files --type=service --state=disabled'
alias sysdisuser='systemctl list-unit-files --type=service --state=disabled --user'
alias sysen='systemctl list-unit-files --type=service --state=enabled'
alias sysenuser='systemctl list-unit-files --type=service --state=enabled --user'
alias sysfail='systemctl list-units --type=service --state=failed'
alias sysrun='systemctl list-units --type=service --state=running'
alias sysrunuser='systemctl list-units --type=service --state=running --user'
alias sysstatic='systemctl list-units --type=service --state=static'
38
submitted 11 months ago* (last edited 11 months ago) by luthis@lemmy.nz to c/linux@lemmy.ml
 

Just having a play around, this turned out to be not as clear cut as expected.

so I created a file and entered some text, used xxd to get the hex values, and then opened the device /dev/sdb1 in wxhexeditor and tried to find my file, but it's not finding it. Inode is 19, so it should be right at the start of the first block group, but after several minutes, no joy. (drive is ext4.)

I thought this was going to be an easy task, just multiply the inode by the block size, open the device with wxhexeditor, and scroll to the line corresponding to the calculated byte, copy out the hex values and convert to ascii and voila, there's the 'hello world'... except no.

What am I missing here? Drive isn't encrypted, nothing silly like that.

Ok, I managed to do it with dd:

sudo dd if=/dev/sdb1 bs=8M skip=$((4660742*4096)) iflag=skip_bytes | head -c 4096

hello

but why can I not find it using wxhexeditor??

EDIT:

Duh, I didn't click that offset needed to be multiplied by the block size.

If I go to offset 4660742*4096=19090399232 in wxhexeditor, indeed I see the file contents:

Final conclusion:

After some more testing, I have concluded: you cannot easily calculate the offset using the inode. Finding files across the disk requires using the inode tables to get the offset and actual file location. So an inode does not correlate with a physical/logical sequential disk location.

I created a new file, it received inode 21, but the offset was smaller than inode 19.

Was that a good use of 3 hours of my life? Well... I still have no idea what's up with the Kardashians, so.. I guess?

 

From homectl:

Home directories managed by systemd-homed.service are usually in one of two states, ... when "active" they are unlocked and mounted, and thus accessible to the system and its programs; ... Activation happens automatically at login of the user

What does 'login' mean? For example, I created a user and tried to su -l test, but I got: cannot change directory to /home/test.

What is required to 'activate' a homed directory if not a login shell?

 

What is up with all the 'threats' all of a sudden? Bomb threats, shooter threats, it went from never to this year it's every couple months. Am I remembering incorrectly?

 

This is going to be more of a life pro tip, but trying to reach the largest audience here.

Just had a frantic neighbour knocking at my door saying there is a fire in her oven.

I was over there in under 60 seconds with the fire extinguisher. There was a pot of oil on fire wedged between the element and the rack. No way to quickly and safely remove it, so I blasted it.

If I had tried to remove the pan, it's likely it would have ended up spilling burning oil everywhere and making the situation much worse. Now they just have a house full of dust to clean.

Will replace our extinguisher today and am considering buying a few more to gift this Christmas.

 

I solved this problem for myself yesterday and couldn't find the answer anywhere online (clearly stated), so here's what I did.

This also works for Plex, games, etc it's policy based routing so you can have your VPN and remote access at the same time.

This configuration is for your ssh server (ie your home PC) that has a VPN running like ProtonVPN etc and allows you to connect back to your home PC remotely either for SSH, plex, anything you're serving.

This is changing the default gateway for particular ports, so that return traffic from connection attempts doesn't go back out through the VPN.

I used this page to figure out how to do this:

http://linux-ip.net/html/tools-ip-rule.html

Add a default route to some table, arbitrarily table 10 but you can use whatever number (RTFM), also obviously needs to be your router IP

sudo ip route add default via 192.168.19.1 table 10

Add a rule for the return traffic from your ssh host

sudo ip rule add sport 22 table 10

sudo ip route flush cache

check out your fancy new rule

ip rule show

And to make this persistent across reboots, add to:

/etc/systemd/network/20-wired.network

(or whatever your file there is, add the following to the bottom. This is the same as above, just permanent)

[Route]
Gateway=192.168.19.1
Table=10

[RoutingPolicyRule]
SourcePort=22
Table=10
 

Will we all be fucked or is there a Linus 2?

view more: ‹ prev next ›