Saturday 19 August 2017

Useful git commands

Ty Walls has an excellent collection of git commands for reviewing git history and troubleshooting.

https://tygertec.com/find-stuff-git/

Friday 18 August 2017

Using GIT from a network share

Running git on a remote network share, even when you have a good connectivity, is painful and slow.

It turns out someone clever has a better approach to using git in this use case.

http://www.watkyn.com/blog/2011/09/22/Using-git-at-work-on-a-Windows-network-drive/

Sunday 30 July 2017

Type errors when using VLOOKUP

When using VLOOKUP it will only find matches of the same data type as source.

The link below has some solutions;

https://exceljet.net/formula/vlookup-with-numbers-and-text

TL;DR,

=IFERROR(VLOOKUP(id,planets,3,0),VLOOKUP(id&"",planets,3,0))

Sunday 9 July 2017

Useful Docker and LXD info

Documentation

Developer documentation of using docker inside LXD
There are problems using docker inside LXD, many applications cannot run inside a LXD, this can in part be mitigated by applying the docker profile provided by LXD but this does not work for many applications.

Good example of bridging containers onto LAN, including setting up static ip's

Start container at boot time

Snippets

  • #!/bin/bash
  • # Delete all containers
  • docker rm $(docker ps -a -q)
  • # Delete all images
  • docker rmi $(docker images -q)

Sunday 9 October 2016

Use OLE DB (Excel Spreadsheet) in SSRS

I have been learning a lot of SSRS and SQL server recently and have wondered how to apply the awesome toolset of SSRS to some other problems I have found.

From most of the resources I have found it is usually quoted that the only way to use excel as a datasource for SSRS is by adding the excel document as a ODBC, however in lots of environments that will not be possible due to security settings. 

In the back of my mind I was sure that I had seen excel used with OLE DB data source before. 

Finally I found an example of it working here;

Essentially you use the following connection string
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

and all works as hoped 




Success!

The only other point to make is that you need to reference the sheet name with a $ suffix,
SELECT
F1 AS rowNum
,F2 AS theValue
FROM
[Data3$]

More resources: 

I wish I found these earlier! 

Connection strings,
https://www.connectionstrings.com/excel-2007/

Stack exchange question about the same problem:
http://stackoverflow.com/questions/24499299/connecting-excel-2013-to-ssrs-2012-to-use-as-a-datasource



Monday 8 August 2016

Regenerate TS3 priv key

If you need to regenerate the ts3 priv key you can start the server with a temp admin key using

ts3server_minimal.sh serveradmin_password=YourNewPassWord
(http://shawnhyde.com/post/2010/01/12/How-to-recover-serveradmin-access-of-teamspeak3ts3-server-after-system-reload)

Login with:
login serveradmin password

Then generate key with:
use 1 tokenadd tokentype=0 tokenid1=6 tokenid2=0

(https://freevps.us/thread-11350.html)

Friday 12 February 2016

Checksums in Windows

For a while I have been meaning to find a good checksum tool that I can use within windows but have gotten around to doing it properly.

SuperUser to the rescue:
http://superuser.com/questions/166233/is-there-a-built-in-method-for-computing-an-sha-1-or-md5-hash-in-windows-7
http://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7

These led me to this:
http://code.kliu.org/hashcheck/

There is another alternative named HashTab but after reading this and looking at each of the options I ended preferring the look of Hashcheck.