Friday, 14 November 2014

Changing the default Grub2 entry on the fly

Just another one of those seldom needed bits of info that I'll have to google the next time I need it unless I write it down here.

Yesterday I realised that my network shares weren't being mounted as usual, and I haven't changed the configuration for a month.  The culprit seems to be the new 3.7-2-200 (or there abouts) kernel that I installed.  I don't have time to fully explore the reasons (deadlines, deadlines, deadlines,...) so I'm dropping back to the previous kernel for now. 

Grub2 has the ability to set the default entry to the last menu item selected, but this isn't the default, at least not in Fedora 20.  My original grub defaults (/etc/default/grub) were something like:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
#GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.md=0 rd.dm=0 rd.lvm.lv=fedora_odin/root $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=uk rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
#GRUB_THEME="/boot/grub2/themes/system/theme.txt"
GRUB_THEME="/boot/grub2/themes/hitman/theme.txt"
#GRUB_GFXMODE=1024x768
GRUB_GFXMODE=1280x1024


So although the default is set to saved, to activate the saving feature you need to add the following:

GRUB_SAVEDEFAULT=true

After a quick run of grub2-mkconfig to update the grub.cfg it's all good and my default kernel is non-borked one until a fix comes in, or I have time to read the documentation to see what 'new feature' broke my configuration ;-)


Tuesday, 8 October 2013

Filezilla and mapped network drives

So Filezilla doesn't like network drives.  That's probably a bit harsh and it's just that windows hides a lot of the mess behind the connection.  There is a helpful stickyed post for how to set this up on the official support forum and would be worth following if there is a need to transfer to the mapped drive location.  However, if the transfer is coming from the location to a remote FTP site, you will find addressing the network location using the UNC directly will suffice.

e.g.
\\[server name]\location

Type it into the local site (sic) box and it's job done! =)

Tuesday, 7 May 2013

Okay, so now what?

This blog has been sitting here unused for a while and I thought it was about time I put it to work.  I've been  using a private blog as a learning journal recently and it seems to work well so I've decided I would use this one as a bit of a technical notebook.  I tried keeping it all on Google Drive, but it got messy.

I expect it will mostly contain solutions to problems that I haven't been able to find elsewhere, or to consolidate information from different sources, but we'll see.  I'll be writing it for myself, so it's not necessarily going to get deep or complicated, just stuff I could do without forgetting, but I want to leave it public on the of chance somebody may find it useful.

Sunday, 4 March 2012

Fixed Size Dialog in QT Desinger 4

I've been trying, on and off for the last day or so, to create fixed size dialogs in QT Designer. By that I mean dialogs that are not resizeable by the the end-user. It should be simple I thought (it is), but it's not obvious to somebody who just jumps in to the designer and starts playing. Googling left me confused, with a number of different solutions offered (manually setting min/max sizes; calculating 'stuff' at the start of the app...) but not the QTD solution I was looking for. This blog post will serve mainly as a reminder to myself, but maybe it'll be a help to others too.

This thread (qtforum.org) was the closest I came but that didn't tell the entire story for a QTD newbie:
The actual answer is to apply a layout to your dialog and set the resizeMode property to 'fixed'. This will handle any issues with fonts, i18n, etc.

Most people miss this (see above).
With the final post inluding:
@Chickenblood
Yes, you're right it works that way. Thanks for pointing that out again and again and again. I missed that ;)

As you said, In QT3 designer, after you used Layout in a grid, you can find the resizeMode property and set it fixed there.
(2 other layout properties appear also in the dialog properties : LayoutSpacing and LayoutMargin)

In QT4 it is not available in the property editor when we make a Layout in a grid.(QT4.0.0)
So we need code to do it.
Well that post is from 2005 and the property is there now in Qt4. Great! :) Also I already had some layouts in my dialog (and a great feature they are too), so I just set the layoutSizeConstraint in one of those? No. Okay, all of them then? No. Create a single parent form layout chuck everything inside it and set it's size constraint? No.

Meh!

Finally, the penny reaches escape velocity. You need to have the window selected;

Easy when you know how. Maybe I should just go read the documentation for once...but where is the fun in that ;o)