Tuesday, June 21, 2016

Data Recovery on Windows Storage Spaces using ReclaiMe

Soo. I've been venturing into Server products these past few months and I decided to build a Windows Server 2016 TP5 and utilise Windows Storage Spaces for the home data storage. I pooled all the drives together and I didn't have enough space to move storage here and there so I decided to create a huge pool with Simple Virtual Drives. Little did I know that one of the old drives I had decided to fail.

So now I had multiple Virtual Drives which have data that is inaccessible at all. I thought I was basically screwed because Windows Storage Spaces recovery isn't as simple as just pulling out a drive and extracting data. It uses it's own proprietary format to store data.

I found this site and used this: http://www.storage-spaces-recovery.com/ and it managed to find my Virtual Disk. But I needed the main program ReclaiMe from http://www.reclaime.com/buynow.aspx to be able to scan the disk. I was skeptical at first and it really took a long time to scan the whole virtual drive because it was 7TB. 20% per 24 hours so it took about 5 days. I wasn't able to preview much due to the software limitations for a trial version but after looking through at some of the Jpeg file previews, I realised that the data was readable by ReclaiMe.I decided to take the plunge and purchase the Ultimate Version (I previously had an ext partition on it so I guessed it found that too and so I had no choice but to buy the Ultimate Version) and saved all my files. I don't think I have 100% of them due to some of the data being on the 2TB drive that failed but 70-80% of the important family photos is better than 0%. I'm pretty impressed with their software and will definitely use it again for reading ext or hfs drives when I need it. (There doesn't seem to be a reliable ext or hfs driver for Windows anyway).

Thursday, November 13, 2014

Arch/Manjaro + rTorrent + RuTorrent + autodl-irssi + Nginx

NOTE: This guide might need some editing. It was a draft and i decided to just post it.

So i was setting up rTorrent and ruTorrent on Manjaro today and i actually had quite a few issues doing this.
I didn't want to use the normally used apache as i didn't want to have two webservers installed and only wanted one. I'll detail the steps below as to what problems i faced while doing this and hopefully this will help you.

So first let's start with rTorrent. You'll just be installing rTorrent via your package manage so just do

sudo pacman -S rtorrent

It should install rtorrent without a hitch. Follow the configuration guide here and the systemd section too if you want it installed on boot.

You should have nginx installed already so i won't be going through that but you need to install RuTorrent and RuTorrent-plugins via AUR which is actually the Arch User Repository.


Download both tarball's via wget and tar xvzf them.

wget https://aur.archlinux.org/packages/ru/rutorrent/rutorrent.tar.gz
wget https://aur.archlinux.org/packages/ru/rutorrent-plugins/rutorrent-plugins.tar.gz
tar -xvzf rutorrent.tar.gz
tar -xvzf rutorrent-plugins.tar.gz

Once that is done make sure to go and check your /etc/php/php.ini file for the open_basedir value and check the nginx logs when you set the server up. This gave me a lot of 502 errors and i was wondering what the problem was. Basically that setting in php was the problem. So if you're getting a 502 error in php then that's your problem.

Things that need fixing are:
Directory Permissions

For php-fpm.service:
cd /usr/lib/systemd/system
sudo nano php-fpm.service
Change PrivateTmp=true to PrivateTmp=false

For the config.php:
You have to add /usr/bin/curl to the curl line for the rss feeds to work properly

cp -r /usr/share/webapps/rutorrent /srv/http/www/
cd /srv/http/www/rutorrent/
rm -rf conf
cp -r /etc/webapps/rutorrent/conf /srv/http/www/rutorrent/
cd /srv/http/www/rutorrent/
mkdir tmp
chmod 777 share
chmod 777 tmp
chown http:http tmp
sudo nano /srv/http/www/rutorrent/conf/config.php
$tempDirectory = '/srv/http/www/rutorrent/tmp'
 mkdir -p ~/.irssi/scripts/autorun
 ln -s /usr/share/autodl-irssi/AutodlIrssi ~/.irssi/scripts
 ln -s /usr/share/autodl-irssi/autodl-irssi.pl ~/.irssi/scripts/autorun
sudo nano /etc/php/php.ini
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin

nginx server block:
   server {
        listen 8088;
        root /srv/http/www/rutorrent;
        location / {
            index index.php index.html;
        location ~ \.php$ {
            # Filter our arbitary code execution
            #location ~ \..*/.*\.php$ {return 404;}
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
            include fastcgi.conf;
        location /RPC2 {
            include scgi_params;
            scgi_pass localhost:5000;

For autodl-irssi you have to edit a few things and install a few packages first. I didn't want to use the one in AUR because it hasn't been updated in awhile. First you need to install some dependencies and fix some stuff.

pacman -S irssi perl-archive-zip perl-digest-sha1 perl-html-parser perl-json perl-json-xs perl-net-ssleay perl-xml-libxml perl-xml-libxslt ed
sudo nano /etc/php/php.ini
Remove ; at the line extension=sockets.so
wget --no-check-certificate -O autodl-setup https://autodl-irssi-community.googlecode.com/files/autodl-setup
sh autodl-setup

 mkdir -p ~/.irssi/scripts/autorun
 cp -r /usr/share/autodl-irssi/AutodlIrssi ~/.irssi/scripts
 cp -r /usr/share/autodl-irssi/autodl-irssi.pl ~/.irssi/scripts/autorun

gui-server-port = 6738
gui-server-password = weehoo

$autodlPort = 6738;
$autodlPassword = "weehoo";

Description=irssi Service

ExecStart=/usr/bin/screen -dmS irssi irssi
ExecStop=/usr/bin/screen -S irssi -X quit



Friday, April 26, 2013

Guide to Compiling Sonora for Mac

So i recently downloaded Sonora for Mac and realised that there was no last.fm compatibility built in due to the source code being public now. I was trying to compile Sonora for Mac for the first time and ran into a few snitches, I couldn't find a proper guide for an idiot to compile Sonora so here's my quick one.

Download mogenerator from http://github.com/downloads/rentzsch/mogenerator/mogenerator-1.27.dmg

Install mogenerator

Make sure you have XCode and it's Command Line Tools installed before trying anything below.

Open up Terminal and type

sudo gem install cocoapods (This part may take awhile depending on your internet connection)
pod repo add Sonora-podspecs git://github.com/zanechua/Podspecs.git master
git clone git://github.com/sonoramac/Sonora.git
cd Sonora
nano Podfile

Change the line from git://github.com/sonoramac/INAppStoreWindow.git to git://github.com/zanechua/INAppStoreWindow.git

Ctrl + O
Ctrl + X

pod install
git submodule update --init --recursive

Frameworks Archive: https://github.com/downloads/sbooth/SFBAudioEngine/Frameworks.tar.bz2
SFBAudioEngine requires frameworks that aren't included in the main repository. Download the Frameworks archive here and place the Frameworks folder inside Sonora/External/SFBAudioEngine/.

Generate your own Last.FM API Key at http://www.last.fm/api
Specify sonora://lastfmauth/ as the callback url

Copy the API Key and Secret Key to replace the placeholders in SNRConstants.m.

Fire up XCode and open Sonora.xcworkspace

Start Building and you'll start facing errors that are automatically fixable by XCode itself.

Apply this patch if you encounter this problem


Wednesday, December 12, 2012

Monday, September 17, 2012

HP Envy 15 ACPI, AHCI,White List, LAN Controller, Virtualization, Wake-On-Lan

Not sure if anyone will be looking for this but i've modified the latest HP Envy 15 11xx bios to allow the use of AHCI mode instead of RAID mode. Removed the White List for Wi-Fi Cards so now you can use any Wi-Fi cards you want. Using ACPI 4.0, enabled the LAN Controller and Wake-On-Lan function on S3/S5 (Sleep/Shutdown) states. Be careful with this. Once you flash, you better be prepared to format your installation again.

Download : http://cl.ly/2Y2E3e343Y2y

Monday, September 10, 2012

Linux Mint Debian Edition with Netatalk 3.0.1 for Mountain Lion 10.8 Support

I needed to share files with the macs i have in my house and i have a Brother DCP-7060D which has a scanner. It scans the files to the computer however i would still need to access it right? So i decided to set-up AFP on it. I installed the default netatalk 2.2.1 that was on the repository but then I decided to upgrade to netatalk 3.0.1 instead since a more updated release usually means more fixes and we all know of the problems with Lion and older netatalk versions. So if you're interested in using netatalk 3.0 then here's a short tutorial on how to compile it.

We'll need some of the libraries and header files to compile netatalk 3.0.1 Type this in a terminal.
sudo apt-get install libssl-dev libdb-dev libgcrypt-dev libcrack2-dev libavahi-client-dev libldap2-dev libacl1-dev libwrap0-dev checkinstall build-essential

So now the libraries are installed we need to get netatalk 3.0.1 sources.
cd ~
wget http://sourceforge.net/projects/netatalk/files/netatalk/3.0.1/netatalk-3.0.1.tar.gz
tar xvzf netatalk-3.0.1.tar.gz
cd netatalk-3.0.1

Now you need to configure the source files first
./configure --enable-debian --enable-zeroconf --with-cracklib --with-acls --with-ldap --enable-tcp-wrappers --with-init-style=debian

That should end properly with no errors stating what is supported whatsoever and now we compile it.

Once that is done we run checkinstall so we can properly remove it if needed.
sudo checkinstall --pkgname=netatalk --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no

After that is done, netatalk should be properly installed.

All the configuration is done in one file now which is really awesome. The file is afp.conf and it's located at /usr/local/etc/afp.conf. We'll edit the configuration file and add in some stuff.
sudo nano /usr/local/etc/afp.conf

This is my personal configuration file and you can modify it as necessary.
Here's more info about how to modify afp.conf http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html


So once you have your afp.conf configured you'll need to restart netatalk.
We do this with this command
sudo service netatalk restart

Oh and one more thing. To get netatalk to start on boot, run these commands:
sudo update-rc.d -f netatalk remove
sudo update-rc.d netatalk defaults

Feel free to add any extra volumes according to the configuration file. You're basically done. If you're lazy and don't want to compile it. I've compiled a .deb file already and you can get it from the link below. It's 32bit only. Cheers.

Compiled only the 32bit 3.0.1 version.

EDIT: 3.0.2 is out. Haven't tested it but the steps should be the same.

Download: http://cl.ly/3Z0r2y1j0Y46 32bit

Sunday, August 26, 2012

Automation with Brother Scanner on Ubuntu 12.04 + ArchLinux

So you've an All-In-One Printer/Scanner like me and you need to use brscan or brscan2 or brscan3 or brscan4 with the brscan-skey tool to get your Brother Scan to File/Image/Email etc working right?

First of, you need to find our the proper drivers for your scanner. I'm just gonna point you to the main page which is here > http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html

Eitherway, make sure to have these packages installed:
*Actually. I don't even think you need GIMP. But it's good to have it installed anyway.

sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt-get update
sudo apt-get install sane-utils
sudo apt-get install netpbm
sudo apt-get install gimp
sudo apt-get install gimp-plugin-registry
sudo apt-get install gimp-resynthesizer

*On another note, there are a lot of tutorials out there to get your scanner working and most of them are filled with information on how to do it. I'm only gonna show you how to customise the scripts. With a lot of information from Ray over at his blog > http://raywoodcockslatest.blogspot.sg/2010/05/scanning-functionality-for-brother-mfc.html

I copied his code and made modifications. For some weird reason his code didn't work out of the box for me so i had to modify it accordingly once i saw the original brother scripts. These are the scripts

These scripts can be found in directories residing inside /opt/scanner/..



Credits to Ray!


So i still have my old laptop running linux but i recently needed the hard disk for something else and there's no hard disk in there. How about running linux off a thumbdrive? Sure! Just install ArchLinux onto it, install the packages and you're ready to go. I did however meet into some issues when i was trying to configure the Scantofile.sh script for mine. For some weird reason the pdf files just wouldn't convert properly and i was honestly too lazy to debug. So i just modified the Scantoimage.sh script and now we have a working Scantofile.sh script too. The script is below. The extra package you need is imagemagick.

Scantofile.sh Alternate

Wednesday, August 15, 2012

TotalFinder - a better Finder for OS X

So i recently bought a new Mac and I came from Windows. I've been using a different explorer for Windows for awhile and it had dual windows side by side, i could copy from one directory to another without having to create a new explorer Window for it. I was looking for some similar functionality in OS X and i came across TotalFinder. Lifehacker has TotalFinder as the best finder add on for OS X and i have to agree. I've been using TotalFinder for the past few days and i've got to say i'm loving some of the functionalities that i'm so used in Windows such as Cut and Paste which OS X doesn't natively have. Command + X and Command + V, almost the same as Windows.

This is TotalFinder in dual mode.

Not to mention that there are multiple tabs in Totalfinder allowing you to create an extra tab if you need to do file transferrings quickly. Does the tabs on TotalFinder look vaguely familiar? They're Google Chrome's implementation of it and the same shortcuts work too! Command + T to create a new tab and Command + W to close the current tab.

TotalFinder with two tabs opened.

In Windows Explorer, you're able to view hidden files with just unchecking a setting however in OS X, there isn't a setting to do that. I used to do that with an app for OS X called ShowHiddenFiles however with TotalFinder all i need to do is just press Command + Shift + '.' and all the hidden files appear. If i want to hide them again, you just have to press the same shortcut keys again.

TotalFinder showing hidden files in my user directory

TotalFinder comes with a lot of extra features and they extend the usability of Finder for OS X.
Interested? You can check it out for yourself here: http://totalfinder.binaryage.com/