TOPIC: GOOGLE
Sorting out MySQL on Arch Linux
5th November 2011Seeing Arch Linux running so solidly in a VirtualBox virtual box has me contemplating whether I should have it installed on a real PC. Saying that, recent announcements regarding the implementation of GNOME 3 in Linux Mint have caught my interest, even if the idea of using a rolling distribution as my main home operating system still has a lot of appeal for me. Having an upheaval come my way every six months when a new version of Linux Mint is released is the main cause of that.
While remaining undecided, I continue to evaluate the idea of Arch Linux acting as my main OS for day-to-day home computing. Towards that end, I have set up a working web server instance on there using the usual combination of Apache, Perl, PHP and MySQL. Of these, it was MySQL that went the least smoothly of all because the daemon wouldn't start for me.
It was then that I started to turn to Google for inspiration, and a range of actions resulted that combined to give the result that I wanted. One problem was a lack of disk space caused by months of software upgrades. Since tools like it in other Linux distros allow you to clear some disk space of obsolete installation files, I decided to see if it was possible to do the same with pacman, the Arch Linux command line package manager. The following command, executed as root, cleared about 2 GB of cruft for me:
pacman -Sc
The S in the switch tells pacman to perform package database synchronization, while the c instructs it to clear its cache of obsolete packages. In fact, using the following command as root every time an update is performed both updates software and removes redundant or outmoded packages:
pacman -Syuc
So I don't forget the needful housekeeping, this will be what I use from this point forward, with y
being the switch for a refresh and u
triggering a system upgrade. It's nice to have everything happen together without too much effort.
To do the required debugging that led me to the above along with other things, I issued the following command:
mysqld_safe --datadir=/var/lib/mysql/ &
This starts up the MySQL daemon in safe mode if all is working properly, and it wasn't in my case. Nevertheless, it creates a useful log file called myhost.err
in /var/lib/mysql/
. This gave me the messages that allowed the debugging of what was happening. It led me to installing net-tools
and inettools
using pacman; it was the latter of these that put hostname on my system and got the MySQL server startup a little further along. Other actions included unlocking the ibdata1 data file and removing the ib_logfile0
and ib_logfile1
files to gain something of a clean sheet. The kill command was used to shut down any lingering mysqld
sessions too. To ensure that the ibdata1 file was unlocked, I executed the following commands:
mv ibdata1 ibdata1.bad
cp -a ibdata1.bad ibdata1
These renamed the original and then crafted a new duplicate of it, with the -a
switch on the cp
command forcing copying with greater integrity than normal. Along with the various file operations, I also created a link to my.cnf
, the MySQL configuration file on Linux systems, in /etc using the following command executed by root:
ln -s /etc/mysql/ my.cnf /etc/my.cnf
While I am unsure if this made a real difference, uncommenting the lines in the same file that pertained to InnoDB tables. What directed me to these were complaints from mysqld_safe in the myhost.err
log file. All I did was to uncomment the lines beginning with innodb
and these were 116-118, 121-122 and 124-127 in my configuration file, but it may be different in yours.
After all the above, the MySQL daemon ran happily and, more importantly, started when I rebooted the virtual machine. Thinking about it now, I believe that it was a lack of disk space, the locking of a data file and the lack of InnoDB support that was stopping the MySQL service from running. Running commands like mysqld
start weren't yielding useful messages, so a lot of digging was needed to get the result that I needed. In fact, that's one of the reasons why I am sharing my experiences here.
In the end, creating databases and loading them with data were all that was needed for me to start to see functioning websites on my (virtual) Arch Linux system. It turned out to be another step on the way to making it workable as a potential replacement for the Linux distributions that I use most often (Linux Mint, Fedora and Ubuntu).
Making a custom button to hide or display the Google Toolbar in Firefox
27th February 2011While adding more toolbars to Firefox is all very fine, they can take up space on the screen. Even with the big screens that many of us have these days, it's still nice to be able to see more of what we use web browsers to visit: web pages. For the Web Developer extension's toolbar, there is the Toggle Web Developer Toolbar plugin for showing and hiding the thing when so desired. As it happens, I keep it hidden until I need it and I fancied doing the same thing with the Google Toolbar but found none. Instead, I happened on a tutorial that used the Custom Buttons plugin to define a custom button. That gives you an entry named Add new button... to the context menu that appears when you right-click on the main menu bar near the top of the Firefox window. When you select the that extra entry in the menu, you get the dialogue box that you see below.
In there, that are some form fields that need filling. Button URL is an option without which you can do, but I entered "Toggle Google Toolbar" into the Name field while also sourcing an image to be used on the button instead of the default (a Google logo, naturally...). The last step is to add the code below underneath the /*CODE*/
comment line, leaving the latter in place.
const toolbar = document.getElementById("gtbToolbar");
toolbar.collapsed = !toolbar.collapsed;
With all that completed, clicking on the OK button is all that's needed to finish off the button definition. With that done, the next step is to add the button where you want it by right-clicking on the top menu bar again and selecting the Customise... entry. From the list of buttons that appears, just pick the new one and drag it to where you want it to go. Then, you're done with what might sound like a roundabout away of putting in place a space saver, but I can live with that.
Starting a fifth...
17th January 2011While it is difficult to believe the passage of time sometimes, there are events that provide the occasional reminder. The fourth birthday of this outpost on the web is but a small representative of the genre. An initially frenetic posting rate slowed over time and new entries appear on here when there is something to share rather than trying to work to a schedule. That went by the wayside a good while ago...
Over the years, appearances have changed, but the same raison d'être remains: to share useful snippets regarding the digital technology that pervades this age. Sometimes, these are things that I need to store for my own future reference, yet there are others that I scarcely have seen elsewhere. Even with the power of Google or Bing, it can be challenging to track down the knowledge that you need these days, so that's why I keep on adding to the collection of material that you find on here.
All in all, we seem to be in a time of major upheaval. During the past year, I had one of my own; the result was a change of job and place of work. However, there are many more momentous ones than that, with plenty to be seen in the world of technology. Digital photography is taken for granted nowadays, with the next likely battle between DSLR's and compact system cameras. Then, there's the increasing mobility of computing and the increasingly clever packaging of diminutive yet powerful devices. It appears that everything is all change, so that may bring me more things about which to write on here. 2011 may become an interesting, if very challenging year ahead.
A look at Emacs
10th August 2010It's remarkable what work can bring your way in terms of technology. For me, (GNU) Emacs Has proved to be such a thing recently. It may have been around since 1975, long before my adventures in computing ever started, in fact, but I am asking myself why I never really have used it much. There are vague recollections of my being aware of its existence in the early days of my using UNIX over a decade ago. Was it a shortcut card with loads of seemingly esoteric keyboard shortcuts and commands that put me off it back then? The truth may have been that I got bedazzled with the world of Microsoft Windows instead, and so began a distraction that lingered until very recently. As unlikely as it looks now, Word and Office would have been part of the allure of what some consider as the dark side these days. O how OpenOffice.org and their ilk have changed that state of affairs...
The unfortunate part of the Emacs story might be that its innovations were never taken up as conventions by mainstream computing. If its counterparts elsewhere used the same keyboard shortcuts, it would feel like learning such an unfamiliar tool. Still, it's not as if there isn't logic behind it because it will work both in a terminal session (where I may have met it for the first time) and a desktop application GUI. The latter is the easier to learn, and the menus list equivalent keyboard shortcuts for many of their entries, too. For a fuller experience though, I can recommend the online manual, and you can buy it in paper form too if you prefer.
One thing that I discovered recently is that external factors can sour the impressions of a piece of software. For instance, I was using a UNIX session where the keyboard mapping wasn't optimal. There's nothing like an unfamiliar behaviour for throwing you off track because you feel that your usual habits are being obstructed. For instance, finding that a Backspace key is behaving like a Delete one is such an obstruction. It wasn't the fault of Emacs, and I have found that using Ctrl+K (C-k in the documentation) to delete whole lines is invaluable.
Apart from keyboard mapping niggles, Emacs has to be respected as a powerful piece of software in its own right. It may not have the syntax highlighting capabilities of some, like gedit or NEdit for instance, but I have a hunch that a spot of Lisp programming would address that need. What you get instead is support for version control systems like RCS or CVS, along with integration with GDB for debugging programs written in a number of languages. Then, there are features like file management, email handling, newsgroup browsing, a calendar and a calculator that make you wonder if they tried to turn a text editor into something like an operating system. With Google trying to use Chrome as the basis of one, it almost feels as is Emacs was ahead of its time, though that may have been more due to its needing to work within a UNIX shell in those far-off pre-GUI days. It really is saying something that it has stood the test of time when so much has fallen by the wayside. Like Vi, it looks as if the esteemable piece of software is showing no signs of going away just yet. Maybe it was well-designed in the beginning, and the thing certainly seems more than a text editor with its extras. Well, it has to offer a good reason for making its way into Linux too...
Worth the attention?
21st July 2010The latest edition of Web Designer has features and tutorials on modern trends, including new ways to use fonts and typography in websites. One thing that's at the heart of the attention is the @font-face
CSS selector. It's what allows you to break away from the limitations of whatever fonts your visitors might have on their PC's to use something available remotely.
In principle, that sounds like a great idea, yet there are caveats. The first of these is the support for the @font-face selector in the first place, though modern browsers I have tested handle this reasonably well. These include the latest versions of Firefox, Internet Explorer, Opera and Chrome. While the new fonts may render OK, there's a short delay in the full loading of a web page. With Firefox, the rendering seems to treat the process like an interleaved image, so you may see fonts from your own PC before the remote ones come into place, a not too ideal situation in my opinion. Also, I have found that this is more noticeable on the Linux variant of the browser than its Windows counterpart. Loading a page that is predominantly text is another scenario where you'll see the behaviour more clearly. Having a sizeable image file loading seems to make things less noticeable. Otherwise, you may see a short delay to the loading of a web page because the fonts have to be downloaded first. Opera is a particular offender here, with IE8 loading things rather quickly and Chrome not being too bad either.
In the main, I have been using Google's Fonts Directory but, in the interests of supposedly getting a better response, I tried using font files stored on a test web server only to discover that there was more of a lag with the fonts on the web server. While I do not know what Google has done with their set-up, using their font delivery service appears to deliver better performance in my testing, so it'll be my choice for now. Though there's Typekit too, I'll be hanging onto to my money in the light of my recent experiences.
After my brush with remote font loading, I am inclined to wonder if the current hype about fonts applied using the @font-face
directive is deserved until browsers get better and faster at loading them. As things stand, they may be better than before, while the jury's still out for me, with Firefox's rendering being a particular irritant. Of course, things can get better...
Exploring the mobile web
16th July 2010With a change of job ahead of me, I decided to make my web usage a little more mobile. The result was the purchase of a Blackberry 8520 Curve on a T-Mobile pay-as-you-go tariff to complement my existing phone. The attraction included mobile email access and some web browsing capability. Though GPRS provides slow web browsing, it works adequately whilst highlighting the value of mobile-optimised websites. It's just as well that this website that you're reading has a mobile version.
Hooking the Blackberry up to GMail was no problem once I had paid my dues and the necessary set up was done for me; it was only then that the required option was available through the set-up screens. While RIM's own web browser may be no slouch when it comes to rendering websites, I put Opera Mini in place as well for those times when the default option could be bettered and they exist too. Speaking of RIM applications, there's one for Twitter too, though I added Übertwitter for the sake of greater flexibility (it can handle more than one account at a time, for example). In addition, I have instated applications for WordPress and LinkedIn too, and it was then that I stopped myself spending too much time in Blackberry App World. If I was of the Facebook persuasion, I might be interested in the default offering for that as well, but I have learnt to contain myself.
Of course, there are limitations to the device's capabilities regarding email and web on the move. Long emails still need desktop access (messages can get truncated) and mobile unfriendly websites will take an age to load and explore; a small screen means much more finger work. After all, this is a small device, so the observations aren't astounding; it's just that I encounter the reality of life on a small screen now. Nevertheless, useful sites like those from Google and the Met Office have a mobile variant, though I'd like to see the latter including its rain radar as part of the package.
Speaking of life on a smaller scale, there's the size of the keyboard to consider too. So far, I haven't had much practice with it, but I am unsure as how some craft longer blog entries with the tiny keys. Then, there's the ever-present threat of arm discomfort and RSI that you have to watch. For that reason, I'll stick with use for an hour at a time rather than going mad altogether. Navigating around the screen using the tiny trackpad is something to which I am adjusting, and it works well enough too, so long as you're not looking through long web pages or emails.
To bring this piece to a close, the new gadget has been finding uses and I don't intend to leave it idle after paying over £150 for it. Apart from acting as an expensive calculator, it has already travelled abroad with me with roaming not being a problem; while I may have failed to make it work with hotel broadband, there was EDGE availability to keep things connected. All in all, the device is earning its keep and teaching me a few things about mobile handheld computing with my main website in process of being made more mobile compatible with the front page and the photo gallery gaining versions for handheld devices after the same was done for the outdoors blog earlier this year (might make the design look more like the rest of the site though). Without something on which to do some real testing, that idea may not have become reality as it is. It may be no desktop substitute, but that's never to say that these devices may never get near that situation. After all, there was a time when no one could imagine the same for laptop PC's, and we all know what has happened to them.
So you just need a web browser?
21st November 2009When Google announced that it was working on an operating system, it was bound to result in a frisson of excitement. However, a peek at the preview edition that has been doing the rounds confirms that Chrome OS is a very different beast from those operating systems to which we are accustomed. The first thing that you notice is that it only starts up the Chrome web browser. In this, it is like a Windows terminal server session that opens just one application. Of course, in Google's case, that one piece of software is the gateway to its usual collection of productivity software like Gmail, Calendar, Docs & Spreadsheets and more. Then, there are offerings from others too, with Microsoft just beginning to come into the fray to join Adobe and many more. As far as I can tell, all files are stored remotely, so I reckon that adding the possibility of local storage and management of those local files would be a useful enhancement.
With Chrome OS, Google's general strategy starts to make sense. First create a raft of web applications, follow them up with a browser and then knock up an operating system. It just goes to show that Google Labs doesn't simply churn out stuff for fun, but that there is a serious point to their endeavours. In fact, you could say that they sucked us in to a point along the way. Speaking for myself, I may not entrust all of my files to storage in the cloud, yet I am perfectly happy to entrust all of my personal email activity to Gmail. It's the widespread availability and platform independence that has done it for me. For others spread between one place and another, the attractions of Google's other web apps cannot be understated. Maybe, that's why they are not the only players in the field either.
With the rise of mobile computing, that kine of portability is the opportunity that Google is trying to use to its advantage. For example, mobile phones are being used for things now that would have been unthinkable a few years back. Then, there's the netbook revolution started by Asus with its Eee PC. All of this is creating an ever internet connected bunch of people, so having devices that connect straight to the web like they would with Chrome OS has to be a smart move. Some may decry the idea that Chrome OS will be available on a device only basis, but I suppose they have to make money from this too; search can only pay for so much, and they have experience with Android too.
There have been some who wondered about Google's activities killing off Linux and giving Windows a good run for its money; Chrome OS seems to be a very different animal to either of these. It looks as if it is a tool for those on the move, an appliance, rather than the pure multipurpose tools that operating systems usually are. If there is a symbol of what an operating system usually means for me, it's the ability to start with a bare desktop and decide what to do next. Transparency is another plus point, with the Linux command line having that in spades. For those who view PC's purely as means to get things done, such interests are peripheral, and it is for these that the likes of Chrome OS has been created. In other words, the Linux community need to keep an eye on what Google is doing but should not take fright because there are other things that Linux always will have as unique selling points. Even though the same sort of thing applies to Windows too, Microsoft's near stranglehold on the enterprise market will take a lot of loosening, perhaps keeping Chrome OS in the consumer arena. Counterpoints to that include the use GMail for enterprise email by some companies and the increasing footprint of web-based applications, even bespoke ones, in business computing. In fact, it's the latter that can be blamed for any tardiness in Internet Explorer development. In summary, Chrome OS is a new type of thing rather than a replacement for what's already there. We may find that co-existence is how things turn out, but what it means for Linux in the netbook market is another matter. Only time will tell on that one.
Using the Windows Command Line for Security Administration
24th July 2009While there are point and click tools for the job, being able to set up new user groups, attach them to folders and assign users to them using the command line has major advantages when there are a number to be set up and logs of execution can be retained too. In light of this, it seems a shame that terse documentation along with the challenge of tracking down answers to any questions using Google, or whatever happens to be your search engine of choice, makes it less easy to discern what commands need to be run. This is where a book would help, but the whole experience is in direct contrast to the community of information providers that is the Linux user community, with Ubuntu being a particular shining example. Saying that, the Windows help system is not so bad once you can track down what you need. For instance, knowing that you need commands like CACLS
and NET LOCALGROUP
, the ones that have been doing the back work for me, it offers useful information quickly enough. To illustrate the usefulness of the aforementioned commands, here are a few scenarios.
Creating a new group:
net localgroup [name of new group] /comment:"[more verbose description of new group]" /add
Add a group to a folder:
cacls [folder address] /t /e /p [name of group]
The /t
switch gets cacls
to apply changes to the ACL for the specified folder and all its subfolders, a recursive action in other words, while the /e specifies ACL editing rather than its replacement and /p induces replacement of permissions for a given user or group. Using :n, :f, :c or :r directly after the name of a specified user or group assigns no, full, change (write) or read access, respectively. Replacing /p with /r revokes access, and leaving off the :n/:f/:c/:r will remove the group or user from the folder.
Add a user to a group:
net localgroup [name of group] [user name (with domain name if on a network)] /add
In addition to NET LOCALGROUP
, there is also NET GROUP
for wider network operations, something that I don't have cause to do. Casting the thinking net even wider, I suspect that VB
scripting and its ability to tweak the Windows Management Interface might offer more functionality than what is above (PowerShell also comes to mind while we are on the subject) but I am sharing what has been helping me, and it can be difficult to find if you don't know where to look.
Ridding the Google Toolbar dictionary of erroneously added words
16th June 2009Butterfingeredness can happen to anyone, and it's always nice to know to remove words added to custom dictionaries in error. Many of my blog postings have had their spellings checked using a button on the Google Toolbar, so I have a vested interest in knowing how to remove any bloomers. Thankfully, they have a useful page telling you exactly what you need to do for Firefox and Internet Explorer. As is often said, you can never be too careful...
Take a great leap forward, then consolidate...
12th June 2009While I have been a user of WordPress since late 2006, I only began to start keeping tabs on its development following my hearing news of dramatic changes coming in what became 2.5. Since a pattern developing with more significant changes coming in 2.5 and 2.7 while both 2.6 and 2.8 didn't add too much in the way of upheaval but rather evolved what was already there. With 2.8, theme and widget management got the once over, while there were plenty of other tweaks that polished a well received forbear. The differences between 2.7 and 2.8 are discernible without breaking anything that shouldn't be broken. In short, I rather like the result.
The reaction to 2.5 was mixed, to say the least, and that in part led to the dramatic changes in 2.7, especially regarding the administration interface. Now, I admit to having had doubts about these when I first saw them in development, especially when there was so much chopping and changing during development that stepping back until things settled down became a necessity. Even adding a ticket to the TRAC was problematical, unless you had sight of what was happening behind the scenes, because it became too easy to add an invalid ticket.
With the release of 2.8 into the wild, 2.9 is now on the horizon, and I am inclined to suspect that we might see more considerable changes again. For one thing, there was that interface poll a little while ago, so who knows what impact that may have on what comes next. The structure of the administration screens may not alter that much, but it still leaves changes to colours and icons with the aim of separating navigation from what else is on there, something that doesn't trouble me at all. In fact, I don't see very much wrong with how things are right now, which causes me to wonder if there's any point in making too many changes at all.
The forecasted incorporation of WPMU functionality is a bigger change that would mean the end of WordPress MU as a separate entity, and would concern me more with the amount of under the bonnet re-engineering that would be needed. Add Google Summer of Code projects to this mix and 2.9 looks as if it could be a step change in the spirit of 2.5 and 2.7, if not in feel. Summer 2009 could be very interesting for WordPress, leaving me to hope that it continues to work for me in the way that it does as we move from version to version.