luthis

joined 1 year ago
[–] [email protected] 6 points 5 months ago

Terrible weather, bucketing rain, not too cold, low visibility in fog / low cloud. Close proximity to mountain bike park. Full day of sliding down trails, getting covered in mud. Absolutely miserable, wet and dirty all day, struggling to maintain traction up the hills, frequently sliding out. Evening spa / hot pools to relax the muscles with a beer.

That's heaven.

[–] [email protected] 5 points 5 months ago

Freesia, because it reminds me of my childhood and Spring.

[–] [email protected] 13 points 5 months ago (7 children)

Tarballs are not built from source?

[–] [email protected] 21 points 5 months ago (17 children)

I have heard multiple times from different sources that building from git source instead of using tarballs invalidates this exploit, but I do not understand how. Is anyone able to explain that?

If malicious code is in the source, and therefore in the tarball, what's the difference?

[–] [email protected] -1 points 5 months ago (1 children)

Pretty sure you could count not freezing to death, having a space to keep your things safe, health, stability etc as a value output.

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

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

[–] [email protected] 6 points 6 months ago

Apple will make you pay for anything apparently

[–] [email protected] 91 points 6 months ago (4 children)

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

[–] [email protected] -1 points 6 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.

[–] [email protected] 1 points 6 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.

[–] [email protected] 1 points 6 months ago

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

188
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/[email protected]
 

 

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'
 

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?

 

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?

 

Is anyone able to point me in the right direction to solve this issue please?

I installed the nvidia-beta drivers (Arch) and tested out Starfield. All is good. Then next time I try to startx, I get X failed to start etc.

Following the logs I get to:

` [ 1711.739] (II) NVIDIA dlloader X Driver 545.23.06 Sun Oct 15 17:26:55 UTC 2023

...

[ 1711.740] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the

[ 1711.740] (EE) NVIDIA: system's kernel log for additional error messages and

[ 1711.740] (EE) NVIDIA: consult the NVIDIA README for details.

`

Wierd. Install nvidia instead, y to remove conflicts/nvidia-utils etc, and it's all working. Try to install beta drivers again, same issue, rebooted, etc.

The beta drivers definitely did work. But now they magically aren't.

Any tips?

I did try running sudo mkinitcpio -P but no change.

 

Discovered recently that Electric Wizard were kinda dicks back in the day. "At the time, we were pretty bad people. I got arrested for arson of a car, outside a police station. Tim [Bagshaw] went to nick a crucifix off a church roof so we could use it onstage..."

R. L. Burnside killed a man "possibly at a craps game."

Varg of ~~Mayhem~~ Burzum burned a couple churches and killed a bandmate.

I could list other examples, but would like to hear from other people and other music genres.

 

I HAVE TO BE SPECIAL!!! PAY ATTENTION TO MEEEEEE!!!

view more: ‹ prev next ›