Upgrade Debian 6 Squeeze To Wheezy 7

I had a debian box which I needed to upgrade speciffically to wheezy.

Open the sources file and change the word squeeze to wheezy
nano /etc/apt/sources.list
Change the words ‘squeeze’ to ‘wheezy’

deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main

Save and exit
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot
Job done šŸ™‚
Continue Reading

Map owncloud share in linux using webdav

Install davfs2
apt-get install davfs
Reconfigure davfs2 to allow access to other users (select ‘yes’ when prompted).
dpkg-reconfigure davfs2

Add users you want to be able to mount the share (where USER is the username)
usermod -aG davfs2 USER

Create a mountpoint
mkdir /mnt/owncloud
Mount the WebDav ownCloud
mount -t davfs https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud
If your owncloud installation is in a directory other than ‘owncloud’ substitute it above. I used HTTPS which will encrypt communication and credentials but HTTP can also be used but obviously is higher risk.
Credentials can be automatically supplied by adding them to the following files
system wide /etc/davfs/secrets
individually ~/.davfs2/secrets
Edit either file using nano and add
https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud USERNAME PASSWORD
To mount on boot add the following to fstab
https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud davfs2 user,auto 0 0
(using noauto instead of auto will prevent it beingmounted automatically so choose depending on your enviroment)
To manually mount use
mount /mnt/owncloud
To unmount use
umount /mnt/owncloud
When I tried to create a test file on the shared I got the following error
touch: setting times of ā€˜test’: No such file or directory
To fix this edit yourĀ /etc/davfs2/davfs2.conf file and change/uncomment the ‘use_locks’ parameter to
use_locks 0
Continue Reading

Mounting a WebDav Share In Linux

Will clean up this post when i get a chance


apt-get install davfs2


Remote filesystems should not be indexed, so you should exclude the /dfs directory from the updatedb command:
edit /etc/cron.daily/slocate.cron and add the /dfs directory in the list of excluded directories:
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net,/dfs"




Continue Reading

Day 2

So i’ve had breakfast and now waiting for Sarah to start day 2 of the assessment. Apparently today we are taking a dog to the local garden centre to experience what it’s like being in a public place with one.

Continue Reading

Install mysql php5 and phpmyadmin on raspberry pi

Install PHP

sudo apt-get install php5-cgi

Edit php.ini file
sudo nano /etc/php5/cgi/php.ini

Scroll the bottom and add
cgi.fix_pathinfo = 1

save and exit

Enable fast CGI
sudo lighty-enable-mod fastcgi-php

Restart lighttpd
sudo /etc/init.d/lighttpd restart

Create phpinfo page
sudo nano /var/www/phpinfo.php

and add the following
<?php phpinfo();?>

Save and exit

Enter Pi ip addres into a browser followed by phpinfo.php
http://192.168.1.x/phpinfo.php

Install MySQL and PHPMYADMIN

sudo apt-get install mysql-server mysql-client phpmyadmin

mysql root password, confirm

During the installation of PHPMyAdmin you will be asked which web server is installed. Choose lighttpd.

A message will appear asking whether you want to create a dummy database. As the message states, if you know what you are going to be using the database server for or a database is already configured then you can answer no but if you are just experimenting then you can answer yes.

I recommend answering yes to this. It doesn’t do any harm.

Continue Reading

Install lighttpd webserver on raspberry pi

This quick guide will walk you through installing the lighttpd webserver on a raspberry Pi.

Update packages
sudo apt-get update

Install lighttpd
sudo apt-get install lighttpd

Once completed enter your pi’s ip address in a browser and if all has gone well your should see the holding page.

Now we will adjust some permissions to ensure the ā€œPiā€ user account can write files to the location where Lighttpd expects to find web pages. The /var/www directory is currently owned by the ā€œrootā€ user. So let’s make the ā€œwww-dataā€ user and group the owner of the /var/www directory.
sudo chown -R www-data:www-data /var/www

Allow the ā€œwww-dataā€ group permission to write to /var/www
sudo chmod 775 /var/www

Add the ā€œPiā€ user to the ā€œwww-dataā€ group.
sudo usermod -a -G www-data pi

For permissions to take effect reboot te Pi
sudo reboot

Continue Reading

Installing grive (google drive sync) on the raspberry pi

I had the need to upload files to the cloud to share with family members and rather than using web servers/ftp I thought i’d try something different and try uploading to my google drive, after a quick search I found the grive application and this is my howto for intsatalling it. This application syncs data between your pi and google drive so when exectued any newly created directories and files on either will be refelcted on the other.

Debian GNU/Linux 7.0 \n \l
Linux devpi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux

sudo apt-get install git cmake build-essential libgcrypt11-dev libjson0-dev libcurl4-openssl-dev libexpat1-dev libboost-filesystem-dev libboost-program-options-dev binutils-dev libboost-test-dev libqt4-dev libyajl-dev

cd /usr/binĀ (or location of your choice)

git clone git://github.com/Grive/grive.git

Now the next bit i’m unsure if it is required but I saw a couple of places and mention it and it worked for me.

nano /usr/bin/grive/libgrive/src/drive/State.cc

Lines that use the Add() method need to contain a cast to the correct size of integer. The expression “(boost::uint64_t)” must be added to lines 251, 252 and 256.

Original code

[code]void State::Write( const fs::path& filename ) const
{
Json last_sync ;
last_sync.Add( “sec”,Ā Ā  Json(m_last_sync.Sec() ) );
last_sync.Add( “nsec”,Ā  Json(m_last_sync.NanoSec() ) );

Json result ;
result.Add( “last_sync”, last_sync ) ;
result.Add( “change_stamp”, Json(m_cstamp) ) ;

std::ofstream fs( filename.string().c_str() ) ;
fs << result ;
}[/code]

Edited code

[code]void State::Write( const fs::path& filename ) const
{
Json last_sync ;
last_sync.Add( “sec”, Json((boost::uint64_t)m_last_sync.Sec() ) );
last_sync.Add( “nsec”, Json((boost::uint64_t)m_last_sync.NanoSec() ) );

Json result ;
result.Add( “last_sync”, last_sync ) ;
result.Add( “change_stamp”, Json((boost::uint64_t)m_last_sync.NanoSec() ) );

std::ofstream fs( filename.string().c_str() ) ;
fs << result ;
}[/code]

cd grive

cmake .

make

Go off and make a cup of tea, this was the output from my ‘make’

— The C compiler identification is GNU 4.6.3
— The CXX compiler identification is GNU 4.6.3
— Check for working C compiler: /usr/bin/gcc
— Check for working C compiler: /usr/bin/gcc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Check for working CXX compiler: /usr/bin/c++
— Check for working CXX compiler: /usr/bin/c++ — works
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info – done
— Found libgcrypt: -L/lib/arm-linux-gnueabihf -lgcrypt
— Found JSON-C: /usr/lib/arm-linux-gnueabihf/libjson.so
— Found CURL: /usr/lib/arm-linux-gnueabihf/libcurl.so (found version “7.26.0”)
— Found EXPAT: /usr/lib/arm-linux-gnueabihf/libexpat.so (found version “2.1.0”)
— Boost version: 1.49.0
— Found the following Boost libraries:
—Ā Ā  program_options
—Ā Ā  filesystem
—Ā Ā  unit_test_framework
—Ā Ā  system
— Found libbfd: /usr/lib/libbfd.so
— Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version “1.2.7”)
— Boost version: 1.49.0
— Found the following Boost libraries:
—Ā Ā  program_options
— Looking for Q_WS_X11
— Looking for Q_WS_X11 – found
— Looking for Q_WS_WIN
— Looking for Q_WS_WIN – not found.
— Looking for Q_WS_QWS
— Looking for Q_WS_QWS – not found.
— Looking for Q_WS_MAC
— Looking for Q_WS_MAC – not found.
— Found Qt4: /usr/bin/qmake (found version “4.8.2”)
— Boost version: 1.49.0
— Configuring done
— Generating done
— Build files have been written to: /usr/bin/grive
root@devpi:/usr/bin/grive# make
Scanning dependencies of target grive
[Ā  1%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/Drive.cc.o
/tmp/ccUoIJGZ.s: Assembler messages:
/tmp/ccUoIJGZ.s:1217: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[Ā  3%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/ResourceTree.cc.o
[Ā  5%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/State.cc.o
/tmp/ccqpHvLk.s: Assembler messages:
/tmp/ccqpHvLk.s:1304: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[Ā  7%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/Resource.cc.o
/tmp/ccsa5Cwk.s: Assembler messages:
/tmp/ccsa5Cwk.s:1784: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[Ā  8%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/Entry.cc.o
[ 10%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/CommonUri.cc.o
/tmp/ccoSoHiI.s: Assembler messages:
/tmp/ccoSoHiI.s:2087: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 12%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive/Feed.cc.o
/tmp/ccxSRdbr.s: Assembler messages:
/tmp/ccxSRdbr.s:2043: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 14%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive2/Drive.cc.o
[ 16%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive2/Resource.cc.o
[ 17%] Building CXX object libgrive/CMakeFiles/grive.dir/src/drive2/Feed.cc.o
/tmp/ccRyox4j.s: Assembler messages:
/tmp/ccRyox4j.s:807: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 19%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/Download.cc.o
[ 21%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/CurlAgent.cc.o
/tmp/cc46d8yU.s: Assembler messages:
/tmp/cc46d8yU.s:2734: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 23%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/StringResponse.cc.o
[ 25%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/XmlResponse.cc.o
[ 26%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/ResponseLog.cc.o
/tmp/ccadIJw8.s: Assembler messages:
/tmp/ccadIJw8.s:2136: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 28%] Building CXX object libgrive/CMakeFiles/grive.dir/src/http/Header.cc.o
[ 30%] Building CXX object libgrive/CMakeFiles/grive.dir/src/protocol/AuthAgent.cc.o
/tmp/ccinj0Nr.s: Assembler messages:
/tmp/ccinj0Nr.s:2734: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 32%] Building CXX object libgrive/CMakeFiles/grive.dir/src/protocol/OAuth2.cc.o
[ 33%] Building CXX object libgrive/CMakeFiles/grive.dir/src/protocol/JsonResponse.cc.o
[ 35%] Building CXX object libgrive/CMakeFiles/grive.dir/src/protocol/Json.cc.o
/tmp/ccQSz3wF.s: Assembler messages:
/tmp/ccQSz3wF.s:1284: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 37%] Building CXX object libgrive/CMakeFiles/grive.dir/src/json/JsonParser.cc.o
/tmp/ccPFN5lG.s: Assembler messages:
/tmp/ccPFN5lG.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 39%] Building CXX object libgrive/CMakeFiles/grive.dir/src/json/Val.cc.o
/tmp/ccpF11ho.s: Assembler messages:
/tmp/ccpF11ho.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 41%] Building CXX object libgrive/CMakeFiles/grive.dir/src/json/JsonWriter.cc.o
[ 42%] Building CXX object libgrive/CMakeFiles/grive.dir/src/json/ValBuilder.cc.o
/tmp/ccLZ9For.s: Assembler messages:
/tmp/ccLZ9For.s:1317: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 44%] Building CXX object libgrive/CMakeFiles/grive.dir/src/json/ValResponse.cc.o
[ 46%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/Config.cc.o
[ 48%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/MemMap.cc.o
[ 50%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/Crypt.cc.o
/tmp/ccO8XZsF.s: Assembler messages:
/tmp/ccO8XZsF.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 51%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/SignalHandler.cc.o
[ 53%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/Exception.cc.o
/tmp/ccW3Aswb.s: Assembler messages:
/tmp/ccW3Aswb.s:1298: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 55%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/StringStream.cc.o
[ 57%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/File.cc.o
/tmp/ccfUIifg.s: Assembler messages:
/tmp/ccfUIifg.s:1317: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 58%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/DateTime.cc.o
/tmp/ccdVVlEY.s: Assembler messages:
/tmp/ccdVVlEY.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 60%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/OS.cc.o
/tmp/ccZ13815.s: Assembler messages:
/tmp/ccZ13815.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 62%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/StdStream.cc.o
[ 64%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/log/Log.cc.o
[ 66%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/log/DefaultLog.cc.o
[ 67%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/log/CompositeLog.cc.o
[ 69%] Building CXX object libgrive/CMakeFiles/grive.dir/src/util/log/CommonLog.cc.o
[ 71%] Building CXX object libgrive/CMakeFiles/grive.dir/src/xml/String.cc.o
[ 73%] Building CXX object libgrive/CMakeFiles/grive.dir/src/xml/TreeBuilder.cc.o
/tmp/ccw5H8GH.s: Assembler messages:
/tmp/ccw5H8GH.s:1258: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 75%] Building CXX object libgrive/CMakeFiles/grive.dir/src/xml/NodeSet.cc.o
/tmp/ccChV8aK.s: Assembler messages:
/tmp/ccChV8aK.s:1284: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 76%] Building CXX object libgrive/CMakeFiles/grive.dir/src/xml/Node.cc.o
/tmp/cce88Vcr.s: Assembler messages:
/tmp/cce88Vcr.s:1284: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 78%] Building CXX object libgrive/CMakeFiles/grive.dir/src/bfd/Backtrace.cc.o
[ 80%] Building CXX object libgrive/CMakeFiles/grive.dir/src/bfd/Debug.cc.o
[ 82%] Building CXX object libgrive/CMakeFiles/grive.dir/src/bfd/SymbolInfo.cc.o
Linking CXX static library libgrive.a
[ 82%] Built target grive
Scanning dependencies of target btest
[ 83%] Building CXX object libgrive/CMakeFiles/btest.dir/test/btest/UnitTest.cc.o
[ 85%] Building CXX object libgrive/CMakeFiles/btest.dir/test/btest/JsonValTest.cc.o
/tmp/ccmfDU7O.s: Assembler messages:
/tmp/ccmfDU7O.s:1331: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 87%] Building CXX object libgrive/CMakeFiles/btest.dir/test/btest/ValTest.cc.o
/tmp/ccykX0B1.s: Assembler messages:
/tmp/ccykX0B1.s:1331: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
Linking CXX executable btest
[ 87%] Built target btest
Scanning dependencies of target grive_executable
[ 89%] Building CXX object grive/CMakeFiles/grive_executable.dir/src/main.cc.o
/tmp/ccCqNHWz.s: Assembler messages:
/tmp/ccCqNHWz.s:1788: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
Linking CXX executable grive
[ 89%] Built target grive_executable
[ 91%] Generating src/moc_MainWnd.cxx
[ 92%] Generating ui_MainWindow.h
Scanning dependencies of target bgrive_executable
[ 94%] Building CXX object bgrive/CMakeFiles/bgrive_executable.dir/src/main.cc.o
[ 96%] Building CXX object bgrive/CMakeFiles/bgrive_executable.dir/src/MainWnd.cc.o
[ 98%] Building CXX object bgrive/CMakeFiles/bgrive_executable.dir/src/DriveModel.cc.o
/tmp/cc6HZ70x.s: Assembler messages:
/tmp/cc6HZ70x.s:1731: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[100%] Building CXX object bgrive/CMakeFiles/bgrive_executable.dir/src/moc_MainWnd.cxx.o
Linking CXX executable bgrive
[100%] Built target bgrive_executable

Next create a directory where you want to keep your google drive files ie /home/user/googledrive and copy the grive executable to it.

root@devpi:/usr/bin/grive/ cp grive /home/user/googledrive

NOTE: RUNNING THIS APPLICATION WILL SYNC DATA BETWEEN GOOGLE DRIVE AND YOUR PI, CHECK YOUR USAGE ON GOOGLE DRIVE TO ENSURE YOU HAVE ENOUGH STORAGE ON YOUR PI

The first time your run grive you need to do it with the -a option

cd /home/user/googledrive

./grive -a

A link will be printed in the terminal window. Copy the link and paste it in a browser. A page on google will appear asking you confirm permissions for the app.

After clicking accept you will be taken to another google page which has a bog with a code in it

copy and paste this into your terminal

Please input the authentication code here:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Reading local directories
Synchronizing folders
Reading remote server file list
Synchronizing files
sync “./grive” doesn’t exist in server, uploading
sync “./test” created in remote. creating local
Finished![/code]

That’s it your first sync is done, your googledrive directory on your pi should now reflect whats stored on your remote google drive. Adding files to either the pi or cloud will be reflected the next time grive is exectuted using the command grive from your created folder ie

cd /home/user/googledrive

grive

Now you can create scripts/cron jobs to automatically sync your files.

ENJOY!

Continue Reading

HP Microserver N54L Nas Build

As per my previous posts i've decided to take the plunge and go for the N54L Microserver from HP. Rather than doing many posts covering the post I will be encompassing everything into a single one as a blog reader I find this easier to follow than many posts spread over lots of days causing confusion.

 
As I said previously the thing that put me off about the microserver was the fact it had no media card slots and only a single 5.25" bay. After some research i've found a solution, namely the Startech Slim Optical & 3.5in Hard Drive Mounting Bracket for 5.25in Front Bay which allows for fitment of slim optical drive and a standard 3.5" device in my case a media card reader.

That's the first problem sorted, the next one was to overcome the fact that the internal usb on the N54L doesn't use a header as on most motherboard but rather a 'real' usb port. I managed to find the Akasa External to internal USB adapter which will convert from the header connector on the media card reader to a usb port. I purchased this and a Samsung SN-208FB/BEBE 8x DVD/RW SATA Slim Black OEM along with a Akasa AK-ICR-07U3 3.5" Black Internal Multi Card Reader M2, Micro SD & USB 3.0 from Scans store on ebay for total of £27.66 delivered to my local argos store, ok so the usb 3.0 connector is pointless for the microserver but i've had a couple of the cheapo media readers before and they seem to just stop working or break so thought i'd spend a couple of poound extra on a named brand.
 
More to follow………..
Continue Reading