Sunday, 16 March 2014

Bacula backup with FreeNAS as Storage


There is a plugin in FreeNAS 9.x and probably above to create Bacula-SD (storage daemon)
this is how I configured Bacula to work with the SD.
(this is pretty much for myself just as a reminder)

Step one install FreeNAS 9.x and create some storage
then install the plugin and using common sense accept the defaults
then using the plugins menu at the side set up a sane setup with password
note down the password for use later

FreeNas Bacula







It should look something like this (see screenshots), it pretty much can only be filled in one way.

then on the client (machine to backup)

aptitude install bacula

 or aptitude and search for bacula


accepting the defaults

after the install edit the following files to look something like these (links to files provided for ease)

bacula-dir.conf
bacula-fd.conf
bacula-sd.conf
bconsole.conf
and
tray-monitor.conf

and edit the "passwords" to match your freeNAS password
then edit bacula-dir.conf and search for "FILE =" to include and exclude the files you wish to backup.
Before running bacula open edit /etc/hosts and  add the line
<IP ADDRESS OF FREENAS> bacula
replacing information between the <> the address of your FreeNAS box

restart the services
service  bacula-sd restart ;service  bacula-director restart ;service  bacula-fd restart 
then open bconsole and run a backup with "run" and follow the on-screen instructions
sample of bconsole

this might take a few hours to backup depending on your home
you can also if you install it copy tray-monitor.conf to your ~/ and then run that as a monitor

tray-monitor application

Tuesday, 21 January 2014

Hackintosh, Linux and Windows triple boot using GRUB

Hackintosh, Linux and Windows triple boot using GRUB2


After much experimentation with various boot-loaders and not having much joy because of the an Asus z78-pro mother board, I came up with this solution to the problem .


  • Install Windows  (unplugging all the other hard drives)
  • Plug in the other hard drives and install OSX on the 3rd Hard drive with your pre prepared USB stick using myHack
  • Finally Install your preferred Linux on Hard Drive one

Hackintosh Mini 9
Hackintosh Mini 9 (Photo credit: rblock)
After installing (Debian in this case) you will have a GRUB option for OSX but this doesn't work for me, boot in to Linux and edit /etc/defaults/grub/40_custom (or something like that varies by system)

set parms 'Mac OS X'
     insmod hfsplus
     set root=(hd2,gpt1)
     multiboot /boot

replacing the (hd2,gpt1) with your partitions hd0 is 1st hard drive and gpt is the first partition and they go up e.g hd1 is hard drive 2 etc etc

then run as root
update-grub2    

if all this works, go buy a copy of OS X :)

Sources:
grub2 http://www.gnu.org/software/grub/manual/grub.html
refind http://www.rodsbooks.com/refind/

Enhanced by Zemanta

Sunday, 19 January 2014

Black Magic Design drivers and missing linux-headers

If you are a Debian user and have a Black Magic Designs intensity pro and maybe other hardware, You may have noticed that it will no longer install. This is due to  a missing dependency (linux-header)

it is an easy fix, fake it!

install equivs

then run
# equivs-control linux-header

edit the file it creates with some sane defaults
such as

 ### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
Homepage: www.xpd259.co.uk
Standards-Version: 3.9.2
Package: linux-headers
Version: 1
Maintainer: Dick Thomas
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
Architecture: all
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: faux linux headers package for black magic
  faux linux headers package for black magic


then run
# equivs-build linux-headers
# dpkg -i linux-headers_1_all.deb


now you can install the Black Magic as normal 



sources
http://www.blackmagicdesign.com/

Wednesday, 16 October 2013

MinDLNA & Sony Bravia

miniDLNA & Sony Bravia 

KDL32CX523BU 

The logo of Sony is not considered a "wor...
(Photo credit: Wikipedia)
if like myself you own a Sony Bravia KDL32CX523BU or pretty much any other Sony Device, You may find it doesn't detect your freeNAS or Linux miniDLNA server.

The answer is very simple!
once you know how, 

I had to set the "friendly name" as the device I was connecting to 
and serial number as "123456" and Model number as "1"


FreeNAS miniDLNA settings

 

Enhanced by Zemanta

Wednesday, 4 September 2013

Acer W500 Tablet and Debian Gnome 3



English: Debian GNU/Linux 6.0 ("Squeeze&q...

Acer W500, Debian and Gnome

After reading an article about the w500 and Linux I wanted to try this for myself, but with Debian, As I found the 5 distributions they tried lacking something and I have little experience with them to fix any bugs, or just don't like the Company, The only redeeming feature of selection they tried in the article was from Ubuntu and the  virtual keyboard on-board, but I even though Ubuntu/Unity is "made" for touch it wasn't very positive experience and would grind to a halt after a few minutes of trying to open the dash.

The hardware 

Acer Iconia W500, with a dual core 1GHz AMD-C50 CPU, 2GB DDR3 RAM, a 1280 x 800 10.1-inch WXGA capacitive screen, an AMD Radeon GMA 6250 and a 32GB SSD. It all comes with Bluetooth, Wi-Fi, dual cameras (front and rear), USB ports and MicroSD - so in essence it's not a bad little bit of kit.

Booting the Acer
In addition, there's also the accelerometer function which, among other things, allows the tablet to flip the screen when it is turned on its side, but I was unable to get this working

Installation

At the time of writing there's a bug in debian Wheezy, where a few letters on the gnome virtual keyboard don't enter as upper case only lower case. So when selecting a password for your root and user accounts use lower case, for the moment unless upgrading to testing where the bug is fixed




For this you will need the following items
  1. USB CDROM drive (not TESTED USB key drive but should work the same)
  1. Debian either DVD or net install ISO image, WIFI should work with the installer out of the box but I wasn't sure so I used the non-free firmware ISO (see bottom of page for link)
  1. USB keyboard as there is no virtual keyboard during install or post install
Connect the USB devices and power up, Then either pressing F12 or holding down Windows key, volume up and power buttons this should boot off the CDROM, install Debian in the normal way (video of install on a desktop but it is the same process), but also install SSH server as you may need it later.
I like to use lvm and combine my SDcard and SSD in to one "drive" to double the space of the drive, but I will never be able to remove the SDcard again as it is part of the installation now.
Finish the installation by placing the grub boot menu on /dev/sda and reboot.







Once booted login using the usb keyboard and connect to your wifi, and either ssh or the usb keyboard edit your gdm greeter config
sudo nano /etc/gdm/greeter.settings
To use the gnome-shell rather than fall back mode which debian uses by default. 
This will enable "accessibility" on the upper right corner allowing the ability to enable the virtual keyboard
Then install the ATI proprietary drivers to allow accelerated / 3d rendering
ignoring any on screen promts to use ATI software to set up the config and use the config in the wiki for best results
Before reboot we need fix the screen saver as at the moment there is no way to unlock the screen saver without switching user.
these commands need to be run via the GUI not SHH or you might get errors.


install matchbox-keyboard via add & remove programs or command line.
$ gsettings set org.gnome.desktop.screensaver embedded-keyboard-enabled true
$ gsettings set org.gnome.desktop.screensaver embedded-keyboard-command "matchbox-keyboard --xid"


demo of the first part of the set up done via ssh

http://showterm.io/128c8c4190f003393831c


Then on to the lack of a right click, this problem can be  solved by using drivers from a 3rd party website and the the use of "grab and drag" in firefox 

Download the driver from http://home.eeti.com.tw/LinuxDriverDownload.html  extract
and install using

# unzgip  eGTouch_v2.5.3120.L-x.zip
# cd eGTouch_v2.5.3120.L-x
# chmod +x setup.sh
# ./setup.sh

and follow the instructions on screen and reboot, now when there is a long press on the screen it should activate the 2nd mouse button click.



Conclusion

after a few weeks of using this setup, I find the gnome 3 desktop Perfect for touch and with the inclusion of the Fire-fox add on "grab and drag" it finishes off the perfect touch experience that I had with the default OS of windows 7 and I personally think surpasses it

Resources

Enhanced by Zemanta

Wednesday, 31 July 2013

Creative Commons Tattoo

Creative Commons Tattoo by Dick Thomas
Creative Commons Tattoo, a photo by Dick Thomas on Flickr.

This is my Tattoo
DNA surrounding a USB symbol means geek in my DNA and the rest means My DNA can only be used for non commercial uses and you must share alike (aka making babies)

Friday, 8 March 2013

Hardware RNG

rng prototype
rng prototype (Photo credit: Dick Thomas)
these are the results from my failed RNG test build that killed my Arduino , I think it might work with some modification to the code


Enhanced by Zemanta

Friday, 1 March 2013

Android and Media Goblin

Some assumptions of this guide
  • you have eclipse and all the android stuff installed and working
  • you have a working media goblin instance
  • you know how to work eclipse and android sdk
1st thing is to enable the correct things in Media Goblin, edit your media ini file, mine is found /srv/mediagoblin/mediagoblin/mediagobin_local.ini
# place plugins here---each in their own subsection of [plugins]. see
# documentation for details.
[plugins]
[[mediagoblin.plugins.geolocation]]
[[mediagoblin.plugins.api]]
[[mediagoblin.plugins.oauth]]
then run
./bin/gmg dbupdate 


Then we need to build our android client but! before we do that we need some Oauth stuff visit http://media.example.com/oauth/client/register obviously changing details for your site, fill out the forms as a private with no redirect URL and either keep this page open or print it to PDF (Save paper) then we need the android client code so clone the git repo with

xpd259@mars:~/workspace$ git clone git://github.com/joar/mediagoblin-android.git
Cloning into 'mediagoblin-android'...
remote: Counting objects: 107, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 107 (delta 36), reused 107 (delta 36)
Receiving objects: 100% (107/107), 317.13 KiB | 82 KiB/s, done.
Resolving deltas: 100% (36/36), done.
in eclipse edit the resource
mediagoblin/src/org/mediagoblin/android/client/NetworkUtilities.java

and change the secret key and client id already filled in with your own and then build on your client, Then on your phone it will now load up media goblin and ask for a url fill this in, and then login using your username and password now any media your from the gallery and maybe other apps (not tested this yet) will have a share to media goblin icon, after giving your media a title and such a quick upload will silently add it to the upload sync and
moments later it will be on your gallery

Enhanced by Zemanta

Wednesday, 6 February 2013

multiple ssl certificates, apache2 and debian


there maybe other ways to do this but me and a friend spent 5+ hours at this problem and this was the only solution

1st you will need your files from StartSSL
I ended up with a www.key, www.crt, sub.class1.server.ca.pem and ca.pem files
while using the example at Apache + startssl does work, it requires a password typing during the startup of apache to de-encrypt the encrypted key files, while this is great for security, but when trying to use two key files with a password apache just asks for the one and ignores the others
so I removed the password from the key file and made it in to a plain pem file, and configure apache in one file


openssl rsa -in www.key -out www.pem

/etc/apache2/Ports.conf
NameVirtualHost *:80
Listen 80

Listen 443
NameVirtualHost *:443
SSLStrictSNIVHostCheck off
/etc/apache2/sites-available/default-ssl
<VirtualHost *:443>
        ServerName www.exapmple.com
        ServerAdmin email@example.com

   SSLEngine on
   SSLProtocol all -SSLv2
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

   SSLCertificateFile /etc/apache2/ssl/www.crt
   SSLCertificateKeyFile /etc/apache2/ssl/www.pem
   SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
   SSLCACertificateFile /etc/apache2/ssl/ca.pem
...
rest of normal config
...
</VirtualHost>

<VirtualHost *:443>
ServerName gallery.example.com
ServerAdmin webmaster@example.com

   SSLEngine on
   SSLProtocol all -SSLv2
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

   SSLCertificateFile /etc/apache2/ssl/gallery.crt
   SSLCertificateKeyFile /etc/apache2/ssl/gallery.pem
   SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
   SSLCACertificateFile /etc/apache2/ssl/ca.pem
...
rest of normal config
...
</VirtualHost>


Then a restart of apache2 and loading any modules it requires and "job is good one"


resources

Sunday, 3 February 2013

Easy ssh alias to simplify your life

If you’re anything like me, you're probably using of a half dozen remote servers on a daily basis. And if you’re even more like me, you have trouble remembering all of the various usernames, remote addresses and command line options for things like specifying a non-standard connection port or forwarding local ports to the remote machine.

A typical SSH command looks something like this

 ssh user@example.com
 Password: **************
Not too shabby, but if the port is not on 22 like default, A more complex example of a connection could be something like

ssh sdfds@example.com -p 8937

now we could make this easier by adding a alias to ~/.bashrc so we connect with a simple bash alias

$ alias web='ssh username@web.example.com -p 224050'
and simply running
# web
password: *********

however there is a more elegant solution, ~/.ssh/config

Host mirror
    HostName server1.co.uk
    Port 6223
    User mirror

Host www
    HostName server2.com
    Port 66
    User www-data

Host jupiter
    HostName server3.org
    Port 22
    User xpd259

Host fileserver
    HostName fileserver.foo.com
    IdentityFile ~/.ssh/fileserver_rsa
 
Host Minecraft
     HostName minecraft.foo.com
     User minecraft
     IdentityFile ~/.ssh/minecraft_rsa
     ServerAliveInterval 30                                                                                                                                           
     ServerAliveCountMax 120

then it's possible to connect via a simple

ssh www

or

ssh -X www

Saturday, 5 January 2013

Debian wheezy allow system wide use of wireless

I wanted to allow normal users to be allowed to access wireless networks without knowing the system password or been given access to sudo, while I've been told this has been updated and fixed in the sid package, some might not want to upgrade packages
so fire up your terminal and run

sudo nano /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy

then search for the follow section and below the translations edit the allow_active to say yes

  
<action id="org.freedesktop.NetworkManager.settings.modify.system">
...
...
  <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>

this should allow normal users to use network manager and use wifi without the admin passwords this "fix" might get undone if an update is applied to the system
this should also work for any system using policykit such as ubuntu and arch

Wednesday, 5 December 2012

force chrome bookmarks to open in a new tab

force chrome bookmarks to open in a new tab


To force chrome to open a URL in a new tab regardless of the mouse button the link is clicked with it is as simple as editing the URL with something like this

javascript:window.open('http://www.spritesandbites.net/');

sources

thanks to Spritebites on twitter

passwordless truecrypt in Linux

Passwordless Truecrypt

Using truecrypt to secure your data is a very wise idea, not only does it stop prying eyes from reading your data encase your PC is stolen it also means you can use a dropbox style syncing service, safe in the knowledge your data can (almost) never be read if the service is comprimised


Things you will need to do this

  • Root or Sudo access
  • knowledge of the command line
  • know how to use an editor

First Step creating the group to limit users to the truecrypt group who can use truecrypt

groupadd truecrypt

Edit the sudo config to allow the group to run the command

#Allow all members of group truecrypt to execute truecrypt command
%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt

Add users to the group

gpasswd -a USER1 truecrypt
gpasswd -a USER2 truecrypt

logout and in again, and now when truecrypt is run, there should be no password dialog for mounting and unmounting other than your TC vaults password

Friday, 30 November 2012

creating <code> block in blogger

Creating a <code> block in blogger

I love my blog template, but it was lacking a code block to highlight when I was posting code other then using quote and that just didn't look right.

so how to go about it, html and css was the key. Make a background then make a green box around it then add some padding

.code{
background:gray;
padding:25px;
max-width:550px;
color:limegreen;
border-style:dashed;
border-width:2px;
border-color:limegreen;
}

this was all the css I needed to make the box look how I wanted it, but now to use it, I could use it inline but that would mean adding something like it everytime I made a post.
This was a messy idea and would mean dupication of code, putting it in the template and calling <p> class="code" </p> in the html editor was much more elegant.and less prone to errors
to edit the html/css visit Template in settings then customise-> Advanced -> css


by adding this code to the css section of advanced section of the template editor I can call it by adding the following to a post

<div> class="code" <p> text goes here</p> </div>
this creates the desired effect