Initial impressions of Windows 10
31st October 2014Being ever curious on the technology front, the release of the first build of a Technical Preview of Windows 10 was enough to get me having a look at what was on offer. The furore regarding Windows 8.x added to the interest, so I went to the download page to get a 64-bit installation ISO image.
That got installed into a fresh VirtualBox virtual machine and the process worked smoothly to give something not so far removed from Windows 8.1. However, it took until release 4.3.18 of VirtualBox before the Guest additions had caught up with the Windows prototype, so I signed up for the Windows Insider program and got a 64-bit ISO image to install the Enterprise preview of Windows 10 into a VMware virtual machine since and that supported full screen display of the preview while VirtualBox caught up with it.
Of course, the most obvious development was the return of the Start Menu, and it works exactly as expected too. Initially, the apparent lack of an easy way to disable App panels had me going to Classic Shell for an acceptable Start Menu. It was only later that it dawned on me that unpinning these panels would deliver to me the undistracting result that I wanted.
Another feature that attracted my interest is the new virtual desktop functionality. Here I was expecting something like what I have used on Linux and UNIX. There, each workspace is a distinct desktop, with only the applications open in a given workspace showing on a panel in there. Windows does not work that way with all applications visible on the taskbar regardless of what workspace they occupy, which causes clutter. Another deficiency is not having a desktop indicator on the taskbar instead of the Task View button. On Windows 7 and 8.x, I have been a user of VirtuaWin and this still works largely in the way that I expect of it too, except for any application windows that have some persistence associated with them; the Task Manager is an example and I include some security software in the same category too.
Even so, here are some keyboard shortcuts for anyone who wants to take advantage of the Windows 10 virtual desktop feature:
- Create a new desktop: Windows key + Ctrl + D
- Switch to previous desktop: Windows key + Ctrl + Left arrow
- Switch to next desktop: Windows key + Ctrl + Right arrow
Otherwise, stability is excellent for a preview of a version of Windows that is early on its road to final release. An upgrade to a whole new build went smoothly when initiated following a prompt from the operating system itself. All installed applications were retained, and a new taskbar button for notifications made its appearance alongside the existing Action Centre icon. So far, I am unsure what this does and whether the Action Centre button will be replaced in the fullness of time, yet I am happy to await where things go with this.
All is polished up to now, and there is nothing to suggest that Windows 10 will not be to 8.x what 7 was to Vista. The Start Screen has been dispatched after what has proved to be a misadventure for Microsoft. Regardless of what was hyped a few years ago, the PC still is with us; touchscreen devices like tablets are augmenting it instead of replacing it for any tasks involving some sort of creation. If anything, we have seen the PC evolve with laptops perhaps becoming more like the Surface Pro, at least when it comes to hybrid devices. However, we are not as happy to smudge our PC screens quite like those on phones and tablets, so a return to a more keyboard and mouse centred approach for some devices is welcome.
What I have here are just a few observations; there are more elsewhere, including a useful article by Ed Bott on ZDNet. All in all, we are early in the process for Windows 10 and, though it looks favourable so far, I will continue to keep an eye on how it progresses. The need to be less experimental than Windows 8.x is being fulfilled: so far, it certainly is less schizophrenic and should not be a major jump for users of Windows 7.
Changing file timestamps using Windows PowerShell
29th October 2014Recently, a timestamp got changed on an otherwise unaltered file on me and I needed to change it back. Luckily, I found an answer on the web that used PowerShell to do what I needed, and I am recording it here for future reference. The possible commands are below:
$(Get-Item temp.txt).creationtime=$(Get-Date "27/10/2014 04:20 pm")
$(Get-Item temp.txt).lastwritetime=$(Get-Date "27/10/2014 04:20 pm")
$(Get-Item temp.txt).lastaccesstime=$(Get-Date "27/10/2014 04:20 pm")
The first of these did not interest me, since I wanted to leave the file creation date as it was. The last write and access times were another matter because these needed altering. The Get-Item commandlet brings up the file, so its properties can be set. Here, these include creationtime
, lastwritetime
and lastaccesstime
. The Get-Date commandlet reads in the provided date and time for use in the timestamp assignment. While PowerShell itself is case-insensitive, I have opted to show the camel case that is produced when you are tabbing through command options for the sake of clarity.
The Get-Item and Get-Date have aliases of gi
and gd
, respectively, and the Get-Alias commandlet will show you a full list while Get-Command (gcm
) gives you a list of commandlets. Issuing the following gets you a formatted list that is sent to a text file:
gcm | Format-List > temp2.txt
There is some online help, but it is not quite as helpful as it ought to be, so I have popped over to Microsoft Learn whenever I needed extra enlightenment. Here is a command that pops the full thing into a text file:
Get-Help Format-List -full > temp3.txt
In fact, getting a book might be the best way to find your way around PowerShell because of all its commandlets and available objects.
For now, other commands that I have found useful include the following:
Get-Service | Format-List
New-Item -Name test.txt -ItemType "file"
The first of these gets you a list of services, while the second creates a new blank text file for you, and it can create new folders for you too. Other useful commandlets are below:
Get-Location (gl)
Set-Location (sl)
Copy-Item
Remove-Item
Move-Item
Rename-Item
The first of the above is like the cwd
or pwd
commands that you may have seen elsewhere, in that the current directory location is given. Then, the second will change your directory location for you. After that, there are commandlets for copying, deleting, moving and renaming files. These also have aliases, so users of the legacy Windows command line or a UNIX or Linux shell can use something that is familiar to them.
Little fixes like the one with which I started this piece are all good to know, but it is in scripting that PowerShell really is said to show its uses. Having seen the usefulness of such things in the world on Linux and UNIX, I cannot disagree with that, and PowerShell has its own IDE too. That may be just as well, given how much there is to learn. That especially is the case when you might need to issue the following command in a PowerShell session opened using the Run as Administrator option just to get the execution as you need it:
Set-ExecutionPolicy RemoteSigned
Issuing Get-ExecutionPolicy
will show you if this is needed when the response is: Restricted. A response of RemoteSigned
shows you that all is in order, though you need to check that any script you then run has no nasty payload in there, which is why execution is restrictive in the first place. This sort of thing is yet another lesson to be learnt with PowerShell.
A collection of legal BitTorrent sites
19th October 2014It was an article in a magazine that revealed these legal BitTorrent download sites to me, so I thought that I'd keep them on file for future reference while also sharing them with others who might need them. As far as I am aware, they are all legal in that no copyrighted material is on there. If that changes, I am happy to know and make amendments as needed.
My own interest in torrents arises from their being a convenient way to download installation disk images for Linux distributions, and at least one of the entries is devoted to just that. However, the distribution also lends itself to movies along with music and books, so that is reflected below too. Regarding downloading actual multimedia content, there is so much illegal downloading that a list like this is needed and has blackened the reputation of BitTorrent too because it only ever was conceived as a means for distributing large files in a peer-to-peer manner without the use of a single server. Of course, any use can be found for a technology, and it never has to be legal or morally acceptable either.
Turning off the full height editor option in WordPress 4.0
10th September 2014Though I casually follow WordPress development, it's not nearly as rigorous as when I submitted a patch that earned me a mention on a main WordPress release's contributor list. This may explain why I barely noticed the full editor setting, which is turned on by default.
WordPress has become so mature now that I almost do not expect major revisions like the overhauls received by the administration back-end in 2008. The second interface was got so right that it still is with us, even if there were concerns in my mind at the time as to how usable it would be. Sometimes, those initial suspicions can come to nothing.
However, WordPress 4.0 introduced a major editor change that I'm not sure is successful. A full-height editor sounds good in principle, but its implementation has rough edges that make me wonder if any UX person reviewed it. Scrolling becomes strange, with the editor's toolbar fixing in place when you scroll down far enough. The sidebar then scrolls out of sync with the editor box, creating an odd sensation. Keyboard shortcuts like CTRL + HOME and CTRL + END don't work properly, which convinced me this new arrangement wasn't for me and I wanted to disable it.
A Google search found nothing useful, so I tried the WordPress.org forum. This revealed I should have looked in the screen options dropdown box for "Expand the editor to match the window height" to deselect it. Because of a Visual Editor control there, I'd checked the user profile screen but found nothing, showing the setup logic is poor. Perhaps the Visual Editor option should be a screen option too. Thankfully, the window height editor setting only needs changing once for both posts and pages, covering all situations.
With a distraction-free editing option available, I'm not sure why someone added the full height editor too. If WordPress keeps this feature, it needs refinement to behave more conventionally. I wouldn't build a website with such ill-synchronised scrolling. This needs work, as does the Visual Editor setting location. Perhaps both settings should be at the user level, rather than having one above that level. Before finding the solution, I considered using distraction-free mode permanently and installed the WP Editor plugin. I kept the plugin for its code highlighting, even though entering code view always creates a new revision. Despite this issue, things are now better.
Setting the PHP version in .htaccess on Apache web servers
7th September 2014The default PHP version on my outdoors, travel and photography website is 5.2.17 and that is getting on a bit now since it is no longer supported by the PHP project and has not been thus since 2011. One obvious impact was Piwik, which I use for web analytics and needs at least 5.3.2. Since WordPress 4.0 will not work without having 5.2.24 or later, that upgrade became implausible. Therefore, I contacted Webfusion's support team, and they showed me how to get to at least 5.3.3 and even as far as 5.5.9. The trick is the addition of a line of code to the .htaccess
file (near the top was my choice) like one of the following:
PHP 5.3.x
AddHandler application/x-httpd-php53 .php
PHP 5.5.x
AddHandler application/x-httpd-php55 .php
When I got one of these in place, things started to look promising, but for a locked database due to my not watching how big it had got. Replacing it with two additional databases addressed the problem of losing write-access, though there was a little upheaval caused by this. Using PHP 5.5.9 meant that I spotted messages regarding the deprecation of the mysql_connect
function, so that needed fixing too. Prefixing it with @ might have been a temporary fix while I sought a more permanent one. Thus, I opted for piggybacking off what WordPress uses; make use of MySQLi
or PDO_MySQL
are other options. Sorting the database issue meant that I saw the upgrade message for WordPress as well as a mix of plugins and themes, so all looked better, leaving me to be less concerned about losing security updates. Also, I am up to the latest version of Piwik too, and that's an even better way to be.
Automatically enabling your network connection at startup on CentOS 7
15th August 2014CentOS 7's release sparked my curiosity, so I tried it in a VirtualBox virtual machine. It uses GNOME Shell in classic mode, making it feel similar to GNOME 2. One thing to note is that it requires at least VirtualBox version 4.3.14, or the Guest Additions kernel drivers won't compile. This might seem surprising when you learn it uses kernel version 3.10.x and GNOME Shell 3.8.4. Like Debian production releases, CentOS chooses established versions for stability, fitting its enterprise-focused user base. Despite this conservative approach, it still looks good, though trying to change the desktop background froze the machine. Otherwise, most things work well.
However, there are surprises, including one I noticed: network connectivity needed switching on every time the VM started. This occurs with the default installation and has been a known issue since at least CentOS 6. It's not difficult to fix once you know how.
What you need to do is look for the relevant configuration file in /etc/sysconfig/network-scripts/
and update that. Using the ifconfig
command, I found that the name of the network interface. Usually, this is something like eth0, but it was enp0s3
in my case, so I had to look for a file named ifcfg-enp0s3 and edit that. The text that is sought is ONBOOT=no
and that needs to become ONBOOT=yes
for network connections to start automatically. To do something similar from the command line, CentOS had suggested the following:
sed -i -e 's@^ONBOOT="no@ONBOOT="yes@' ifcfg-enp0s3
This uses sed
for an inline (and case-insensitive) edit of the file to change 'no' to 'yes' after accessing the /etc/sysconfig/network-scripts/
directory. I edited manually with Gedit, which also works. Note that file editing needs superuser privileges, so switch to root with the su
command or use sudo
.
Changing the working directory in a SAS session
12th August 2014It appears that PROC SGPLOT
along with other statistical graphics procedures creates image files, even if you are creating RTF or PDF files. By default, these are PNG files, but there are other possibilities. When working with PC SAS, I have seen them written to the current working directory and that could clutter up your folder structure, especially if they are unwanted.
Being unable to track down a setting that controls this behaviour, I resolved to find a way around it by sending the files to the SAS work directory so they are removed when a SAS session is ended. One option is to set the session's working directory to be the SAS work one, which can be done in SAS code without needing to use the user interface. As a result, you get some automation.
The method is implicit, though, in that you need to use an X statement to tell the operating system to change the folder for you. Here is the line of code that I have used:
x "cd %sysfunc(pathname(work))";
The X statement passes commands to an operating system's command line, and they are enclosed in quotes. %sysfunc
then is a macro command that allows certain data step functions or call routines as well as some SCL functions to be executed. An example of the latter is pathname
and this resolves library or file references, and it is interrogating the location of the SAS work library here so it can be passed to the operating systems cd
(change directory) command for processing. Since this method works on Windows and UNIX, Linux should be covered too, offering a certain amount of automation since you don't have to specify the location of the SAS work library in every session due to the folder name changing all the while.
Of course, if someone were to tell me of another way to declare the location of the generated PNG files that works with RTF and PDF ODS destinations, then I would be all ears. Even direct output without image file creation would be even better. Until then, though, the above will do nicely.
Copying only updated new or updated files by command line in Linux or Windows
2nd August 2014With a growing collection of photographic images, I often find myself making backups of files using copy commands and the data volumes are such that I don't want to keep copying the same files over and over again, so incremental file transfers are what I need. So commands like the following often get issued from a Linux command line:
cp -pruv [source] [destination]
Because this is on Linux, it is the bash shell that I use, so the switches may not apply with others like ssh, fish or ksh. For my case, p
preserves file properties such as its time and date and the cp
command does not do this always, so it needs adding. The r
switch is useful because the copy then in recursive, so only a directory needs to be specified as the source and the destination needs to be one level up from a folder with the same name there to avoid file duplication. It is the u
switch that makes the file copy incremental, and the v
one issues messages to the shell that show how the copying is going. Seeing a file name issued by the latter does tell you how much more needs to be copied and that the files are going where they should.
What inspired this post though is my need to do the same in a Windows session, and issuing xcopy
commands will achieve the same end. Here are two that will do the needful:
xcopy [source] [destination] /d /s
xcopy [source] [destination] /d /e
In both cases, it is the d
switch that ensures that the copy is incremental, and you can add a date too, with a colon between it and the /d
, if you see fit. The s
switch copies only directories that contain files, while the e
one copies even empty directories. Using the d
switch without either of those did not trigger any copying action when I tried, so I reckon that you cannot do without either of them. By default, both of these commands issue output to the command line so you can keep an eye on what is happening, and this especially is useful when ensuring that files are going to the right destination because the behaviour differs from that of the bash shell on Linux.
Suppressing Update Notifier messages in Ubuntu GNOME 14.04
18th July 2014Even though I use only the command line for system updates, I still received system restart messages after kernel updates. Though these can be helpful, I prefer to restart my system on my own schedule, especially when running processes I don't want to interrupt.
In Ubuntu GNOME 13.10 and earlier, these messages didn't appear. I wanted to return to a notification-free experience. The Update Notifier application causes these messages, but removing it significantly impacts the system, making that approach impractical.
The application starts automatically at boot but doesn't appear in Startup Applications Preferences (launched via gnome-session-properties
). This is because the NoDisplay
flag in its autostart shortcut located in /etc/xdg/autostart/
is set to true. To make it visible, you need to set this flag to false.
The following command will reveal all hidden startup applications (note that the command is split across two lines for display purposes, and you may need to adjust quotes when executing it):
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g'
/etc/xdg/autostart/*.desktop
The sed
command changes NoDisplay=true
to NoDisplay=false
in all desktop files, revealing hidden entries in Startup Applications Preferences. This allows you to disable the Update Notifier. While deleting the desktop file would be more permanent, this solution works well as it stops restart notifications. Since I regularly update my system and shut down daily, updates are applied automatically, and everything functions properly.
Removing advertisements from uTorrent
12th July 2014BitTorrent may have got some bad press due to its use for downloading copyrighted material such as music and movies, but it does have its legitimate uses too. In my case, many a Linux distro has been downloaded in this way, and it does take the weight off servers by distributing the load across users instead.
Speaking of Linux, my general choice of client has been Transmission and there are others. In the Windows world, there is a selection that includes BitTorrent, Inc. themselves. However, many favour uTorrent (or μTorrent) so that's the one that I tried and there are free and subscription-based options. To me, the latter feels like overkill when an eternal licence could be made available as an easy way to dispatch the advertisements on display in the free version.
As much as I appreciate the need for ads to provide revenue to a provider of otherwise free software, they do need to be tasteful and those in uTorrent often were for dating websites that had no scruples about exposing folk to images that were unsuitable for a work setting. Those for gaming websites were more tolerable in comparison. With the non-availability of an eternal licence option, I was left pondering alternatives like qBittorrent instead. That is Free Software too, so it does have that added advantage.
However, I uncovered an article on Lifehacker that sorted my problem with uTorrent. The trick is to go into Options > Preferences via the menus and then go to the Advanced section in the dialogue box that appears. In there, go looking for each of the following options and set each one to false in turn:
offers.left_rail_offer_enabled/left_rail_offer
gui.show_plus_upsell
offers.sponsored_torrent_offer_enabled/sponsored_torrent_offer_enabled
bt.enable_pulse
gui.show_notorrents_node
offers.content_offer_autoexec
In practice, I found some of the above already set to false and another missing, though setting those that remained from true to false cleaned up the interface, so I hope never to glimpse those unsuitable ads again. The maker of uTorrent needs to look at the issue or revenue could get lost, and prospective users could see the operation as being cheapened by what is displayed. As for me, I am happy to have gained something in the way of control.