fredag den 11. april 2014

upgraded my server. awesomeness followed



So i was getting a bit tired of my two aging NAS servers was fighting me every bit of the way, when ever i wanted to use them for something else than what the manufacturers intended, so i upgraded to a HP Proliant Microserver N40L that could contain the 4 drives from my Netgear Duo and Zyxel NSA 320.

Right away i installed plain Debian headless, and at this point i have finally been able to make a setup to sooth my needs without having to dig through german forums hoping that google translate would not trick me into running commands that would screw up a installation.

Owncloud, Plex, SMB shares, Bittorrent Sync, SubSonic SSH tunneling, vsftpd server. I am living the dream here, and in the process learning a lot that is not restricted to one single model of one simple tweak for some store brand NAS server. Here is a platform that lets me use my simple knowledge of Linux, while learning so many awesome things in the process that i can also use in other parts of my digital life, from my Linux Mint Laptop, to general database structure for programming.

Next up is a LAMP install to run projects from, and setting up SNORT. Good times. 

onsdag den 8. januar 2014

Using a Raspberry Pi as a medium between external server and local NAS, using Bittorrent Sync



So i managed to sell my server build in bits and pieces. And for the money i purchased a 2 bay Zyxel NSA320, despite having an unfortunate name, it is a small form factor standard NAS. 1.2 GHz processor and 512 MB RAM. It is close to official with support for the Fonz Fun Plug, and if using from USB stick it is fairly fool proof as the NAS OS is left untouched, unless you want to kill it. The NAS is pretty loud and as far as i can tell there is no way, system wise, to lower the RPM's. S.M.A.R.T. spins the drives down, but the chassis main fan spins at full speed no matter what. I took it apart and it looks like control of the fan has been disabled by hardware. Next to the fan plug is what looks like a controlled fan mount, but soldering on this device based on a theory is further than i am willing to go at this point. Instead i bought a Fan Mate 2 physical resistance controller, that i have yet to install.

#Update. The Fan Mate can be installed but have no effect what so ever on the fan.





First thing i did was to throw the ARM build of Bittorrent Sync on it to sync it up with my remote server, and it was up and running within 15 minutes. After a reboot, btsync was nowhere to be found. And i had made sure i placed it in the permanent storage. Btsync would run and be forked to the background, but gui was unresponsive no matter what. I cleaned out every bit of btsync from .sync to license.txt but no matter what, a install would work, but gui would not. i then tried a manual install by compiling every bit of btsync to try to change the listening port as some users had reported 100% cpu use and unresponsive gui from using port 8888. In my case it did not work. Btsync still runs, but gui remained unreachable from any browser.



Now btsync is actually fairly easy to set up using the bash command line and since it really only needs to be set up very rarely it would be pretty straight forward. I however choose to utilize a Raspberry Pi, that had been sitting on a shelf since i upgraded my media player. I flashed Raspbian on a 8 GB SD card, and to keep from plugging in a HDMI monitor and controllers i used SSH to login to the RPi using the default "pi" and "raspberry" credentials and then run


# sudo apt-get install tightvncserver

# tightvncserver


That gave me a headless control of the RPi using the tightvnc application. From my Windows 8 computer i then ran the tightvnc viewer and connected to the IP. In a quick and dirty move in the /home/ directory i ran


# wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_arm.tar.gz

# sudo tar -xzf btsync_arm.tar.gz

# sudo rm btsync_arm.tar.gz

# sudo ./btsync


That worked straight away. All i had to do now was mount the NAS cifs share as a drive for btsync to download to. in /mnt/ i created a directory


# sudo mkdir nas320


the cifs utilities should come with most distros, but if needed run


# Sudo apt-get install cifs-utils


I then navigated to the /etc/ directory and ran a command to edit the fstab file



# sudo nano fstab



Below the proc, boot and main partition i added a referal to my NAS cifs share:

(keep in mind the following is on the same line in the same tabbed formatting that the already existing drives are)



# //192.168.1.88/sync/video

# /mnt/nas320

# cifs

# credentials=username=your_username,password=your_password,iocharset=utf8

# 0

# 0


Now this is a pretty dirty and unsafe way to do things. For a bit more security i would recommend creating a .smbcredentials file using



# sudo touch .smbcredentials


Where you want to keep the file. This would mean you would have to change the credential part of the line you added in the /etc/fstab file.


instead you would now add


# credentials=/path/to/.smbcredentials,iocharset=utf8


This makes makes the mount persistent and will be mounted upon reboot.

I still need to manually start up btsync, but adding the auto run script is fairly easy, but must wait a few days.








fredag den 20. december 2013

Hackintosh OS X Mavericks on the ASUS N76VM


So after i got a gaming orientated desktop, i decided to try out putting OS X on my ASUS N76VM Laptop, since the internals are Intel it makes it easier than on a AMD based system.

After reading a bit, but not enough, i decided to just go for it since i found a way that seemed to good to be true. Usually with these things i prefer, maybe not the hardest way, but atleast a method that teaches me something along the way. This way did not provide me with that. Well, in a way it did, but not on a system level, not yet anyway. Basically the method used is to use a restore a OS X image to a partition on your HDD. I did. Got 3 read errors but it continued without a problem, i rebooted, and i booted straight to the setup for OS X. 

My first problem was internet connectivity. The WIFI card in the ASUS N76VM is not supported in OS X, meaning it will not work. Some people have worked around this by removing the internal wifi card and installing a supported Atheros card. i thought this step was a bit much for my usage at this point where i want to dual boot windows 8.1 and OS X Mavericks, so instead i used a EOUP 802.11n tiny wifi dongle i had, and after installing the drivers, it worked, but i did encounter some drops in speed to a point that made it useless. 

So at this point most thing works really well. Stable system, USB works, function key works with volume brightness and shortcuts. 

My main problems are at this point:

No dual boot. OS X works, but my windows partition is not working. When booting it shows HD1 to HD4 with HD4 being my OS X /D: partition. And HD1 + HD2 should be Windows 8.1. When i try to boot it, one will try to boot into what looks like Windows 7 with 800x600 resolution, but it then fails at boot and restarts. HD2 just gives me a critical windows error. 

That is what i am working on now. 

Also. Touchpad is bonked. Really bonked. useless. i have found a workaround but my main focus is getting to dual boot at the moment.


In an attempt to easier install kext files to fix my minor issues, i installed the Tony Mac x86 MultiBeast and KextBeast. in MultiBeast i noticed a function that would inform me of recommended tweaks to install. And i made the mistake apply the recommendations. The OS X partition now boots into a black screen. i do have sound so most likely it is a monitor problem. However, as i choose to have it installed manually with a bunch of other tweaks, i have no idea of how to revert the error. So now. No Windows and no OS X.

No extra Kext messing around is needed as the image being "installed"/restored is already set up. i always keep a USB drive with Xubuntu installed on it to solve boot issues, partition management etc, and running boot-repair with the recommended repair option, usually solves boot issues.

______________________________

Update: i had to reinstall everything, since i was unable to work out any solution in either windows, Ubuntu or os x to fix the boot loader. Now i am not saying it couldn't be done. I just grew impatient and reinstalled windows. Bought a dirt cheap 80 GB 2.5" HDD to fill the second slot in the N76VM.

I gave me a chance to work on my digital forensics skills as well, as i bought the HDD used. If you are ever to sell a hard drive that you have used. Make sure you

$ shred -z -u -n200 /dev/sda1 that puppy.

Especially if you have kept nude pictures of you and wife on it. Now i am a good guy, so everything i found was deleted.

I then dedicated the drive to os x, and used R-Drive in windows to write the OS X 50 GB Mavericks image to the drive. And have a fully working install. Well. No wifi since the card is not supported, but it works just fine with a wifi dongle.

Touchpad was actually working just fine all along. Turns out that it just gets confused when a external mouse is attached at the same time. Same problem exists in windows.

So all in all. If i had started out just using a second drive. A fully working OS X install could have been made in less than a half hour.

The bootloader is the text based chameleon bootloader, and i have yet to find the time to solve that issue, as my few attempts to change the bootloader has resulted in a OS X drive returning a black screen on boot.

I will add a link to the Mavericks image file soon, as the yandex link is painfully slow.

#Update. Here is a link to the .arc image file

To bad i didn't write a decent guide. I exchanged OS X for Linux Mint, but after shifting Mint to my main drive in the laptop, and having problems finding a useful way to make music in Mint that is not rendered useless by latency problems, i once again wished to write the Maverick image to my 80 GB. But so far. Every attempt has resolved in stuttering, flickering and freezing on every boot after the first one. So i am now trying to reverse the oh-so simple process of getting it to work.




onsdag den 18. december 2013

Bittorrent Sync helped me out.

So i changed my direction a bit as a i wanted a working setup while making a direct transfer configuration.

i therefore ended up using Bittorrent Sync to sync from a seedbox to my NAS server, and then used rsync to further copy the btsync to a different folder. This level of automation leaves me to just clear out files from serverside and on the NAS once in a while. So it is not a total automation. But i can live with that. Furthermore the setup i am using has torrent interception so for most sites i don't need to first download torrent to add to my seedbox torrent client, rather it intercepts it from the .torrent extension and adds it directly.

While this is working wonders at the moment. My next step will probably be to dive into usenet or to set up the encryption for downloading directly to the NAS. i have grown a bit tired of my NAS build though. i can't blame Nas4Free as it is more than awesome software and it works wonders. However my NAS needs are at this point way below what i feel N4F would be most useful for. Meaning constant spinning CPU and PSU fans for no usage is bothering me. i am now trying to sell my mobo, ram and cpu and acquire some D-Link 2 bay NAS with support for fun_plug instead. 

lørdag den 21. september 2013

Debian on the OUYA. Linux Based XBMC build not far away.

"The idea is not to touch Ouya’s Android at all. Kernel is booted from RAM and Debian from an SD card or USB stick.
The instructions for debootstrapping your own Debian Wheezy rootfs are described in the github repository and the needed binaries are in a temporary location that will probably change at some point.
WiFi is working as well but I’m not sure if the firmware binaries are redistributable, so you need to copy them from the Android rootfs after booting to Debian.
One of my main goals for this whole exercise is video encoding and I’m happy to say that H264 encoding from an USB webcam works nicely with hardware acceleration as well.
I’ve also noticed some issues:
  • Hciconfig doesn’t show BT devices, I didn’t debug much further.
  • Mpg123 seems to play but nothing is heard. Maybe it tries to pass MP3 onwards instead of PCM? GStreamer provides acceleration for MP3 and AAC though.
  • Video acceleration works only with GStreamer and nvxvimagesink. Mplayer can’t even use XV video output correctly.
  • Tegra3 supports only OpenGL ES 2.0 with EGL, so no full OpenGL with GLX.
  • Xrandr seems to be able to switch the resolution but after the switch there was window decoration corruption.
Despite the deficiencies I think Tegra3 is quite well supported in the X.Org world and many things work well with this 99$ device."
"Playing 1080p H264 while running glmark2-es, an OpenGL ES benchmark. And the CPUFreq ondemand governor doesn’t even raise the CPU frequency from the minimum as everything is properly accelerated."



Now this build is still a bit buggy and risky, but it does open the doors to further development that could open up the true power of the OUYA, and not just some low end gaming device. Keep from messing to much around with your OUYA since it is atleast a great deal easier to brick because it lags the hardware to boot into recovery. 
A button has also been discovered in the final OUYA hardware. Unfortunantly it does not let you boot into anything else but NVIDIA's state, where you can't really do anything without the 128 bit encrypted code. 

torsdag den 4. juli 2013

Running Emulators on the OUYA



Seeing that a lot of people are taking their first steps into the world of Android with the low end gaming console OUYA, i thought that a rough guide to emulation on the Android OS is in order. Since the OUYA does not have access to the Google Play store you will need to sideload the emulators and game ROMS. Sideloading is directly installing .apk files, where .apk files is the installation files of a game or application in the Android OS. Like a .exe file on Windows. To sideload you need to first acquire the .apk file and place it on a memory stick or card. In case of the OUYA you will need to place the files on a USB memory stick.


What follows is a short list of links to the most popular emulators:
Note that there are usually more than one emulator for a platform. Try them out to see what works best for you. There is also some emulators for Android in the OUYA store.

Nintendo 64:

N64Droid

N64Oid 2.7

Games


Playstation 1:

psx4droid[3.0.5]

FPse [0.10.45]

Games


Super Nintendo Entertainment System (SNES):





SEGA Genesis / SEGA Megadrive:



Gameboy Advance:





The files is in Zip and RAR format and needs to be unpacked on your PC first. Then transfer the .apk files to your USB memory. For the games. All the Emulators i have tried out works just fine with Zip files, so in most cases you will not need to unpack the games themselves. 

Unzip the file browser .apk and transfer it to your USB storage. 
(For ease of future transfers you could also include this "Airdroid" .apk that will let you connect to your OUYA wirelessly from your PC browser)

By now you should have your emulators in .apk format and your games on your USB storage device, Plug it into the back of your OUYA. 

Now thanks to OUYA coming down with the walled garden Apple fever, accessing your own files is all of the sudden a bit tricky. On your OUYA. Go to the main menu, then navigate to the "make"section, then "software"  And then open the "browser". Now this is basically just a web browser with OUYA's own page set as a start page. That is your way out of the walled garden OUYA has set up.

When you are in the browser. Press "Y" on your controller. And enter the following URL:

http://bit.ly/13SJxOB

i have used bit.ly because the "real" URL is: http://gdown.baidu.com/data/wisegame/86f47585c4eed74f/ESFileExplorer.apk

Which will give you a bad day trying to enter with a controller.

Your OUYA will then download the ES File Explorer application to the internal memory.

Once finished. Navigate back to the main menu. Go to "Manage", "System", "Advanced"

This will bring you to the standard Android menu.

Scroll down to "Storage" then select "Downloads"

Up comes a list of the files you have downloaded. On that list should be the ES File Explorer .apk file.

Select it and press the "O" button. And choose install.

Once finished you will now have access to not only your own files but also the content of your USB storage from the ES File Explorer application.

Navigate back to the main menu. Then "Make" and in the "Software section" next to the browser. You should now have a icon for the ES File Manager.

Now i will not be doing a tutorial in how to use the ES File Manager or setup each of the emulators to work with the OUYA controller. But it does work and both using ES File Explorer to copy your game ROMS over to the internal memory of the OUYA, and setting up the emulators is pretty self explanatory and straight forward. 

First press "O" on the different Emulator .apk files to install them.

Next, copy over your game ROM files to the OUYA's internal memory. Note: Keep the game ROMs separated in a folder for each gaming system you want to emulate.

You can either create a folder on your OUYA or just copy the game ROMs to the "Downloads" folder. in each of the Emulators you will use its internal file explorer to navigate to the ROM directory and it will save where you have pointed it to.

Next go into the settings of your emulator and keymap the different buttons to your liking on your OUYA controller.

Thats it. your $99 US ARM device can now play 20+ year old games.

Update: Seems that some emulators is not able to be installed and will present a "parsing" error. 

onsdag den 3. juli 2013

OUYA, Root & ROMS



For some reason i was really surprised at the userbase that have gathered around the OUYA game console.

When i first saw that the crowdfunding had exploded i had high expectations as well as being a bit surprised as to why so many people was going insane for what seemed to be sort of the specs for a lot of other Android devices. My expectations was high because i for some reason thought that it was the massive developing community that had casts its love and attention on the OUYA.

It turns out that most backers and buyers are people looking for the low end console and not the veteran Android users i thought it would be. There are nothing wrong with that. And the veterans are there, no doubt about it, and so are a part of the developing community as it is the case with most Android devices. But i was surprised at seeing questions fell way below what the average Android user can come up with. And if you are new the Android world, then surely you have no knowledge about the Android enviroment. Why would you?

For some reason a lot of people is almost suprised to learn that the OUYA is running straight up Android. They seem to think that OUYA has build their very own operating system. Of course that is not the case. OUYA is running Android Jelly Bean, with a VERY limiting user interface overlay of their own.

They require a credit from the latest firmware to even log in. There is no Play store access, which would open up for a flood of different ways that the OUYA could be used, not to say the numerous games that could be mapped to use with the awesome OUYA controller.



For users that want to get more out of their OUYA device and that are new to the Android scene. There is a bit more work, and also learning in altering your Device. If you like how the OUYA looks, works and runs then you are all set. If you would like to use the device for more or simply just something else than just playing games. You need to fiddle and read and search and learn. Jailbreaking on IOS has always stood out as a joke to me. On one hand, i can see how just opening an application and pressing the "Jailbreak" button and then wait, is nice and easy. On the other hand, if even the slightest thing goes wrong, then people jailbreaking will not have the slightest idea of what, why and how to fix it. On Android. There are many ways to gain root access to devices, and a lot even comes as a one-click function.

But Android is by nature so open that for you to need root access you really need to want to shake things up or you want to use applications that require root access. Once you have obtained root access, you can then flash ROM's that is tweaked and optimized version of Android.

In order to flash a ROM, you need root access, and imo have CWM recovery installed. The ClockWorkMod Recovery is a state of recovery you can boot into in order to recover, backup, update, clear system cache and other good stuff. Usually you can boot into this state using a combination of pressed down hardware buttons that differs from device to device, and some even have a dedicated "recovery" button. For some reason OUYA did not really feel like adding this feature. How open is that?
In their defense there are not many locked aspects to find in their device. So it will not matter to much.

Luckily there are other ways to squeeze some custom ROM's into the OUYA. And that is Fastboot. Fastbooting is using the ability to connect your PC with your device and executing a protocol if you have root access.

The OUYA has only just reached retail in the last week, and today the first real custom ROM hits XDA. The ZG BETA v0.0.1 Although there have been a few modified stock ROMS available for some time

You will need to be rooted and have clockworkmod recovery installed first.

Unfortunately, the method for obtaining root access, and thereby superuser privileges, is not a one-click. Not yet anyway. So you will have to get your hands dirty and fiddle around a bit. On the plus side. You will learn a lot, and there is always a great community of elitist assholes on XDA to ask for help.

i love that place.