After a bit of research I found a product called GateOne that would enable me to use a web browser to connect to ssh using standard https – cool!
Install GateOne
Shell
1
2
3
4
5
6
7
sudo apt-getinstall python-setuptools
git clonehttps://github.com/liftoff/GateOne.git
cdGateOne
sudo python setup.pyinstall
cd..
sudo rm-rf GateOne
sudo gateone
Then ctrl+c so we can edit the config
edit config
Shell
1
sudo vi/etc/gateone/conf.d/10server.conf
at the end of the line with origins, add the IP of the Pi, i.e. , “192.168.0.123” then restart the daemon:
restart daemon
Shell
1
sudo/etc/init.d/gateone restart
to check it out browse to https://192.168.0.123/
All that remains is to ensure it starts automatically on reboot – I think the update-rc.d script must be a bit buggy on the Pi. I ended up doing all of this as I was having some trial and error fun:
start automatically
Shell
1
2
3
4
sudo update-rc.dgateone defaults
sudo update-rc.dgateone start202345.stop80016.
cd/etc/rc2.d/
sudo mvK01gateone S01gateone
Next up – some authentication …
within /etc/gateone/conf.d/20authentication.conf the authenication type was changed to google
authentication
Shell
1
"auth":"google",
and the terminal configuration (/etc/gateone/conf.d/50terminal.conf) was modified to turn off the terminal for all users (allow: false) and then add it back on just for me:
"commands":{"SSH":{"command":"/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/applications/terminal/plugins/ssh/scripts/ssh_connect.py -S '%SESSION_DIR%/%SESSION%/%SHORT_SOCKET%' --sshfp -a 'oUserKnownHostsFile=\\\"%USERDIR%/%USER%/.ssh/known_hosts\\\"'","description":"Connect to hosts via SSH."}},
"commands":{"SSH":{"command":"/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/applications/terminal/plugins/ssh/scripts/ssh_connect.py -S '%SESSION_DIR%/%SESSION%/%SHORT_SOCKET%' --sshfp","description":"Connect to hosts via SSH."}},
"default_command":"SSH",
"dtach":true,
"enabled_filetypes":"all",
"environment_vars":{"TERM":"xterm-256color"},
"session_logging":true,
"syslog_session_logging":false,
"allow":true
}
}
}
Back in /etc/gateone/conf.d/10server.conf I added my external dns to the list of allowed origins and forwarded port 443 on my router to my Pi
After downloading the latest wheezy image from the raspberry pi site and flashing it onto the SD card using Win 32 Disk Imager I transferred the card into the Pi and powered it on. To use my approach it must have both the WiFi usb adaptor and an ethernet cable plugged in.
I then go to my router’s admin page and take a look to see what IP address has been allocated to the Pi’s ethernet link.
Then, using Putty, connect to the ssh using the credentials username: pi password: raspberry (all lowercase).
Once on, the following command were run:
Configure wifi
Shell
1
2
3
sudo apt-getupdate
sudo apt-getinstall wicd-curses
sudo wicd-curses
Then navigate down (using the arrow keys) to my home network, then use the right arrow key to go and configure it. The only thing I put in the configuration was the setting to “Automatically connect” and the key to the network – then pressed F10 to save the config, the Q to quit.
Having done all that I shutdown the pi, unplug the ethernet cable and power it back on.
shutdown
Shell
1
sudo shutdown-hnow
Back in my router’s admin page I can find out the new IP address of the Pi (and reserve it for future if I want).
In one of my C# Windows Forms Applications I had a problem whereby a third-party component was throwing an exception in another thread. The exception wasn’t causing any problems but it wasn’t being handled by anything.
Basically I wanted to catch the exception, log it for reference and possible future investigation, and then ignore it and carry on.
I started by adding event handlers to the exception events:
So I needed to ensure that all sites in my farm were formatting dates in the British format …
Powershell, once again, to the rescue! This is what I ended up with …
So I had a need to get a csv that could tell me who was in which groups in which sites.
Powershell to the rescue! This is what I ended up with …
There may be a better way to do this but the main thing is that it works and it was quick!
SharePoint permissions
PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Add-PSSnapinMicrosoft.SharePoint.PowerShell
functionOutputRow($url,$group,$member)
{
$out=new-objectpsobject
$out|add-membernoteproperty url$url
$out|add-membernoteproperty group$group
$out|add-membernoteproperty member$member
write-output$out
}
foreach($appinGet-SPWebApplication)
{
foreach($sitein$app.Sites)
{
OutputRow$site.Url"primary site owner"$site.owner
OutputRow$site.Url"secondary site owner"$site.SecondaryContact
foreach($webin$site.AllWebs)
{
if(!$web.HasUniqueRoleDefinitions)
{
OutputRow$web.Url"Everything Inherited from parent"""
Quite often things break – sometimes I’m able to fix them.
The way I see it is that if it’s broken and is going in the bin then I’ve got nothing to lose by taking it apart and trying to see if it can be fixed.
Most recently I had the external thermometer of a wireless weather station stop working. I was pretty sure some water had got into it so I dried it in the airing cupboard but it still wasn’t responsive. With nothing to lose I took it apart, saw that there was a fair amount of corrosion on the circuit board and almost gave up. Just on the off-chance that the components were still ok and the corrosion was causing a short I got an old toothbrush and cleaned it up.
Miraculously this worked and I’ve saved £35 on a replacement. Result!
So I’m starting a blog – we’ll see how long that lasts!
The main types of article I intend to write are:
Technology – this could be something I’ve worked on as part of my profession or something I’ve tinkered with as part of my hobbies. Generally they will be for my own consumption for future reference but may help others out if they get to the 4th page of google.
Beer – I like beer I do. Articles may vary from a simple beer review to my adventures into homebrewing and also may cross over into technology because the only thing better than making beer is making beer and leveraging technology at the same time.
RPG’s – and other assorted games. Everything from D&D through Carcassonne and back to Skyrim. What I’ve been playing, what I want to play etc etc.
Pi – 3.14159 … and the raspberry pi too. I’ve got a couple of these and enjoy tinkering.
Stuff – Anything else that takes my fancy.
The main types of article I intend to avoid writing are:
Personal – anything to do with day to day life. When I see other blogs of that ilk I tend to squirm.
Fan Fiction – I’m not a “writer”.
Humus – It’s not tasty, especially with Jammy Dodgers.
I contemplated having separate blogs for each of the topics that I end up writing about but then I realised it was just too much overhead – I’m a whole person and this blog is for me. Furthermore, I will be using the categories you will see at the right of every page to vigilantly categorise each post – so if you only want my posts about SharePoint there will be a category that niftily filters the posts and shows you only the ones that you’re interested in.