Browsed by
Category: Problem solutions

Intel Hardware RAID vs Microsoft Storage Spaces

Intel Hardware RAID vs Microsoft Storage Spaces

RAID systems on home servers and PC’s has become more common now. While we have been in a period of stubbornly elevated prices (from a historic standpoint), hard drives are always doubling in capacity on a regular cadence and improving performance.

There are several things you need to consider when setting up a RAID system. Will this set be my boot drive? What capacity do I need? How much fault tolerance do I need? What performance do I need?

The answer to these questions determines which RAID configuration you should set up. For my setup, I need fault tolerance and performance. This means I will continue to run RAID 5.

Question is, can I do better? There is software RAID available from Microsoft in Windows 10 called Storage Spaces. Also included with most Intel-based motherboards is a hardware RAID. So which should one choose?

Turns out someone has done the analysis between them, and done a good job too. Long story short, stick to hardware RAID, and RAID 5 is still the fastest and most fault tolerant configuration.

Windows vs Intel Raid Performance Smackdown

My 3 brand new 4TB 7200rpm drives are about to thank me. 🙂

VNC on Ubuntu 16 and 17

VNC on Ubuntu 16 and 17

Works on 17.04 as well.

The biggest pain about Ubuntu is changes they made to vnc setup. Often, once you think you have it set up, you connect and get nothing but the ancient X windows grey screen with no way to interact with the UI.

This method works for 17.04 and 16.04. It’s also faster performance that other approaches.

Ubuntu 16.04 – Configure your system to have x11vnc running at startup

Summary:

sudo apt-get install x11vnc -y
sudo x11vnc -storepasswd /etc/x11vnc.pass
Edit /lib/systemd/system/x11vnc.service

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target

sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
sudo shutdown -r now

On reboot run the script:
sudo ./vnc-startup.sh

Or, just manually start it:
x11vnc -usepw -forever

Use your vnc client to connect to the system’s ip address at port :5900

Kernel compiling and the PIC mode error

Kernel compiling and the PIC mode error

If you see this when compiling an Ubuntu or other kernel (my case was a Yocto kernel on an Ubuntu 17.04 distro)

...
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
/usr/src/linux-4.4/scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
/* empty file to figure out endianness / word size */

 

Then the issue is with your gcc installation. In gcc 6+ versions, PIE (position independent executables) is enabled by default. So in order to compile you need to disable it. Even gcc 5 has the issue. This is a known bug for gcc. Bug Link.

So far there is no official patch from gcc side, so the workaround is to patch the Makefile of kernel source.

If you are familiar with patching the source file use the codes from this link to create the patch file then try to compile.Patch File

Here’s the patch to add to your kernel Makefile to disable PIE compiling.

diff –git a/Makefile b/Makefile
index 5c18baa..e342473 100644
— a/Makefile
+++ b/Makefile
@@ -612,6 +612,12 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux

+# force no-pie for distro compilers that enable pie by default
+KBUILD_CFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CFLAGS += $(call cc-option, -no-pie)
+KBUILD_AFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=

 

Shiny Pokemon and iPhone screen recording

Shiny Pokemon and iPhone screen recording

I was fooling around with Pokemon Go and ended up getting a very rare shiny Magikarp. I also wanted to know how hard it was to record the iPhone screen and the sound. There are lots of different ways from both PC and Mac, but I used my Mac Mini and it was very easy:

  1. Connect your iPhone or iPad to your Mac via the lightning cable.
  2. Open QuickTime player.
  3. Click File then select ‘New Movie Recording’
  4. A recording window will appear (with you in it, most likely). …
  5. Select the Mic of your iPhone if you want to record music/sound effects.
  6. Click the Record button.

So, I recorded the evolution from the rare shiny Magikarp to the rare shiny Gyarados. Results were very good:

VNC-ing into Ubuntu 14.04

VNC-ing into Ubuntu 14.04

Some VNC functionality was broken in Ubuntu 14.04 due to Vino, but fortunately, it’s fixable:

 

Using a combination of clues from http://discourse.ubuntu.com/t/remote-desktop-sharing-in-ubuntu-14-04/1640 (which is all about VNC access) and https://bugs.launchpad.net/ubuntu/+source/vino/+bug/1281250 (which discusses the bug introduced into Vino) I have managed to resolve the matter.

Essentially you have to disable encryption on remote desktop access in Gnome due to a bug that has come to surface in Vino. However, some threads tell you to uncheck it in the wrong place. Follow these guidelines and you should be able to resolve it quickly.

Specifically it’s

dconf > org > gnome > desktop > remote-access > require-encryption – uncheck

and NOT

dconf > desktop > gnome > remote-access > enabled – uncheck

Here is how you do it:

  1. First make sure Desktop Sharing is set up properly.
  2. Download dconf-tools by typing in Terminal sudo apt-get install dconf-tools
  3. Run dconf-Editor
  4. Expand org
  5. Expand gnome
  6. Expand Desktop
  7. Select Remote Access
  8. Uncheck Require Encryption (don’t click on Set to Default as it rechecks it)
  9. Exit dconf-Editor

It should now work. Tested through a reboot and all good.

Hope it helps.

(I have got a screen shot of dconf but don’t have enough points on here to post it – I am sure everyone can work it out for themselves though! 🙂 )

Tanya’s plan to avoid the fallacies of crunching and bad work habits

Tanya’s plan to avoid the fallacies of crunching and bad work habits

Tanya Short gave one of the best talks I’ve heard in a long time about the fallacies of crunching and bad work habits many people have. The video is now up for free at the GDCVault. Her talk starts at 6:00 :
http://gdcvault.com/play/1024174/Indie

Summary of her points:

When trying to hit deadlines, she starts out by observing that most of the time we think ‘getting X done’ is our highest priority. It’s not. It’s actually #3:

Your real priorities:

  1. Don’t burn out (i.e. don’t die)
  2. Always keep in mind you’re going to do another – and you should be excited to do the next one even better.
  3. Get it done

That sounds great, but it also sounds a bit idealistic. She says it is not easy, but lays out these points.

Step-by-step roadmap to not dying:

  1. Believe it is possible to hold those priorities in that order
    Many great studios work and ship games without crunch. It can be done, she does it. You just have to be disciplined.
  2. Stop working ‘all the time’. Set work hours.
    It is a fallacy to think working all the time is better. Especially in creative fields. Creative work and creative problem solving require a relaxed mind to do it. Time away from work helps us be more productive. So set work hours and stick to them.
  3. Prioritize your tasks and re-prioritize as often as needed.
    In order to hit your deadlines, you need to know what you’re working on RIGHT NOW is important, not just urgent. If you focus just on the ‘urgent’ emails/tasks/etc, then you’ll never get into the steady workflow that is what makes your work great.
  4. Estimate your tasks. Re-estimate when needed.
    When you finish your task, ask if it took the time you thought it would take. You should do that with every task. It helps you get better at estimating.
  5. Cut the scope before you bleed out.
    If you’re 3 weeks out and realize you won’t make it, don’t immediately think about working more/harder/longer. 3 or more 60 hour weeks is scientifically less productive than 3 or more weeks of 40 hour weeks. You are doing worse work. Even if you think you are a special exception. Why can she say that? A study was done on 100 people that claimed they needed less than 7 hours of sleep. Only 5 out of the 100 could actually do it.
  6. Don’t give up – iterate steps 1-5 again and again
    These steps (production) is a skill. Skills can be developed. Skill development requires practice. So congratulate yourself when you do it pretty well, forgive and be kind to yourself when you don’t treat yourself as you deserve.
    We are primates. Primates need to be taken care of in a way computers and games don’t, so don’t act like that towards yourself. It’s not about how many hours you spend because everyone is different.

Other quotables:
A few long nights won’t kill you, but a few long months might. Especially if combined with other health and life factors.

Burnout is the feeling of being dulled as layer after layer of exhaustion accumulates. Burnout is the void left behind where your career could have been.

Then she has a real Benedictine moment: The moment right now will never come again. Every one of us will die. No matter what we create, all we have is right now. Don’t use up that joy, love, and creative energy you have by burning yourself out.

Keep death always before your eyes.
—St. Benedict: The Rules: Chapter 4.47


She doesn’t cite the studies, but I found some:

http://lifehacker.com/working-over-40-hours-a-week-makes-you-less-productive-1725646811

Set up VNC on Ubuntu 14.04

Set up VNC on Ubuntu 14.04

Setting up VNC on Ubuntu used to be pretty painless. But recent changes in Ubuntu and X have left it kind of a mess. It took me way longer to set up VNC than it should have, and finding the documentation wasn’t super-easy either. There were lots of broken guides. So, here’s what you need to do:

  • Follow these setup instructions first:
    https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
  • When completed, however, a known issue means the screen will come up blue-grey and have few desktop controls if you try to connect to it. This is because (near as I can tell) the X manager currently used for Ubuntu doesn’t work over VNC anymore. You need to set VNC up to use an older desktop manager that
  • To fix that problem, you need to fix things according to this guide:
    http://onkea.com/ubuntu-vnc-grey-screen/
  • On your client, start the vncserver and connect to it by matching the final digit of the port number to the :X number you used to create it.
    • Example:
      host: vncserver :4 –geometry 800×600 (to create the server)
      client should use the ip: 10.23.47.150:5904
  • If you get an error starting the vncserver, increment the :2 to :3 or :4 and so forth until you find one not in use by some other user on the server.