[-] luthis@lemmy.nz 91 points 9 months ago

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

91
submitted 1 year ago by luthis@lemmy.nz to c/asklemmy@lemmy.ml

like, GiantHairyNipplemonsters.com..

Or maybe better, the domain for beer brewed especially for gamers.. Game Ale.

"... that was.. luthis at.. gaymail.. .com???"

"Exactly, luthis@gameale.com."

".. g a y..m a i l?"

"What?? No! GAME ALE dot com!"

Just the random shit that comes into my brain when I walk without other stimulus.. surely I'm not the only one.

15
submitted 1 year ago* (last edited 1 year ago) by luthis@lemmy.nz to c/linux@lemmy.ml

cross-posted from: https://lemmy.nz/post/4034332

Not sure what I'm doing wrong here, I'm using this image:

https://hub.docker.com/r/bitnami/wordpress-nginx

I updated the compose file to have un/pw for mariadb:

  mariadb:
    image: docker.io/bitnami/mariadb:11.1
    volumes:
      - '/etc/docker/mariadb-persist:/bitnami/mariadb'
    environment:
      - ALLOW_EMPTY_PASSWORD=no
      - MARIADB_USER=admin
      - MARIADB_PASSWORD=admin
      - MARIADB_DATABASE=bitnami_wordpress

But I get this error:

2023-12-03 19:03:02 3 [Warning] Access denied for user 'admin'@'172.18.0.3' (using password: NO)

using password: NO??

93
submitted 1 year ago by luthis@lemmy.nz to c/asklemmy@lemmy.ml

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.

188
submitted 1 year ago* (last edited 1 year ago) by luthis@lemmy.nz to c/lemmyshitpost@lemmy.world

27
submitted 1 year ago* (last edited 1 year ago) by luthis@lemmy.nz to c/linux@lemmy.ml

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!

25
submitted 1 year ago by luthis@lemmy.nz to c/linux@lemmy.ml

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'

47
submitted 1 year ago* (last edited 1 year ago) by luthis@lemmy.nz to c/linux@lemmy.ml

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 1 year ago* (last edited 1 year 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?

22
submitted 1 year ago by luthis@lemmy.nz to c/linux@lemmy.ml

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?

277
submitted 1 year ago by luthis@lemmy.nz to c/asklemmy@lemmy.ml

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.

90
submitted 1 year ago* (last edited 1 year ago) by luthis@lemmy.nz to c/linux@lemmy.ml

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
[-] luthis@lemmy.nz 91 points 1 year ago* (last edited 1 year ago)

That is what this post is about, IDK who this Torvalds guy is.

298
submitted 1 year ago by luthis@lemmy.nz to c/linux@lemmy.ml

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

[-] luthis@lemmy.nz 97 points 1 year ago

Capitalism is so schizophrenic. Is supply and demand in a free market meant to decide the value of goods or not?? If regulations and penalties are required, why not across the board??

[-] luthis@lemmy.nz 92 points 1 year ago

Is it even worth going to Disneyland? It just sounds like an 8 hour day of waiting in line for 7.5 hours and 30 minutes of ride.

[-] luthis@lemmy.nz 100 points 1 year ago

What about all the American anchors that cause damage to things? Why are you blaming China when America does bad things?

Seems pretty hypocritical to put all this blame on China when they are a struggling developing nation while America is a first world country and drops their anchors on everything.

Also nothing happened on 4 June 1989.

[-] luthis@lemmy.nz 100 points 1 year ago

I think it would have played out roughly the same. Energy density of fossil fuels is ahead of everything, along with it's portability. Not to mention no one knew or cared about environmental issues then.

Might have made the transition easier though.

[-] luthis@lemmy.nz 107 points 1 year ago

Yeah, this is far more than just a 'painful wedgie.'

I'm getting strong 'stupid woman sues McDonalds after spilling coffee on herself (except it was like seriously major disfiguring burns but shhh about that)' vibes from that headline

[-] luthis@lemmy.nz 88 points 1 year ago

Ive heard of eco-terrorism but this is ridiculous

[-] luthis@lemmy.nz 91 points 1 year ago

The headline makes it sound like Tesla is trialing a new 'fatality' feature for it's autopilot.

[-] luthis@lemmy.nz 83 points 1 year ago

I was going to say that, but out of the 6 bikes in the garage none of them are under $100 even second hand.

In fact I would advise against getting a cheap shitty bike that isn't going to last. Spend the extra money, get something good. It's better for the environment and your wallet in the long run.

[-] luthis@lemmy.nz 93 points 1 year ago

Saw this story. Title should be 'Idiot dies of starvation after not consuming vital nutrients.'

I've been vegan for years, I respect vegans who take their diet seriously, but this woman didn't. She took ideology seriously.

You can't just eat anything and expect to be ok.

[-] luthis@lemmy.nz 86 points 1 year ago

On one hand, I'm glad that less plastic is going to end up in landfill.

On the other, you'll own nothing and be happy.

view more: ‹ prev next ›

luthis

joined 2 years ago