Category Archives: Clippings

Xero API pyXero and Anaconda Python

Personal TL;DR notes on getting this to work, not a tutorial.

Download Install Anaconda
– At the time of writing it didn’t create Windows Shortcuts, fix this with openning cmd as admin

‘c:\Anaconda2\scripts\conda.exe install menuinst’

Agree to Updates

‘c:\Anaconda2\scripts\conda.exe install -f console_shortcut ipython ipython-notebook ipython-qtconsole launcher spyder’

Agree to updates.

Now there should be shortcuts in:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Anaconda2 (64-bit)

Now onto Xero

  • git clone https://github.com/freakboy3742/pyxero.git
  • Open up Anaconda Prompt (Anaconda2x64)
  • cd into folder with git of pyxero
  • use command: python setup.py install
  • pip uninstall oauthlib
  • pip install oauthlib==0.7.2

The last two commands fix the error: ImportError: No module named jwt.algorithms

Again these are personal notes, not a full blown tutorial.

 

Dell Powerconnect 5424 SNMP web management issue

Just ran into a strange issue when configuring a SNMP community on the web interface. Alas it was broken.

2016-01-19 10_36_26-ATKOSD22016-01-19 10_36_26-ATKOSD2

And clicking on “add’ results in an error

‘Access Error: Request Entity Too Large’2016-01-19 10_36_47-ATKOSD2
An easy fix is to stop being lazy and CLI into the switch and fix it.

The command:

snmp-server community public su 192.168.0.5

2016-01-19 10_39_23-Greenshot image editor

And look, it works for us. Now you can webconfig until your heart is content.

2016-01-19 10_38_07-ATKOSD2

Don’t forget to write your switch config changes.

Reference: Dell 5424 CLI Manual, Page 328 ‘snmp-server community’

check_mk_agent over SSH Host key verification failed

Service discovery failed for this host: Agent exited with code 255: Pseudo-terminal will not be allocated because stdin is not a terminal. Host key verification failed.

Current Setup: Ubuntu 14.04 running OMD

Solution: Running the ssh command from the OMD user appears to fix the problem by allowing them into the known hosts list.

Here’s how:

linuxuser@ubuntu_vm:~$ sudo su
[sudo] password for linuxuser:
root@ubuntu_vm:/home/scadmin# su [omd-site-name]
ubuntu_vm[[omd-site-name]]:~$

then run your remote command eg:

ubuntu_vm[[omd-site-name]]:~$ ssh -l root -i /etc/check_mk/check_mk.key [ip]

It will ask to save the host to the known hosts, type yes and enter. It should then output the status from the check_mk agent.

Toshiba M400 – Clone / Restore Hard Drive issue STOP: 0x00000007B 0x7B issue

Here is a tough one, cloning or restoring a backup to a new drive for a Toshiba M400 returns a BSOD with Stop 0x7B error.

Here is how to fix it.

  1. Install New Drive into drive bay
  2. Boot M400 and press Esc
  3. When prompted “Check system. Then press [F1] key.” press F1, to enter the BIOS
  4. Use Page Down key to go to the 3rd page and change the Built-in HDD from JBOD to 1RAID-0
  5. When you save you will be prompted for the top secert code, this is: 1 2 3 4 [enter]
  6. Save and exit the BIOS
  7. Complete the system restore/ clone (if cloning from one drive to another, for performance I find it better to take the 2 drives and plug them into 2 SATA ports on another computer and clone there, much faster than an Image or using an external enclosure

A big thanks to the guys here: http://forums.toshiba.com/t5/General-Troubleshooting/M400-Restore-Issue/td-p/25211 for their help and input.

WordPress MU Organise uploads

In a WPMU install there is no check box for “Organize my uploads into month- and year-based folders”

Instead you need to do the following:

network dashboard > my sites > sites

then edit each site, select site settings

then scroll down to “Uploads Use Yearmonth Folders”.
1= yes year/month,
0 = no year month, instead upload to /siteid/files/

Thanks to http://premium.wpmudev.org/forums/topic/how-do-i-turn-on-the-check-box-for-yearmonth-folder

State of the Wireless Speaker

For those interested in a quick birds eye view of the state of the wireless speaker market I’ve created this quick (and I meant super quick) Google Sheet for a client.

State of the Wireless Speaker

It includes:

Sonos
Play 1
Play 3
Play 5

BOSE
SoundTouch

Pure
Jongo T2
Jongo T4

Samsung
Wireless Audio Hub
M3 Wireless
M5 Wireless
M7

Presonus
Eris E5

Is is in no way a review of any kind (other than cost at this moment in time). I have not personally had any time to play with these speakers in any sort of detail. (I do however have a pair of Presonus studio monitors). If it’s useful, that’s great. If not, I wish you well on your journey.

Building CSS sprites using Python Glue

css-sprite was giving me some issues so I went looking for a different way to tackle the problem.

While a pain in the rear end to install, I found Glue. Given I already had all the python stuff installed it was pretty easy for me to get it working for this project.

  1. Install Glue http://glue.readthedocs.org/en/latest/installation.html
  2. Run Glue, here is the command that I like:
    glue src glue –scss –sprite-namespace= –namespace= –cachebuster

(The above command, looks for all the images in the src folder, and then outputs into the glue folder).

While the scss support is woeful, the retina side of things seems to be working better. (Although I’m not using the retina switch in the command above).

RaspberryPI – AdagiosPI – Installing Nagvis

Nagvis has some issues installing with:
apt-get install nagvis

Here are the extra steps to get it running.

1). Fix the permissions outlined in the file /usr/share/doc/nagios3/README.Debian ( cat /usr/share/doc/nagios3/README.Debian will print out the contents in to the terminal).

2). Edit the backend config, in the web GUI go to Options -> Manage Backends. Then under “Edit backend” select live_1 and change the socket to: unix:/var/lib/nagios3/rw/livestatus
set a timeout to 30 (not sure if this is correct, sounded fun at the time).

3). Edit WuiViewEditMainCfg.php with the changes found here: http://sourceforge.net/p/nagvis/nagvis/ci/c7eb03fe37130546adfe298408606213f2d2fd9a/

nano /usr/share/nagvis/share/server/core/classes/WuiViewEditMainCfg.php
(instead of removing lines, I just added // as a comment).

Resources:
http://serverfault.com/questions/517362/php-error-mk-livestatus-in-nagvis
http://www.monitoring-portal.org/wbb/index.php?page=Thread&threadID=25901
https://www.mail-archive.com/[email protected]/msg1086669.html