Trent Johnson 🦍

@ludothegreat@infosec.exchange
82 Followers
193 Following
126 Posts
Network and Security, horror movies, 3D printing, hot rods, and whatever other randomness my brain comes up with. Also, don't listen to anything I say or do anything I do. I'm just another idiot on Mastodon.
Bloghttps://unasserted.com/
Everywhere@ludothegreat

!!Long post!!

I've been messing with Fabric lately. Im working on a pattern to write blogs from the crude notes that I take all day long. Today, my latest write_blog pattern decided it was a wizard and came up with this:

 wl-paste | fabric -sp write_how-to_3

The Dark Arts of the `dd` Command: A Wizard's Guide to Disk Alchemy in Linux

In the grand, shadowy library of Linux command-line utilities, there lurks a spell so potent, so fraught with peril and promise, that only the most intrepid of digital wizards dare to invoke its name. This incantation is none other than `dd`, a command of such arcane power that it can conjure disk images from the ether, banish data into oblivion, and even clone the very soul of a disk with but a few keystrokes.

But beware, for with great power comes great responsibility. The `dd` command does not suffer fools gladly. A misplaced letter, a slip of the finger, and poof! Your data vanishes into the digital void, leaving nary a trace behind. Thus, let us embark on this perilous journey with caution, armed with knowledge and respect for the dark arts we are about to wield.

### The Incantation Deciphered

At its heart, the `dd` command speaks a simple language:
```
dd if=<source of eldritch energies> of=<destination of arcane power> [options]
```
- `if=` beckons the source from which the magic will flow.
- `of=` designates the vessel that will receive this mystical energy.
- Options are the secret runes that modify the spell's potency and behavior.

### Conjuring Disk Backups

1. **Identifying Your Grimoire**: With a wave of your wand (or, more mundanely, the `lsblk` command), reveal the true names of all disks and partitions under your dominion.
2. **Entering the Astral Plane**: Boot from a live Linux medium to ensure that the spirits are calm and your system disk is at peace.
3. **Weaving the Spell**: To back up your disk `/dev/sda` to another dimension (or an external disk `/dev/sdb`), chant:
```
sudo dd if=/dev/sda of=/dev/sdb bs=4M status=progress
```
Here, `bs=4M` accelerates the spellcasting, while `status=progress` allows you to peer into the crystal ball to see how your magic unfolds.

### Banishing Data to the Nether

- **To Cast into Darkness**: To purge a disk with the void of zeros:
```
sudo dd if=/dev/zero of=/dev/sdX bs=4M status=progress
```
- **To Summon Chaos**: For a more fiendish erasure, call forth randomness:
```
sudo dd if=/dev/urandom of=/dev/sdX bs=4M status=progress
```
Choose your target (`/dev/sdX`) with utmost care, lest you annihilate the wrong soul.

### Cloning the Essence of a Disk

To bind the spirit of a disk into an image file:
1. **Selecting the Phylactery**: Find a sanctum with ample space to store this essence.
2. **Casting the Clone Spell**: Ensnare the disk `/dev/sda` into your chosen image file:
```
sudo dd if=/dev/sda of=/path/to/backup.img bs=4M status=progress
```

### Resurrecting from an Image

To breathe life back into a system from its shadowy image:
```
sudo dd if=/path/to/backup.img of=/dev/sdX bs=4M status=progress
```
Ensure `/dev/sdX` is the rebirth chamber (target disk) for your resurrection ritual.

### Words of Power

- **Scrying Correctly**: Always peer deeply into your crystal ball (double-check device names) before unleashing your spells.
- **Wield with Wisdom**: The `dd` command is a double-edged sword that can cleave through data without remorse.
- **Guard Your Treasures**: Always keep your precious data in multiple sanctuaries (backups) before embarking on dangerous quests.

### Epilogue

Thus, we conclude our foray into the mystical realm of `dd`, a tool of unmatched versatility in the Linux sorcerer's arsenal. Whether for crafting backups, obliterating data, or duplicating disks, `dd` offers a path to both creation and destruction. But always remember: in the realm of powerful magic, caution is your best ally. Verify your incantations and choose your targets wisely, lest you invoke consequences dire and irreversible.%

#Linux #dd #CommandLine #SysAdmin #DiskManagement #DataBackup #DataRecovery #LinuxMagic #TechTips #DDCommand #OpenSource #LinuxCommunity #CyberSecurity #TechBlog #ITKnowledge #LinuxWizardry

The Paradox of Progress - Solar Farms and the Cost of Green Energy

This is bugging me. Yesterday, driving through the countryside near where I grew up, I couldn't help but notice the changing landscape. Where there once st...

unasserted
Just so you all know, I installed Arch on one of my laptops. #archlinux #Linux
I found a really old photo of the beginnings of my #wardriving.
Poll: Which tool do you prefer for remotely copying files between #Linux , #FreeBSD , #macOS , or #Unix like systems? Please boost for reach. TIA.
ftp (secure version aka ftps)
3.1%
rsync
36.8%
scp
42.9%
sftp (openssh version)
17.1%
Poll ended at .

Install #linux they said. It'll be fun they said.

Trying to format an SD card so I can capture time lapses on my new 3D printer.

1. Identify the SD card
2. Unmount the SD card
3. Partition the SD card
4. Format the SD card
5. Realize you don't have the required packages for format the card correctly
6. Realize that the proper packages wont install due to dependency error
7. Realize the dependencies won't install because of dependency errors
8. Spend 20 minutes reading forum posts to find a possible fix
9. Try to figure out why that fix didn't work
10. Realize it was a good thing that fix didn't work because it could have messed up your system
11. Spend another 10 minutes looking for another fix
12. Find the cause, but no actual fix has been released yet
13. Spend 20 minutes digging around in developer mailing lists to try and find a possible fix
14. Find that a possible fix is sitting in the "proposed updates for next release" repo
15. Add new repo
16. Update all dependencies
17. Install required software to format
18. Format SD card
19. Wait 45 minutes for card to format because you forgot to do a quick format
20. Profit?

I lost my best friend last night. He made it his mission to make me smile every day and he succeeded 100%. All he wanted in life was to be around my wife and I. I now have a giant hole in my soul that can never be refilled. Hold your loved ones close. They can be gone in an instant. #dogsofmastodon #mansbestfriend #englishbulldog
I'll have to touch them up a bit, but it was fun.
#raspberrypi #pi5 #PiZero2 #bettercap #wardriving
#infosec I need some new domains and to transfer some from an old registrar. Where do you all get yours from?

My #pwnagotchi was getting bored at home and work, so I created some Pwnagotchi food with 2 #esp8266 #d1minis.

D1 AP acts as an access point that will create a random bssid every 15minutes, "PwnfoodXYZ" with a password of "XYZnomnomnom". XYZ match in both the password and essid.

D1 Client acts as a client (random mac every time it has to reconnect) looking for an essid "PwnfoodXYZ". When it finds one it uses the password "XYZnomnomnom" according to "XYZ" in the essid.

https://github.com/ludothegreat/Pwnagotchi-Food

GitHub - ludothegreat/Pwnagotchi-Food: Food for your Pwnagotchi

Food for your Pwnagotchi. Contribute to ludothegreat/Pwnagotchi-Food development by creating an account on GitHub.

GitHub