1501, 2016

Sonerezh Album Covers

January 15th, 2016|Categories: How To|Tags: , , |0 Comments

Sonerezh is a self-hosted music streaming platform that is still fairly young. It works very well, until I recently updated to PHP7. I had to manually update the CakePHP libraries that came with it to get past a error “String is a built in function”. After I fixed that error, I decided to try and get the album cover images working.

By default Sonerezh pulls the album covers from the mp3 files themselves via the ID3 info, but I don’t keep those tags when I clean my mp3 files up I have the album art stored as ‘folder.jpg’ in the album folder itself. So I started to dig around and came up with a simple solution that works for me.

Edit the file SongsController.php inside the app/Controllers folder. Around line 93 or so it starts with pulling the photos out of the ID3 information. I added a new section and commented out the old, as displayed below:

if (!empty($songInfo['comments']['genre'])) { $genre_array_length = count($songInfo['comments']['genre']); $newSong['genre'] = $songInfo['comments']['genre'][$genre_array_length - 1]; } $extension = 'jpg'; $name = md5($newSong['artist'].$newSong['album']); $path = IMAGES.THUMBNAILS_DIR.DS.$name.'.'.$extension; if (!file_exists($path)) { if (!file_exists(IMAGES.THUMBNAILS_DIR)) { new Folder(IMAGES.THUMBNAILS_DIR, true, 0777); } if (copy("/...music path here.../".$newSong['artist']."/folder.jpg", $path)) { $newSong['cover'] = $name.'.'.$extension; } } /* if (isset($songInfo['comments']['picture'])) { if (isset($songInfo['comments']['picture'][0]['image_mime'])) { $mime = preg_split('/\//', $songInfo['comments']['picture'][0]['image_mime']); $extension = $mime[1]; } else { $extension = 'jpg'; } $name = md5($newSong['artist'].$newSong['album']); $path = IMAGES.THUMBNAILS_DIR.DS.$name.'.'.$extension; if (!file_exists($path)) { if (!file_exists(IMAGES.THUMBNAILS_DIR)) { new Folder(IMAGES.THUMBNAILS_DIR, true, 0777); } $file = fopen($path, "w"); fwrite($file, $songInfo['comments']['picture'][0]['data']); fclose($file); } $newSong['cover'] = $name.'.'.$extension; } */ } if (!isset($newSong['title'])) {
1401, 2016

Battle.net fails with error “Qt platform plugin”

January 14th, 2016|Categories: General|Tags: , |0 Comments

If your running or trying to run the Battle.net client and getting the error “This application failed to start because it could not find or load the Qt platform plugin “windows”.” then check your WINE prefixes and be sure you are running them in Windows XP mode. Also check if you are using a -staging version of WINE, I have found it works on a non-staging version of WINE but not a staging version.

Wine bug confirmed: https://bugs.winehq.org/show_bug.cgi?id=39985

1301, 2016

ArchLinux + Cinnamon + More

January 13th, 2016|Categories: How To|Tags: , , , |0 Comments

Single Encrypted SSD Install

' Create a boot partition (sda1) (set boot flag) 100MB, data partition (sda2). $ gdisk /dev/sda $ mkfs -t ext4 /dev/sda1 ' Encryption stuff $ cryptsetup -y -v luksFormat /dev/sda2 $ cryptsetup open /dev/sda2 cryptroot $ mkfs -t ext4 /dev/mapper/cryptroot ' Mount the partitions to our future chroot $ mount -t ext4 /dev/mapper/cryptroot /mnt $ mkdir /mnt/boot $ mount -t ext4 /dev/sda1 /mnt/boot

We can now install the base packages and a few other things

' Install base packages $ pacstrap /mnt base base-devel syslinux gdisk ' Generate our base fstab file $ genfstab -p /mnt >> /mnt/etc/fstab ' Change into new root directory $ arch-chroot /mnt

Now we can setup the system before the first reboot without the live cd/usb

' Set the hostname $ echo computer_name > /etc/hostname ' Set the time zone $ ln -s /usr/share/zoneinfo/zone/subzone /etc/localtime ' Edit the locale file and uncomment relevant locales $ nano /etc/locale.gen ' Generate the uncommented locales from above $ locale-gen ' Set your locale preference $ echo LANG=your_locale > /etc/locale.conf ' Add encrypt hook to mkinitcpio: HOOKS="... encrypt ... filesystems ..." $ nano /etc/mkinitcpio.conf ' Generate the initial RAM disk $ mkinitcpio -p linux ' Set the root password $ passwd ' Install some more packages $ pacman -S networkmanager zip unzip unrar patch make openssh gcc fuse nvidia nvidia-utils ' Enable NetworkManager in systemd $ systemctl enable NetworkManager ' Install the boot loader $ syslinux-install_update -i -a -m ' Edit the syslinux boot loader (fix root stuff, set noop io scheduler) ' APPEND elevator=noop cryptdevice=/dev/sda2:cryptroot:allow-discards root=/dev/mapper/cryptroot rw $ nano /boot/syslinux/syslinux.cfg ' Edit the fstab file, change root mount to use noatime and discard options ' Setup /tmp on tempfs add line: tmpfs /tmp tmpfs nodev,nosuid,size=2G 0 0 $ nano /etc/fstab ' Reboot the machine $ reboot

After a clean reboot you should get the Syslinux Boot Loader and then booted into Archlinux, asking for the encryption key

' Login as root ' Check networking $ ip addr $ ping ' Edit pacman configuration uncomment multilib repo $ nano /etc/pacman.conf ' Update pacman databases $ pacman -Syu ' Lets get more packages and cinnamon now $ pacman -S cinnamon playonlinux firefox xorg-xinit vim gvfs gvfs-smb wget lib32-libldap gnome-terminal gnome-keyring ' Edit some files to fix a few things and setup environment ' fuse.conf uncomment only two configuration values $ nano /etc/fuse.conf ' Edit which users/groups can sudo $ visudo ' Create a local non-root user $ useradd -g users -G disk lp wheel games dbus network video audio optical floppy storage power -m zharvek ' Set a password for that user $ passwd zharvek

Lets reboot again and login as our new user, you probably don’t have to reboot here but I do

' Login as non-root user ' Copy xinitrc to profile $ cp /etc/X11/xinit/xinitrc ~/.xinitrc ' Edit .xinitrc file to set cinnamon as desktop environment: exec cinnamon-session $ nano ~/.xinitrc ' I like to change the font engines and stuff before I load the desktop first $ cd /tmp $ wget https://aur.archlinux.org/cgit/aur.git/snapshot/freetype2-ubuntu.tar.gz $ wget https://aur.archlinux.org/cgit/aur.git/snapshot/fontconfig-ubuntu.tar.gz $ wget https://aur.archlinux.org/cgit/aur.git/snapshot/ttf-ms-fonts.tar.gz ' Lets extract these packages $ tar zxf freetype2-ubuntu.tar.gz $ tar zxf fontconfig-ubuntu.tar.gz $ tar zxf ttf-ms-fonts.tar.gz ' Lets build these packages $ cd freetype2-ubuntu $ makepkg $ sudo pacman -U freetype2-ubuntu...filename $ cd ../fontconfig-ubuntu $ makepkg $ sudo pacman -U fontconfig-ubuntu...filename $ cd ../ttf-ms-fonts $ makepkg $ sudo pacman -U ttf-ms-fonts...filename ' Change back to home $ cd ~ ' Start the desktop environment cinnamon $ startx

We can then get some games going for instance

' Create a games folder, I like putting it in a root area to be clean and easy $ sudo mkdir /games ' We need to give file permissions to the folder $ sudo chmod 775 /games $ sudo chown root:games /games ' You should be able to write to that folder now (your in the games group right?) ' Copy WoW to the games folder ' Lets setup a wine prefix for WoW $ playonlinux ' Download latest version of wine and wine-staging both x64 (Battle.net bombs on staging, game runs best on staging) ' Error: "This application failed to start because it could not find or load the Qt platform plugin "windows"." ' You will get this error if your wine prefixes are NOT Windows XP. ' You will get this error if your running the "Battle.net" prefix with a -staging version of WINE! ' Wine bug confirmed: https://bugs.winehq.org/show_bug.cgi?id=39985 ' Create two new prefixes, "Battle.net" and "Warcraft" ' Run winecfg on the "Warcraft" prefix ' Set CSMT enabled on "Warcraft" prefix ' Disable the d3d11 library on "Warcraft" prefix ' Run winecfg on "Battle.net" prefix ' Disable the dbghelp library on "Battle.net" prefix (answer yes to important question) ' Run 'World of Warcraft Launcher.exe' in the "Battle.net" prefix to allow updates and such ' Run 'Wow-64.exe' in the "Warcraft" prefix to play game with CSMT enabled. ' Setup scripts to do this for both programs. Using WINEARCH=win64 and WINEPREFIX= to prefixes --- Game Start Script --- #!/bin/bash WINEDEBUG=-all WINEARCH=win64 force_s3tc_enable=true __GL_THREADED_OPTIMIZATIONS=1 WINEPREFIX=~/.PlayOnLinux/wineprefix/Warcraft /home/zharvek/.PlayOnLinux/wine/linux-amd64/-staging/bin/wine /games/World\ of\ Warcraft/Wow-64.exe --- Game End Script --- --- Battle.net Start Script --- #!/bin/bash WINEDEBUG=-all WINEARCH=win64 WINEPREFIX=~/.PlayOnLinux/wineprefix/Battle.net /home/zharvek/.PlayOnLinux/wine/linux-amd64//bin/wine /games/World\ of\ Warcraft/World\ of\ Warcraft\ Launcher.exe --- Battle.net End Script ---

I install a few more applications

' Text editor, archive manager, stuff... $ sudo pacman -S gedit file-roller ttf-liberation quodlibet gimp redshift freerdp remmina gtk-engine-murrine gtk-theme-arc

Tweak some settings

' Firefox first ' Open options from menu button, click Content on left. ' Default Font: Times New Roman; 16 ' Proportional: Serif; 16 ' Serif: Times New Roman ' Sans-serif: Arial ' Monospace: Courier New; 13 ' Add your own addons, uBlock Origin, signin to Sync if you use, config custom sync server if you use ' Tweak the console ' I prefer gray text on black background, size around 100x40. ' Edit bash profile to create tmpfs firefox profile directory $ nano ~/.bash_profile ' Add line: mkdir -p /tmp/profile ' Make a symbolic link to tmpfs profile directory from current profile $ cd ~/.cache/mozilla/firefox $ ln -s /tmp/profile ulw90aed.default (use profile folder) ' Install CK Kernel ' Install CK Repo ' Use http://repo-ck.com/ information $ sudo nano /etc/pacman.conf ' Update pacman cache $ sudo pacman -Syy ' Check your board type and install (also choose nvidia driver) ' https://wiki.archlinux.org/index.php/Repo-ck $ sudo pacman -S ck-ivybridge ' Update syslinux (boot loader) ' LABEL arch-ck ' MENU LABEL Arch Linux CK ' LINUX ../vmlinuz-linux-ck ' APPEND elevator=bfq cryptdevice=/dev/sda2:cryptroot:allow-discards root=/dev/mapper/cryptroot rw ' INITRD ../initramfs-linux-ck.img ' Check default kernel ' DEFAULT arch-ck

Remove non-CK kernel

' Remove old kernel to save space on /boot $ sudo pacman -R linux nvidia
Load More Posts