Unix is a multi-user, multi-tasking operating system that was initially developed by Bell Labs in the 1970s. Various similar operating systems that are POSIX compliant (ie compatible with Unix) have since been developed (POSIX is an abbreviation for Portable Operating System Interface for UNIX). These include the following: the BSD family (OpenBSD, FreeBSD, NetBSD, Mac OS/X), Solaris, IRIX, AIX, SunOS, UnixWare, OpenServer and Linux.
Software written for POSIX compliant operating systems is generally able to be compiled for all POSIX platforms with little or no platform-specific changes. This makes the commands and utilities available for this extended family of operating systems very similar, and there are few differences between administering them.
The articles in this section are about useful command line utilities and commonly used application software on POSIX compliant operating systems. For Mac OSX specific articles see my OSX section.
If you are logged in as a user using “su” or “sudo su” and attempt to use screen, you’ll get the error message “Cannot open your terminal ‘/dev/pts/0’ – please check”. This post shows how to fix this.
Log out of the terminal/SSH session and log back in as the user you want to run screen as instead of using su.
script /dev/null screen
This worked for me on Debian 7.8 Wheezy.
SilverStripe’s File, Folder and Image objects have a default sort of ‘Name’, ‘Sort’ and ‘Name’ respectively, but if you are also using Uncle Cheese’s DataObjectManager the sort order will change to the ‘SortOrder’ field. Unless you’ve been sorting these yourself they’re going to appear in the ImageField control in a more or less random order, which isn’t idea. This post shows the solution.
I have used the methods succesfully in this post with SilverStripe 2.4.5
In your mysite/_config.php file, add the following:
File::$default_sort = 'Name'; Folder::$default_sort = 'Name'; Image::$default_sort = 'Name';
Alternatively make Folder::$default_sort = ‘Sort’ to restore the default behaviour, but I personally prefer to keep it in name order.
Changing the default_sort as shown above won’t affect the order for the table of files/images in the Files and Images section of the CMS. However the DataObjectManager allows you to change the sort order by clicking the column headings, so it’s not really an issue so much.
However, if you want to make it use the default sort instead, the only way I could work out how to do this myself is to remove the File class from the sortable classes.
In theory, you should be able to do this:
But it didn’t work when I tried it because it only removes the extension from the class and doesn’t remove it from the SortableDataObject::$sortable_classes array. You could do this instead, although it’s a but hacky and may have unexpected consequences.
Again, add this to your mysite/_config.php file:
SortableDataObject::$sortable_classes = array();
and then move your existing SortableDataObject::add_sortable_classes declaration below it, if you did already have one.
This will not only make the table now sort in the default_sort, but will remove the useful features of dataobject_manager from the table, so I’d generally advise not to do this; I’m simply showing that it can be done.