SQL and secure_file_priv

Reminder of how to export from mysql when you run into the secure_file_priv message!

to find what its set at currently from within sql


SELECT @@global.secure_file_priv;

to export stuff to csv

SELECT * INTO OUTFILE '/var/lib/mysql-files/somefile.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n' FROM sometable;

Posted in coding, computing, mysql | Leave a comment

Logitech C270 and Linux hangups

Problems on a debian install that each time I plugged in a C270 the usb hung.

A look at logs showed two symptoms. lots of
usb 3-6: 3:1: cannot get freq at ep 0x86
and multiple instances of udevd also lsusb would hang.

Reason is the audio, quick fix is to unload usb audio module
rmmod snd_usb_audio so later today I may get round to writing a udev rule,

Posted in coding, opencv, Uncategorized | Tagged , , , | Leave a comment

OpenCV 3 and ffmpeg fun

Had a few hours of  ‘fun’ getting OpenCV3 to build… I will expand on that sometime, meantime some reminders

Some reminders mainly to me…

The main problem was configure for OpenCV would not find ffmpeg, in spite of all the solutions to the problem posted around the web, none worked. In the end I reinstalled OpenCV from source.

Note below the configure needs some specific flags or open CV will get grumpy.

opencv

clear build folder with rm -r


#before doing the

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local</pre>
<pre>

or
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON ..

ffmpeg

ffmpeg build required


./configure --enable-nonfree --enable-pic --enable-shared

You may find ffmpeg complains when it is run of missing libraries, its the usual solution apt-get….

OpenCV
A couple of functions I use from older version has different args, for thos a quick fix os

#contours returns more values so…
(_,contours,_) = cv2.findContours(
#or
contours, hierarchy = cv2.findContours(…)[-2:]
[/sourcecode ]

ps for the java libs it doesnt find thing unless

export JAVA_HOME=/usr/local/jdk1.8.0_20

 

Posted in computing, opencv, python | Tagged , , | Leave a comment

From mbed online to mbed-cli via KDS and LPCXpresso

After an exciting few weeks with projects using 11u35/1764 and K64F with lpcXpresso and Kinetis Design Studio I have yet to find a good working IDE for ALL of them. So as the online tools have been slow this week I have resorted to mbed-cli command line tools.

The export as zip option has been removed from the online tools so I have used either export to LPCXpresso or as a GCC project.

So here are  the steps:-

1)download as expresso or gcc export
2)unpack into folder
3)cd into folder
4)mbed new .
5)modify mbed.bld to
http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3

(theres a post about this at https://github.com/ARMmbed/mbed-cli/issues/391#issuecomment-259932373 )
6)mbed deploy

it then complains about libraries references
eg

[mbed] ERROR: Library reference “MPU6050.lib” points to a folder “/junk/jt_mbed_cli/nl_DEV_datalogger_nolib/MPU6050”, which is not a valid repository.
[mbed] ERROR: You can remove the conflicting folder manually and use “mbed deploy” to import the missing libraries
[mbed] ERROR: You can also remove library reference “/junk/jt_mbed_cli/nl_DEV_datalogger_nolib/MPU6050.lib” and use “mbed sync” again.
To work round this is is up to you I just deleted the libs and then doing
step 7 to get them to download again was easiest
7)mbed deploy

8) mbed compile -t GCC_ARM -m LPC1768

In a later post I will explain how I then got mbed-cli to actually export something for KDS and LPCXpresso and the fun it was getting them to compile…

If you have an easier way, please drop me a line

Posted in coding, computing, MBED | Leave a comment

Reminder how to Program an MBED 11u35 from Linux or mac

For a work project I am using an embedded artists 11u35. These notes are reminder of how to download code to it when on mac or linux…

Note below taken from this link on mbed forums by Neil Thiessen

a)remember to start the boat up by keeping left button pressed while pressing reset. (assuming usb is top)
b)will appear as device called CRP_DISABLED

Then…
For Mac or Linux:

delete firmware.bin
unmount device (sudo on MAC)
using Linux umount /dev/sd* (where * is the location of your device)
using Mac OS umount /volumes/CRP DISABLD

copy the file to the disk
Using Linux dd if=mbed_if.bin of=/dev/sd* seek=4
Using Mac dd if=mbed_if.bin of=/dev/disk* seek=4

Posted in coding, computing, MBED | Leave a comment

Kinetis K64 Not Starting after Power Up

A day of misery with various micro-controllers. More to be explained over the coming days, tales of misery and imagination involving LPCExpresso and Kinetis Studio….
But for not the misery was a Kinetis K64F that seemed to not boot reliably. The answer is need pull up R75 or remove a capacitor. It all relates to NMI. Until I write up a better post see here
Short version answer to this is answer here

10K resistor populated in R75 by the tricolour LED or handle NMIs….

The  NMI handler. On a K64F the  interrupt vector resides in bytes 8-9-10-11, also NMI connected to SW3.

And some notes on how to write your own boot loader!

Posted in Uncategorized | Tagged , , , | Leave a comment

Help Designing Matrix Fonts – NineCharGen

For some MBED embedded micro work I needed to explain how to use a dot matrix LED display and how a character generator worked.  Rather than getting students to suffer the old fashioned way, plotting the shapes on paper I put this application together.

You just tap on the LEDs to make the pattern and the hex code for that column is shown at the bottom of the display. NineCharGen is written in JAVA and cross platform.

It can be downloaded here

char_gen

 

Posted in coding, computing, education, JAVA, MBED | Leave a comment

Visualising IP Usage With Highcharts

Whilst looking after a mid sized network (about 25 Subnets) I  wanted a way of visualising IPs that were out of use. Time to use Highcharts and a scatter chart.

ipuse

 

Across the X axis is the ip node, the Z Axis the network and the Y shows how many days since the ip was last seen.

As an IP falls out of use, it “floats” to the top of the chart. This view is a quick way of seeing what is being used, and what isnt.

Also the nodes are clickable and connected to more information about each machine, such as its mac address etc.

How we collect the usage data is another story 🙂

 

Posted in computing | Tagged , , , | Leave a comment