Friday, 2 May 2014

Find corrupted video files

After some problems with corrupted video files that would not play I found this command;

find -size +100M -exec file '{}' ';' |grep ": data"

That allows you to quickly find files that are not recognised as video files and you can then delete or fix as needed.

File is an incredibly versatile on linux and can be used to identify all sorts of filetypes, in this case I use it to find files of filetype "data", basically file's way of saying it doesnt recognise the file.

Happy hunting!

Friday, 17 January 2014

Setting up bidirectional sync for Outlook and Google Calendar

It seems Google is trying to make it difficult to sync Google calendar and outlook when they discontinued their Google calendar sync.

However there are still install files around in the wild and the sync still works so if you get it installed it all still works - for now.

Download link: 
http://google-calendar-sync.en.softonic.com/download

Source link: 
http://www.ablebits.com/office-addins-blog/2013/11/20/sync-google-calendar-with-outlook/#google-apps-sync

Also if it doesn't seem to like two stage authentication - instead setup an app specific password instead and it works fine!

Happy syncing!

Saturday, 30 November 2013

EyeFi Mobile X2 will not connect to Wifi

So new EyeFi card will not connect to my router with the error message "waiting for a network address", after some investigation the logfile shows this:

eyefi AssocResp: Error status 0x0002, aid: ffff, error/cap: 0xfffc (Auth response timeout)

Which according to this site http://forums.eye.fi/viewtopic.php?f=2&t=3347 can indicate a faulty card reader, I plugged the reader directly into my USB port and hey-presto. Everything worked.

Wednesday, 28 August 2013

ARMA 3, probability of presence for group


I recently wanted to create a group of units based on probability; so 50% of the time spawn a group of units at a certain position.

To do this create the group, set the probability of presence of the leader to your desired probability and then for each member of the group set a condition of presence that requires the leader to be present. So,

(alive group_leader);

Job done!



Edit - Added screenshots for clarity:

You can have as many units as you want, in this example I have a player (blue), a group leader (purple civillian in front), and 4 dependent civilians behind. Ordinarily you would have all these units grouped using the group tool (F2) so they work as a team but it is not required.
Units
 Group leader can be configured any way you want, what is required is to have a unique name (make a note of this) and to set a probability of presence (which will set the probability of the whole group spawning).

Group leader config

 Now onto setting up the dependent units. A unit will spawn when the expression in its condition of presence evaluates to true. In this case we want it to evaluate to true when the group leader is present. The syntax for this is
(alive group_leader);
making sure that group_leader is the name of the leader that you configured earlier.
Dependent unit config

Tuesday, 23 July 2013

Windows disk usage analysis

Having just started using windows much more frequently I needed to work out what was hogging all my disk space, this tool 


Did the job nicely and found a good 40Gb of crap that can be deleted. Result! 

Wednesday, 13 March 2013

Remove unused kernels and headers from ubuntu server

Yet again I found my system clogged up with unused kernels and headers. This time I am making a note of the one-liner to remove the unused junk.

(Found at http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/)

You can first check that the correct packages are selected to remove with;

 dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove 

and if you are happy remove those with this;

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge


A word of warning, if you have installed a new kernel recently ensure you have rebooted since, and secondly ensure that your current kernel is not on the list of packages to remove of you will end up with a un-bootable system.

eth0 naming persistance

I needed to change the physical hardware for an instance of Ubuntu Server 12.04 after some hardware failed, although most of the hardware changes were seamless the network adapter name changed from eth0 to eth1, the fix for which I found here.

http://www.serenux.com/2009/11/howto-fix-a-missing-eth0-adapter-after-moving-ubuntu-server-from-one-box-to-another/

Essentially the udev rule found at

/etc/udev/rules.d/70-persistent-net.rules


Stores and makes persistent the names of the respective adapters.  By removing the line relating the that adapter is identified by such as

ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="00:a0:c9:78:9a:bc", NAME="eth0"




Subsequently the new adapter is then initialised with the name eth0.