harsh3466

joined 1 year ago
[–] harsh3466@lemmy.ml 4 points 1 day ago

I use gnu stow and my self hosted got forge to manage and back up my config files. With a 3-2-1 backup strategy on the gitforge of three copies, at least two mediums, with one offsite.

[–] harsh3466@lemmy.ml 1 points 1 day ago

Same here. luks encrypted drive in my work locker.

[–] harsh3466@lemmy.ml 2 points 1 day ago

Right now I sneaker net it. I stash a luks encrypted drive in my locker at work and bring it home once a week or so to update the backup.

At some point I'm going to set up a RPI at a friend's house, but that's down the road a bit.

[–] harsh3466@lemmy.ml 8 points 1 day ago

Not a fucking chance.

[–] harsh3466@lemmy.ml 3 points 4 days ago

You could. I didn’t even think about it. I’m used to using dd, but clonezilla is a totally viable option here.

 

Marty Casey was on the show Rockstar: INXS back in 2005 and wrote and performed this song as part of the show's competition

[–] harsh3466@lemmy.ml 2 points 4 days ago

No worries! Happy to help, and the instructions will work with the HDD, just use the HDD/boot as the in. I shouldn’t have assumed the existing boot was an ssd. Good luck!!!

[–] harsh3466@lemmy.ml 7 points 4 days ago (17 children)

If you want to clone the existing system onto the new ssd, here’s the broad strokes of what you can do.

  1. Get a usb stick and write your linux distro of choice to it. Doesn’t really matter which one, we’re just using this to clone the system drive to the new drive. You want the system drive to be totally inactive during the clone which is why you’ll do it from a live usb rather than with the system itself booted.
  2. shut down the system
  3. Install the new ssd. DO NOT REMOVE THE CURRENT SYSTEM/BOOT SSD. You should now have two ssds installed.
  4. If you can’t install the second ssd, plug it in to usb via an enclosure
  5. Boot from the live usb
  6. open the terminal
  7. run lsblk and note the /dev/sdX path of the system drive. Write it down.
  8. From the same output, note the /dev/sdX path of the new ssd. Write it down.
  9. Use the dd command to clone the system drive to the new ssd. The command will look like this:

`dd if=/dev/existingBootDrive of=/dev/newSSDDrive bs=8M status=progress oflag=direct’

This command will clone the exact data of the system drive to the new ssd. the if portion of the command stands for in file, as in the source of the data you want to clone. Make sure that is your existing boot drive. of is the out file, the destination of the clone. Make sure that is your new ssd.

When you do this, the new drive will appear to be the same size as the old drive. This is due to the cloning, but is easily resolved by resizing the partition(s). How you do this depends on the filesystem, so refer to this guide for resizing

  1. Once you’ve resized the partition/disk, double check the partition UUIDs on the new ssd against what’s in /etc/fstab on the new disk. To do this, run blkid to get a list of all the partitions and their UUIDs. Note the UUIDs of the partitions on the new ssd.
  2. To check /etc/fstab, you’ll have to mount the root (/) partition of the new drive somewhere in the live system. In the terminal you should already be in the home folder of the live system user. Make a new directory with mkdir. Call it whatever you want. So something like: mkdir newboot
  3. run lsblk and make note of the root partition on the new ssd, then mount that to newboot (or whatever you called it) with sudo mount /dev/sdX newboot (where X is the actual device label for the root parition of the new drive`
  4. open /etc/fstab with your terminal text editor of choice. Compare the UUIDs to the ones you noted. If they are the same, you’re golden (they should be the same, but I’ve also had them change on me. ymmv). If they are different, delete the old UUID and replace it with the new UUID for each respective partiiton
  5. Shut down the system
  6. Remove the old boot drive, and install the new boot drive in it’s place
  7. Boot the system. If all goes well, you’ll boot right into tumbleweed as if nothing has changed except you’re running from your shiny new ssd
  8. If it doesn’t boot, boot again from the live usb, and again check the UUIDs to make sure there were no mistakes
  9. Keep the old SSD unmodified in case you need to revert back to it.
[–] harsh3466@lemmy.ml 3 points 4 days ago (1 children)

Is this actually legit? That’s some rando youtube channel that it’s been posted to.

[–] harsh3466@lemmy.ml 18 points 4 days ago

age verification can get fucked

[–] harsh3466@lemmy.ml 3 points 4 days ago (1 children)

Glad to hear! What kind of workout do you like to do? I’m a lifter myself. I like the simplicity and consistency of the Stronglifts 5x5 program.

[–] harsh3466@lemmy.ml 5 points 4 days ago (3 children)

How's your day going?

[–] harsh3466@lemmy.ml 67 points 5 days ago (2 children)

Gee. Look at the fucking cops protecting the oligarchs and their property instead of the rights of the people being illegally detained, deported, arrested, etc...

 

Connection: also a television show intro (Carry on My Wayward Son for Supernatural, Bad Things for True Blood)

 

This is just me celebrating a small win. I've been slowly learning bash scripting, and just now I was able to quickly write a simple bash script to automate a file moving task without referring to my notes or the web!

It's not a super complicated script, I'm just happy I'm starting to internalize the knowledge I've been building.

I've been organizing my media files after ripping our DVD collection. I had all the files for The Smurfs cartoon (love the Smurfs) in the main Smurfs show folder. I wanted to put them all into their respective season folders (Season.XX). Here's the script:

#! /bin/bash

for number in {01..09}; do
	find . -type f -name "The.Smurfs.S$number*" -exec mv {} Season.$number/ \;
done

I could have done it as a one liner, but I like to keep things like this for future reference.

 
 

EDIT WITH UPDATE: Operation went off without a hitch! I'm now up and running with the 512GB nvme drive! Next stop is dual booting nixos, which was the whole reason for switching to the larger drive.

ORIGINAL POST:

I’ve got a laptop running Arch (btw), with a 128GB nvme in it. The nvme has two partitions. EFI boot, and a luks encrypted lvm.

I’ve got a 512GB nvme I want to swap in. I think I can clone the device with dd, update the uuids, expand the lvm, and drop in the 512 nvme, but my searching hasn't given me a clear confirmation of this. Am I correct in my thought process, or am I setting myself up for disaster?

 
19
submitted 3 months ago* (last edited 3 months ago) by harsh3466@lemmy.ml to c/linux@lemmy.ml
 

Edit 4: I think I've fixed the issue. I uninstalled vim, deleted ~/.viminfo and /etc/vimrc, then reinstalled vim. I jumped around a file a bit, went in and out of edit mode, and type a bunch of ~ and it didn't jump the text around at all. Still not sure what I did, but it appears this variation of turning it on and off again worked.

I'm hoping someone can help me with this.

I was holding my laptop while I had a vile open in vim, and I slipped, mashing a bunch of keys on the keyboard by mistake.

After doing this, I can't type the ~ character anymore. Anytime I try to type it, it jumps the text to the last line, putting the last line at the top of the editing screen so that's the only line of text showing.

I thought maybe I had set an option that would show up in ~/.vimrc, but there's no ~/.vimrc file. There is a /etc/vimrc file, and a ~/.viminfo file.

I've searched and had no luck finding out what I did to cause this behavior. I also tried looking through the vim manpage and couldn't find any info there either.

Edit 3: I just installed neovim and in neovim it acts as expected when I type the ~. Something I did notice is that in vim, I now have a blinking block cursor in insert mode as well as in visual mode, while in neovim, it's a block cursor in visual mode and a vertical bar cursor in insert mode. I think this was the normal behavior in vim prior to whatever the heck I did.

Hoping someone knows what the heck I did. Thank you!

Edit: clarified what happens when I try to type ~

Edit 2: added details of the .vimrc and .viminfo files

 

Had to do them quietly so I didn't wake her.

 

Edit 2: Fixed! Thanks to @just_another_person@lemmy.world for this github issue link.

The solution is in the last comment suggesting to set ManageForeignRoutingPolicyRules=no in /etc/systemd/networkd.conf

Original post is below...

So I've got something I don't quite know how to find a solution for and I'm hoping this lovely community can help!

I've been experimenting with Arch (btw) with Hyprland to learn more about the install process, and linux in general, and to see if I like tiling window managers (I do).

I've installed this on a thinkpad I use for tinkering/learning, and the problem I'm encountering is that when I open up the laptop and the system resumes from suspend, the VPN connection is active, but broken, or maybe leaky.

What I mean by that is prior to suspending, with the vpn connection active, if I run curl ip.me, the result is the vpn server ip, Which is the expected behavior.

After resuming from suspend, when I run curl ip.me, I get my naked home ip instead of the vpn ip.

At first I thought I was losing the vpn connection, but when I check the status with sudo wg, it will show the vpn connection is still active, like so:

interface: wg0
  public key: pubkeyhere
  private key: (hidden)
  listening port: 38014
  fwmark: 0xca6c

peer: peer here
  endpoint: ip.endpoint.here:51820
  allowed ips: 0.0.0.0/0
  latest handshake: 7 seconds ago
  transfer: 8.07 KiB received, 3.77 KiB sent

I've tried searching for this to figure out what's happening, and I'm not finding anything, likely because I don't know how to properly query for results.

What I've been doing is just manually running an alias on resume that brings the vpn connection down, and then back up again with:

sudo wg-quick down wg0 && sleep 2 && sudo wg-quick up wg0

I've tried different variations on a script placed in /usr/lib/systemd/system-sleep to no avail. I have verified that that the script is running properly. I tested first with echo "sometext" > ~/somefile for both pre and post and the script is executed on suspend and again on resume.

Script example:

#! /usr/bin/bash

case $1/$2 in
	pre/*)
		;;
	post/*)
		sleep 2
		/usr/bin/wg-quick down wg0
		sleep 2
		/usr/bin/wg-quick up wg0
		;;
esac

Despite this script executing what is essentially the same command as my alias on resume, my home ip is what results from running curl ip.me.

Other details that may or may not be relevant.

I've got a wg-quick@wg0.service systemd service that runs on startup to connect to the vpn.

System is Arch with Hyprland, iwctl to manage the wifi connection. I'm not using hyprlock. When I close the laptop it suspends the session, and when I open it back up it just resumes it, no lock screen or password needed.

I don't really understand what's going on here, and I haven't been able to find any information that helps me figure out what's happening or how to address it. Any help would be greatly appreciated!

Edit: just wanted to add that I've also looked through journalctl and I haven't found anything useful (to me) there.

 

Growing up these donuts were a new year's tradition. I hadn't had them for decades, so I decided to learn how to make them. They're super easy to make and super delicious. It's a fried donut with a wonderfully crispy outer shell and a soft pillowy interior. They're traditionally topped with warm honey, cinnamon, and chopped walnut (I also toasted the walnuts).

 
 

EDIT 2: After learning that aliases aren't really suited for regex, and trying the script, I thought maybe reloading the .bashrc file wasn't enough to refresh the aliases, so I closed my terminal and after reopening the terminal and trying the script again it works just fine.

Okay, I've tried searching for help on this and I can't find anything, and I'm banging my head on my desk trying to figure out how to get this to work.

I routinely have to capitalize the first letter in a series of files that are passed to me. So I'll get:

file01
file02

And so on. I use perl rename (I'm using Fedora) with the following command and regex, and from within the directory it works as expected:

prename 's/(^[a-z]?)/\U$1/' *

I do this a lot. At least once a day, which calls for an alias or script.

I tried adding it as an alias to my .bash_aliases like so:

alias cap="prename 's/(^[a-z]?)/\U$1/' *"

And when I do, instead of capitalizing the first letter of the filenames it removes them. Searching got me nothing, in part because I probably am not asking the right question.

So then thought I'd write a dead simple bash script named cap (after removing the alias and reloading .bashrc)

#! /bin/bash

prename 's/(^[a-z]?)/\U$1/' *

And when I use cap in the directory, the script also cuts off the first letter instead of capitalizing it.

I suspect it's the $1 variable in the regex that's causing the problem, but I can't figure out how to address it so it works correctly in the alias or the script.

EDIT: I just tried some more searching and found that regex won't work in aliases, so it explains that, but I still can't figure out how to get it to work in the script.

view more: next ›