PostgreSQL access over the local network.

After installing postgresql

Edit the pg_hba.conf


under the line


comment out all the lines using #
and then add

host all all trust


host all all trust

and that seems to work. I can log in to the server over my local network using DataGrip.

Firefox: Play BBC New videos without installing flash.

Go here:

and here:

basically create a new item in about:config called general.useragent.override and paste

Mozilla/5.0 (Linux; Android 4.4.4; en-us; Nexus 5 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2307.2 Mobile Safari/537.36

into it.

Installing steam on fedora 22

I had some trouble once I’d installed steam. It would fail to find the swrast driver. After some searching I found that the following command pulled through the required libraries:

sudo dnf install xorg-x11-drv-nvidia-libs.i686

This didn’t work quite so well on Fedora 23 so try this…

sudo dnf install nvidia-driver-libs

or use yumex-dnf to install nvidia-driver-libs.

when akmod-nvidia doesn’t appear to work

After installing akmod-nividia package, you might run into a situation where you install a shiny new kernel but the akmod-nvidia package builds, but doesn’t install the drivers for the Kernel. To get it to install your built drivers do this:

    cd /var/cache/akmods/nvidia; ls
    sudo rpm -ivh kmod-nvidia-###########.rpm
    sudo shutdown -r now

Where ############ is the latest number that corresponds to your new kernel number and the driver version.
You might want to check out the fail log to see why it failed. When this happened to me akmod had tried to install, but rpm was locked.

Simple outlook inbox analysis using R

Emails from eBay members asking questions come through as which can make them hard to count as a group
The following R script re-codes them so they can be counted.


inbox<-read.csv("inbox.TXT", sep="\t")

inbox$EADD <- ifelse(grepl("",inbox$From...Address.), 
                      "" , 


f <- ddply(inbox,c("EADD"),summarize,N=length(EADD))

Once you’ve identified the biggest culprits, make a rule to move or delete them from your email.

c++ binary stuff

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;
int maxBinLen;
string binary( unsigned long n, int needlength );

int main()
    unsigned long n=33;
    unsigned long p=76;
    int binarymax = 20;
    int np  = n & p;
    int x   = n ^ p;
    int s   = n | p;
    int bitshift = n << 1;
    cout<<"n= "<<n<<"  sizeof: "<<sizeof(n)*8+1<<endl;
    cout<<"p= "<<p<<"  sizeof: "<<sizeof(p)*8+1<<endl;
    cout<<"      N = "<<binary(n,binarymax)    <<"  " << n <<endl;
    cout<<"      P = "<<binary(p,binarymax)    <<"  " << p <<endl<<endl;
    cout<<"  N & P = "<<binary(np,binarymax)   <<"  " << np <<endl;
    cout<<" N or P = "<<binary(s,binarymax)    <<"  " << s <<endl;
    cout<<"n xor p = "<<binary(x,binarymax)    <<"  " << x <<endl;
   for (int i=0;i<10;i++)
    cout<<"n xor p = "<<binary((n << i),binarymax)    <<"  " << (n << i) <<endl;
  for (int i=0;i<10;i++)
        n ^= i;
    cout<<"     n ^= "<<binary((n ),binarymax)    <<"  " << (n ) <<endl;
return 0;

string binary( unsigned long g ,int needlength )
    string strBin="";
    string str ="";
    char resultArray[ (sizeof( g ) * 8) + 1 ]; //define an array that is big enough to hold the conversion. Assume this is because there are 8 bits in abyte and we get byte count for the variable type as a sizeof
    unsigned index  = sizeof( g ) * 8;
    resultArray[ index ] = '\0'; //assign the end value to the string
        resultArray[ --index ] = '0' + (g & 1); //count backwards and put the char value and 1 & the zero char value into the array
    while(g >>= 1); //right bitwise operator
    str=string(resultArray + index );
    int strlen=str.length();
    for(int i=0;i<=(needlength-strlen)-1;i++)
  return strBin;  //is this format something to do with returning a string??