Hallo Hallo

wissen sie, ich bin selbst auch ein bisschen sowas wie inkonsistent

ich bin jetzt unter die MPC-User gegangen. voll gut.

MPC
hach

bin jetzt seit nem jahr oder so dawless - vor allem aber schlecht im beziffern von zeiträumen.
die rakete™ ist nicht nur für hiphop gut - ich mache damit eigentlich das selbe wie immer: alles mögliche.
hier mal ein beispiel von nem stück, dass aufs nächste album kommt:

“pan:core - ǥlȺsstrøn”


ansonsten entdecke ich gerade die freude am coden wieder. das ist schön.

SSH anyone?

hab mal ein bash script zusammengeschmiert, um die MPC-Firmware (nur Gen1) automatisiert zu modden
ohne SSH ist das kopieren der musik von der mpc zum pc nervig.

#!/bin/bash

#Update-Image Name as Parameter e.g './MPC-3.7.0-Gen1-update.img'

MPCIMG2='./mpcimg2'

function downloadMpcimg2(){
    curl -O "https://raw.githubusercontent.com/TheKikGen/MPC-LiveXplore/master/imgmaker/bin/mpcimg2"
}

function chmodMpcimg2(){
    chmod +x $MPCIMG2
}

if [ $# -ne 1 ];
    then echo "usage: $0 Update-Image"
fi


if ! [ -f "$MPCIMG2" ]; then
   downloadMpcimg2
fi

if ! [ -x "$MPCIMG2" ]; then
    chmodMpcimg2
fi

IMAGE_FULLPATH=$1

IMAGE_NAME=$(basename ${IMAGE_FULLPATH} .img)
echo $IMAGE_NAME

#extract rootFS

ROOTFS_IMAGE=${IMAGE_NAME}.rootfs
./mpcimg2 -r ${IMAGE_NAME}.img ${ROOTFS_IMAGE}

# Mount root FS
mkdir /mnt/MPC
mount $ROOTFS_IMAGE /mnt/MPC

#unstar the root in shadow
sed -i 's/root:\*:/root::/' /mnt/MPC/etc/shadow

# uncomment maybe set properties
SSHD_CONFIGFILE='/mnt/MPC/etc/ssh/sshd_config'
SSHD_D_CONFIGFILE='/mnt/MPC/etc/ssh/sshd_config.d/10-az0x.conf'

sed -i 's/^PasswordAuthentication/#PasswordAuthentication/g' $SSHD_CONFIGFILE
sed -i 's/^KbdInteractiveAuthentication/#KbdInteractiveAuthentication/g' $SSHD_CONFIGFILE
sed -i 's/^PermitEmptyPasswords/#PermitEmptyPasswords/g' $SSHD_CONFIGFILE
sed -i 's/^PermitRootLogin/#PermitRootLogin/g' $SSHD_CONFIGFILE

sed -i 's/^PasswordAuthentication/#PasswordAuthentication/g' $SSHD_D_CONFIGFILE
sed -i 's/^KbdInteractiveAuthentication/#KbdInteractiveAuthentication/g' $SSHD_D_CONFIGFILE
sed -i 's/^PermitEmptyPasswords/#PermitEmptyPasswords/g' $SSHD_D_CONFIGFILE
sed -i 's/^PermitRootLogin/#PermitRootLogin/g' $SSHD_D_CONFIGFILE

echo "append wanted settings"
#append settings we want
echo "PermitRootLogin yes" >> $SSHD_CONFIGFILE
echo "PasswordAuthentication yes" >> $SSHD_CONFIGFILE
echo "KbdInteractiveAuthentication yes" >> $SSHD_CONFIGFILE
echo "PermitEmptyPasswords yes" >> $SSHD_CONFIGFILE
echo "done."

#Enable startup of SSH service

ln -s /usr/lib/systemd/system/sshd.service /mnt/MPC/etc/systemd/system/multi-user.target.wants/
echo "startup of ssh service enabled."
#Unmount root FS
umount /mnt/MPC

#Build new image
mv ${IMAGE_NAME}.img ${IMAGE_NAME}.img.orig
./mpcimg2 -m ${IMAGE_NAME}.img.orig ${ROOTFS_IMAGE} ${IMAGE_NAME}.img

#cleanup
rmdir /mnt/MPC
rm ${ROOTFS_IMAGE}