Search This Blog

Wednesday, 20 May 2015

Firefox on Kali

This dropped into my twitter TL - Installing Firefox on Kali Linux which was perfect timing as I'd tried do this the previous day.

NB// If like me you ignore the part about un-installing Iceweasel you'll end up with an apt-get error message of 'half-installed' for FF.

Go back, remove Iceweasel and then :
apt-get install --reinstall firefox-mozilla-build
I also needed to manually edit the sources.list as the cut and past didn't work.  You entry should look like :
deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main

Friday, 24 April 2015

Setting System Wide Proxy on Ubuntu

Put your export settings in /etc/environment

https_proxy=http://<host>:<port>/
http_proxy=http://<host>:<port>/


Friday, 10 April 2015

OSX Keyboard Media Keys Stopped Working in iTunes

For me the Chrome Google play extension had stolen the functions.

Chrome | Settings | Extensions & scroll to the bottom of the page | Keyboard Shortcuts

Thursday, 2 April 2015

Docker, CentOS & a Proxy all walk into a pub

CentOS 7.1 behind SQUID Proxy.  Docker install using YUM.


docker info

FATA[0000] Get http:///var/run/docker.sock/v1.18/images/search?term=apache: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

Followed the official instructions @ https://docs.docker.com/articles/systemd/ which seemed to fix docker info but subsequent

docker search <name>

would fail with :

FATA[0127] Error response from daemon: Get https://index.docker.io/v1/search?q=name: dial tcp 162.242.195.84:443: connection timed out

Tried setting the environment variable manually and also running the command inline

https_proxy=http://<server>:<port> docker search <name>

Stumbled across a blog suggesting adding environment variables to /etc/sysconfig/docker

 HTTP_PROXY=http://<IP>:<Port>   
 http_proxy=$HTTP_PROXY  
 HTTPS_PROXY=$HTTP_PROXY  
 https_proxy=$HTTP_PROXY   
 export HTTP_PROXY HTTPS_PROXY http_proxy https_proxy   

Problem fixed

Tuesday, 3 February 2015

Error when installing Windows 8 "The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed."

If your getting this error then when presented with the message :
  1. Press SHIFT+F10
  2. In the black command window type : regedit  & enter
  3. Find : HKLocal/SYSTEM/SETUP/STATUS
  4. Double click on ChildCompletion and change the data from 1 to 3
  5. Press OK on the initial error message

Monday, 12 January 2015

QNAP TS-509 & NetGear GS716T Port Trunk

I don't particularly need a 2GB trunk from the NAS but a recent switch upgrade to a NetGear managed switch, GS716T (which for £120 is bloody good value) gave me the option.

Set the NAS for bonded 802.3ad & created the LAG group on the switch.  Easy.

Two days later I noticed my Windows machines had lost their SMB mounts, Linux boxes all fine. Disabling one of the NAS bonded ports brought it all back.

I suspected some kind of ARP timeout.  Switched the LAG port from STATIC to LACP and all was well.  And has remained so.  No idea why Windows was FUBAR and not Linux and without cracking open Wireshark I can only guess.

Wednesday, 7 January 2015

Wordpress (WPMU) Migrate & Domain Change

Goal : Using my existing provider create a Dev env of a Wordpress multisite deployment.

Prod site was two simple sites, 4-5 pages in each.  Minimal plugins.  Eventually fell upon Duplicator from Life in the Grid.

Documentation is decent and I had no issues until I started the deploy on the destination.  The decompression failed with a PHP error when I ran installer.php.  I followed the FAQ and the manual extraction process which worked fine, upload the decompressed files and archive, run the installer.php and follow the prompts.

Site 'duplicated' and working! ... almost.  The primary network site worked fine second site down.  Changed the url via the WP Network Site Admin and created the equiv subdomain entry which allowed me to browse to the second site.  Progress!

Main site : site.domain.uk
Second site : site2dev.domain.uk

And then the fall.  Trying to access the WP-Admin for the second site put me into the [in]famous Wordpress login loop.  Heres a nice write up - https://tommcfarlin.com/resolving-the-wordpress-multisite-redirect-loop/

Followed a ton of links and tried all the suggestions with no success.  Went through the db with a forensic microscope in case a URL rename had been missed, all with no joy.  Eventually I decided to create a new site and see what the results were.  If it failed I knew it would be more WPMU than the second site setup.

Setting up site3 it was created as site3.domain.domain.uk .. oh a sub sub domain.  The light bulb went off but I carried on.  Site3 worked fine.

Changed my second site & DNS entry to site3.domain.domain.uk .. Golden.

Saturday, 22 November 2014

WordPress MultiSite Admin Slow

After upgrading from 3 -> 4 the admin panel became utterly unusable. 20-30 seconds on any action.

Found - https://wordpress.org/support/topic/admin-back-end-slowfront-end-good#8

And for me :
Manually run /wp-admin/upgrade.php
UPDATE 25/1/2015 - Also had to do this for 4.0 -> 4.1 Upgrade

RaspberryPI / Motion & Multiple USB Cameras

Playing around with Motion on Raspian.  Motion was simple to setup with a single camera but when I added a second and switched to the thread config files I started to get :

Unable to query input 1 VIDIOC_ENUMINPUT: Invalid argument
Tracked it to a setting in the default thread2.conf
# The video input to be used (default: 8)
# Should normally be set to 1 for video/TV cards, and 8 for USB cameras
input 1
Change the input to 8 and all is well

Friday, 7 November 2014

CentOS 7 Missing ifconfig command

CentOS 7 no longer ships with the command/s.  You can install via yum
sudo yum install net-tools

Friday, 26 September 2014

Add a static route to QNAP NAS

Can't be done via the GUI so you need to use some CLI foo.  You can set a route temporarily via the shell but in order for it to remain persistent you need to edit the startup script.

1 - Connect via ssh to your device
2 - Mount the QNAP Configuration

The name of the actual device to mount depends on your model number. In general for x86-based systems this should be /dev/sdx6. For Marvell ARM based models it should be /dev/mtdblock5 or /dev/mtdblock4.
[~] # mount -t ext2 /dev/sdx6 /tmp/config

2 - Create or adapt autorun.sh

A shell script called “autorun.sh” will be executed by your QNAP storage system on every startup. It might be possible that file currently does not exist so just go ahead and create it with your favorite text editor, or the whatever is installed.
#!/bin/sh
route add -net <subnet> netmask <mask> gw <gw_ip_addr>
3 - Make sure that autorun.sh is executable
In order to be executable during startup, we will have to set the executable flag for “autorun.sh”:
[~] # ls -al /tmp/config/autorun.sh
-rw-r--r--    1 admin    administ       60 May 11 17:43 /tmp/config/autorun.sh*
[~] #
[~] # chmod +x /tmp/config/autorun.sh
[~] #
[~] # ls -al /tmp/config/autorun.sh
-rwxr-xr-x    1 admin    administ       60 May 11 17:43 /tmp/config/autorun.sh*
[~] #
4 - Unmount the config
[~]# Unmount /tmp/config

Sunday, 17 August 2014

OSX Proxy [on/off] Script

#!/bin/bash

e=$(networksetup -getwebproxy wi-fi | grep "No")

if [ -n "$e" ]; then
  echo "Turning on proxy"
#  sudo networksetup -setstreamingproxystate wi-fi on
#  sudo networksetup -setsocksfirewallproxystate wi-fi on
  sudo networksetup -setwebproxystate wi-fi on
  sudo networksetup -setsecurewebproxystate wi-fi on
else
  echo "Turning off proxy"
#  sudo networksetup -setstreamingproxystate wi-fi off
#  sudo networksetup -setsocksfirewallproxystate wi-fi off
  sudo networksetup -setwebproxystate wi-fi off
  sudo networksetup -setsecurewebproxystate wi-fi off

fi

Wednesday, 23 July 2014

Extend Windows 7 VirtualBox Disk


  1. Use the VirtualBox client to create a new disk of the size you want in the same directory as your guest.
  2. Clone the old disk to the new.  Open a command prompt, navigate to the guest directory and run :
  3. VBoxManage clonehd   --existing
  4. Attach the new disk to the guest and detach the old disk.  Ensure the new disk is first in the list / SATA 0
  5. Guest should now boot up.  If you find it asks you to select a boot disk then the order is incorrect as per step 3
  6. Open Windows disk manager, It will currently show the old size with #GB free.  Right click, extend, follow the prompts.
  7. Confirm everything is good and you can delete the old disk.
Thats it, you're done ...

Thursday, 19 June 2014

Re-enable the Apple-provided Java SE 6 web plug-in and Web Start features

Use this at your own risk as Apple, and most people distrust JAVA.


Taken from http://support.apple.com/kb/HT5559

  1. Open Terminal, located in the Utilities folder.
  2. Enter this command, then press the Return or Enter key: 
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled 
  3. Enter this command, then press the Return or Enter key:
    sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
  4. Enter this command, then press the Return or Enter key:
    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
  5. To re-enable Java SE 6 Web Start, enter this command, then press the Return or Enter key:
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws

Additional Information

The following steps will undo the above commands and restore Java 7 in OS X Lion and later.
  1. Disable Java SE 6 Web Start opening:
    • Enter this command, then press the Return or Enter key:
    • sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws /usr/bin/javaws
      
    • When prompted, enter your administrator password, then press the Return or Enter key.
  2. Re-enable the Java 7 applet plug-in by downloading and reinstalling the latest version of Oracle Java 7 JRE.

Thursday, 5 June 2014

Basic Syslog-NG Install & Config

Ubuntu OS, apt syslog-ng install & added the following lines to get a basic UDP server running.


options { 
<Keep all the default Options>
create_dirs(yes);
dir_perm(0755);
};
source s_net { 
udp(ip(0.0.0.0) port(514));
};

destination d_any_remote {
file("/var/log/syslog-ng/$HOST/$FACILITY.log");
};

log {
source(s_net); destination(d_any_remote);
};

Sunday, 20 April 2014

Flash, Chrome & an Atom CPU all walk into a pub

Tried to watch something on 4OD catchup via my HTPC (Zotac ION ATOM 1.6) last week.  Dreadful., choppy and stuttering, in the end I gave up.

Today I decided to debug and see if I could fix it.

Firstly browsing in general also seemed slow.  Hit a well known bandwidth testing site and it was reporting 70-80ms latency.  Odd as no other device in the house showed the same problem, all in the 27-35ms range.

Spent a ton of time looking into this starting with networking\drivers being the source of the problem as it, even started packet tracing!   CLI pings all seemed fine, file download comparisons, all fine.  Finally, and I mean after a day of screwing around and almost a total rebuild, I cleared the cache on Chrome.  Bingo, latency fixed.  WTF! ..

Chrome and pepperflash were throwing the bandwidth test out, and guess what 4OD, flash site .. I think I have found the issue.

Seems like any flash site on Chrome pushes the CPU, on the ATOM its just too much, 90-100% .. Same on my desktop but its a way faster CPU so copes.  Never really appreciated what a great job flashblock does for me.

Switched to Firefox & Adobe Flash and all is well again .. for now

Thursday, 17 April 2014

Billion 7800N & Sky Broadband

Despite my disgust for the Murdoch empire when BE Broadband sold out to Sky I was stuck with a decision, particularly as Hyperoptic have just flooded the area I live in.

The BE service got so bad 1-2Mb that in the end I called to cancel.  I walked away with a 12 month Sky deal, 5Mb estimate and basically nothing to pay until September.  After some teething issues they got me the bandwidth promised and I'm relatively happy.  I will still jump to Hyperoptic when I actually need to start paying for a service.

In the meantime I wanted to get my Billion 7800n working on this line .. Forums answered me here.

And for my own memory :

  1. Firmware >1.06h
  2. Follow below :



Thursday, 23 January 2014

64-bit Linux, 32-bit Chrome & Cisco AnyConnect

Obvious when you think about it but 32Bit Chrome will fail to connect to make the initial the SSL/HTTPs connection and so download/prompt for the client.

Switch to Firefox (Other 64Bit browsers are available) and you'll be good.

Wednesday, 1 January 2014

Blocking Facebook Connect/Graph

Browsing the web and you hit a site that displays your friends list, or suggests you 'like' this page because xyz of your friends also do.

Never paid that much attention until my g/f today mentioned my friends appear on sites she looks at. Of course they do! WTF did I never consider this.

Not that we have that type of secret relationship but when I started digging into Facebook connect, or now graph as it seems to be the more I hated it.

I'm way late to this party but to block this:

  1. Install AdBlock - https://getadblock.com/ & pay this guy money, its a great product!
  2. Create some filters to block access to the connect URLs
http://dev.mathiasbaert.be/misc/facebook-connect-opt-out.html

and/or add these to the filter list:
facebook.com^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
facebook.net^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
fbcdn.com^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
fbcdn.net^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
Thats it.

Tuesday, 31 December 2013

Suunto Vyper PC Transfer RS232/USB Convertor

I can confirm that a Startech RS232 -> USB convertor works with the original Suunto serial cable.

Whats more is I can confirm this setup works with OSX 10.9, VirtualBox 4.3.6 & a Windows 7 guest with DiverManager v3!


This makes me happy!