Check a samba mount is still available in Linux Bash

Check a samba mount is still available in Linux Bash

Sometimes in shell scripts I need to get files from Samba shares but these can become disconnected for various reasons so it’s always a good idea to check before retrieving data from them. An easy way to do this is to check whether the share you want to use is mentioned in /proc/mounts which is part of the proc virtual file system. /proc/mounts is not a real file like many end points in linux. So in my linux bash script…

Read More Read More

Using awk to get values from XML

Using awk to get values from XML

I have had occasion to write a shell script which carries out several tasks relating to learning analytics. One such task is to find out the current academic week. It’s not that easy to do MySql/PHP operations from inside a shell script. As luck would have it we have an in house web service which provides this information. The output however, is either JSON or XML. The XML version looks like this: <?xml version=’1.0′ encoding=’iso-8859-1′ ?> <weekno>32</weekno> The Linux shell…

Read More Read More

Adding secure parameters to web service calls Android AND XCode!

Adding secure parameters to web service calls Android AND XCode!

When you need to get information from a web service for your mobile application (which is almost all you ever do) you must have the ability to add $_POST information and send the request securely. Apple’s Swift language insists on this for every call to an external URL. Android is not so strict mainly because there are about a hundred ways to do this in Android and very few in Swift. As a for instance let’s go back to the…

Read More Read More

Store a signature to MySql from iPad. part 1. The Signature

Store a signature to MySql from iPad. part 1. The Signature

This set of posts describes my efforts to capture a user signature on an iPad and save this as a BLOB in MySQL. Now, there’s no way to talk directly to MySQL from the iPad so once the signature image is captured it must be packaged up and transmitted to my web service which will store it using a MySQL Stored procedure. The new status of the visit that this signature relates to as well as the visit ID number also…

Read More Read More

Moodle 3.0 to 3.2 Notes to self

Moodle 3.0 to 3.2 Notes to self

Moving from Moodle 3.0 to Moodle 3.2 is more involved for us than previous upgrades.  This is due to important dates in our Calendar and the end of life support for Ubuntu versions. Our current OS version is Ubuntu 14.04 on both Web and DB servers. 14.04 EOLs during block 2 in our 2017/8 session which is not an ideal situation, particularly if a critical update is needed after that date but before our next planned OS upgrade cycle. Ubuntu…

Read More Read More

Swift asynchronous web calls

Swift asynchronous web calls

I have written in the past about retrieving xml from asynchronous web service calls in Android Studio. In XCode / Swift there is no need to set up an entire class as an async task to retrieve data. You can interrupt viewDidLoad, retrieve your JSON data (including handling errors such as no connection) then resume your task like this: let url = URL(string: “https://yourwebservice”)! let task = session.dataTask(with: url, completionHandler: {             (data, response, error)…

Read More Read More

RedirectMatch in htaccess with & characters

RedirectMatch in htaccess with & characters

We had a problem with the contents of our htaccess file which required RedirectMatch URIs to contain & symbols.  This was creating all sorts of problems with the resulting URL appearing in the browser. e.g. RedirectMatch ^/eveningclasses$ http://192.168.41.66/dumgalportal/index.php?pageid=evening.cts&site=cts The &site=cts part is lost and the word eveningclasses is appearing in place of the & before the word site. There are many solutions on the web involving Apache configuration, ReWrite rules etc. But there is a much simpler solution available: Double…

Read More Read More

Android icon creation and layout

Android icon creation and layout

I have done some research into creating icons for various screen densities. I used Inkscape to create the svg files used in this layout which is a GridView. I used the website Android Asset Studio to create the various screen density png files. I have removed several views from the application and left only the login screen and student information screen which is the only really useful information area.

Staff undertaking courses in Moodle – Limiting access

Staff undertaking courses in Moodle – Limiting access

In a break from Android programming posts this entry will look at the issue of staff undertaking Moodle courses in the College. First an outline of the issue: All of our staff are automatically assigned a site wide role ‘visiting lecturer’. This role is based on the Editing Teacher role and allows any lecturer to access any course on our Moodle system which we felt was easier than allocating lecturer roles per course. If cover is required at short notice…

Read More Read More

Values back from Async tasks in a useful way

Values back from Async tasks in a useful way

When a student logs in to the current version of the Android app an Async task makes a web service call which returns a private key if the credentials match. This key is used for subsequent calls from the app as this is a much safer solution than asking students to log in to remote systems every time the app opens. An Async task is necessary because network activity has to happen off the main thread. This is how the…

Read More Read More