Tag Archives: tips

Mythubuntu 12.04 and Radeon 9200

Hi all, I was having trouble installing Mythubuntu 12.04 on an old PC I had lying around.
Mythubuntu is based on Ubuntu 12.04 so if you’re struggling with the ATI Radeon 9200 on there these steps should help.

(Since I have a Hauppuage Nova-T 500 dual freeview pci card from old projects, and a 2tb drive from new ones, I wanted to see about recording some films!)

Basically, when booting it would come up with a garbled, black or blank screen.

If this happens during the livecd boot, preventing you from installing, when you see the logo:

Logo that appears when first booting ubuntu from livecd.

Logo that appears when first booting ubuntu from livecd.

Hit enter, and F6 for other options, select nomodeset, hit enter to enable then Escape and enter to boot.
If operating from a laptop, you might want to try noapic too.

 

In the latest grub setup – grub 2 – the boot menu is hidden, making it near impossible to access.
Might make it look pretty but is major frustrating for troubleshooting!
The script /boot/grub/grub.cfg it uses is supposed to boot in textmode if it has failed to boot, but this does not work.

The fix:

Note: you can login, type

sudo su

and then skip typing sudo with every command below (it gets quite annoying I know!)

  1. To access the grub bootmenu, hold down shift – after all your pc’s bios and add-on cards bios screens have disappeared and until it pops up – it takes a while to appear!
  2. To access the console – textmode, insert the word text and remove ‘splash quiet’ from the kernel options,
    also insert the word nomodeset
    then press F10 or Ctrl-C to boot with the new settings.
  3. Connect to the internet, if using Wired connection you may need to connect (hopefully you connected ok during the install)

    sudo nmcli -p con up id “Wired connection 1”

    If that doesn’t work check your wireless connections names with and edit the above command appropriately

    nmcli con

  4. Install xserver-xorg-video-ati

    sudo apt-get install xserver-xorg-video-ati

    (don’t freak out when you see ‘Removing Mythubuntu-desktop’ it seems to come right in the end.

  5. Create a new link for the X server
    (Not sure why this breaks after the upgrade but it won’t work without this step!!)

    sudo ln /usr/bin/Xorg /usr/bin/X

  6. Edit the default bootmenu script
    Add nomodeset to the default grub bootmenu

    sudo nano /etc/default/grub.cfg

    Change this line near the top:

    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
    to
    GRUB_CMDLINE_LINUX_DEFAULT=”nomodeset”
    #”quiet splash”

    The # tells it to ignore this bit, it’s a backup so that we can make it quiet again later. You’ll notice text streaming by as the system boots instead of the cute (Myth) Ubuntu …. logo

    Ctrl-X to exit, type s and Return to save

  7. Update grub

    sudo update-grub

  8. Reboot and Revel in the shinyness

    sudo reboot

I actually ran this command to to start the windows manager, (and I haven’t tried rebooting yet, shhh)

sudo start lightdm

If you have any extra trouble, comment below, check the ubuntu forums and google.
I managed to work this out on my own as I couldn’t find the answer!

 

I also created a script to set the resolution of lightdm at boot, following the guide here:
LightDM Resolution

This did not work as when I started lightdm, the resolution was set higher than I’d set in lightdm, so I don’t think this was part of the fix.
Thankfully it was within my monitors capabilities. I think I set the output name wrong.
I need to figure out the display outputs are available but couldn’t query it from the command line without x running, which seems kinda silly.

Hope this has been helpful!

Go (wéiqí, igo, baduk, cờ vây) opening

I’ve been playing Go a bit of late, and a friend was taught this about openings, during a review of a game on KGS. Posting it here mainly so I remember for the future! 🙂

Teofrostus [2k]: when you're playing go, there's a nice checklist that you should go through during the opening 
Teofrostus [2k]: it goes something like this
Teofrostus [2k]: 1) Do I have any weak groups?
Teofrostus [2k]: 2) Does my opponent?
Teofrostus [2k]: 3) Are there any unapproached corners? [opponent corners before allied corners]
Teofrostus [2k]: 4) Are there any "big points" left?
Teofrostus [2k]: and you should respond to these in this order

Also worth noting:
Teofrostus [2k]:it's something that you should follow until you're like 3d

USB Key reminder script

Here’s something for all you windows network admins out there.
(I apologize in advance to Johnathon’s linux followers)

Here’s a little script I wrote to be used as a group policy logoff script to remind users to remove their USB memory sticks/keys when logging off.

I wrote it while working in IT Support for a High School, to help out our IT teachers and ourselves as we were weekly gathering a collection of various USB Memory Sticks and memory keys (and since i was the one trying to reunite them with their owners each week.)

It’s written in VBS so it’s perfect for using as a group policy in active directory on say a Windows 2003 server/XP network. I haven’t tried it on Vista, Windows 7, or Server 2008 because I wasn’t using those technologies at the time, but it will most likely work with Vista and Windows 7 when deployed from a 2k3 or 2k8 server.

It detects removable drives (the type it looks for can be modified) that are connected and won’t pop-up without a drive detected.

If a USB drive is connected, it pops up a dialog reminding the user to take their memory stick with them and then auto-closes after a few seconds (as not to hang the logoff procedure).

I hope this is usefull to someone. If you use it, please leave me a comment.
[LICENCE GPL? NC-SA?]Also, feel free to modify and redistribute this script, but please don’t remove my details, as I’d like to know if it gets used and of any usefull additions others can think of.

[code]

‘ Script to display a list of drives connected to this machine
‘ http://authors.aspalliance.com/brettb/VBScriptDrivesCollection.asp
‘ MODIFIED to detect only removable drive. GTinsley 2008 @ Wallington County Grammar School.
‘  May cause false positives on some SATA ‘puters.
‘  Tested working on ‘puters with card readers.

Set FileSystemObject = CreateObject(“Scripting.FileSystemObject”) ‘Create a filesystem object
Set Drives = FileSystemObject.Drives ‘Create a drives collection

‘ Step through the drive collection, and get both the drive letter and the drive type.
‘ There are 6 distinct types of drive:
‘Select Case DriveType
‘   Case “0” DriveType = “Unknown type of drive”
‘   Case “1” DriveType = “Removable drive”
‘   Case “2” DriveType = “Fixed drive”
‘   Case “3” DriveType = “Network drive”
‘   Case “4” DriveType = “CD-ROM drive”
‘   Case “5” DriveType = “RAM Disk”
‘End Select

For Each DiskDrive in Drives

DriveLetter = DiskDrive.DriveLetter
DriveType = DiskDrive.DriveType

‘ Check for a removable drive connected that:
‘     Is not the drive letter A B or C
‘    Folder exists (proves the drive exists)
IF Drivetype = “1” and not driveletter = “C” and not driveletter = “A” and not driveletter = “B” and FileSystemObject.FolderExists(driveletter & “:\”) then

‘ Old method. Waits until user has clicked OK before logoff completes.
‘WScript.Echo “The removable disk drive ” & DriveLetter & ” is a still connected. Don’t forget your USB drive!”

‘ New method waits 5 seconds then logs off.

time_out = 5      ‘ wait max. 5 seconds
title = “Forgetting something?”
button = vbOKonly  ‘ vbOKOnly
message = “The Removable Disk (” & DriveLetter & “:\) is a still connected. Don’t forget your USB drive!”

Set objWSH = WScript.CreateObject(“Wscript.Shell”)     ‘ create object
objWSH.Popup message, time_out, title, buttons     ‘ popup
end if
Next

‘ Clear objects and collections
Set Drives = nothing
Set FileSystemObject = nothing

[/code]

Windows Command Line Ping Replacement

So the windows version of ping is really stupid.

I was writing a batch script to mount up a network share that involved checking to ensure my NAS unit was turned on. The script is scheduled to run after the computer resumes.

What I found out is that the built in version of Ping.exe is terrible at telling you whether the ping has returned successfully or not. I was checking the ERRORLEVEL – %ERRORLEVEL% variable to find out what ping was returning. It should be 0 for success and 1 or higher for a failure.

What I found was, i was getting replies from the local pc (dunno why, leave me a comment if you know) and ping was reporting a success even though the correct pc failed to reply. The solution?
Replace the Windows ping.exe with Fping. It has a lot more options and appears – from some initial quick tests – to correctly report the errorlevel.

Kudos to Wouter Dhondt for developing it. I’ll update this post with any more news!

 

image Fping vs Ping errorlevel return values

Hidden Ubuntu Gems: Window Selection, Always on Top & Password Gen

I thought it was probably a good time for another Ubuntu-related post, so here we go.

Window Selection

Window controls, selection raising etc

Something I found on one of my explorations, is this really handy feature (handy for me at least), which allows you to give a window “focus” (or selection) merely by putting your mouse over it. To activate it, click on “System”, go to “Preferences”, and then click on “Window”. Up pops a small selection window.

As you can see, I’ve ticked “Select windows when the mouse moves over them”. You can also have windows be raised to the top of the screen if you hold your mouse over them for a certain length of time. As my collegue at work found, setting the interval to “0” is not very useful…

There are a couple of other tweaks you can make here. I’ll let you explore them on your own 🙂

Always on Top

“Always on Top” allows you to basically tell the system that you want a window to be the upper-most on the screen, no matter what else you do. You can’t “Raise” anything above it. I tend to use this little gem with my next tip.

Set a window to be always on top by right clicking on the title bar (the big orange bar at the top of the window, which contains the minimize, maximize and close buttons). Click the “Always on Top” option. That  window will now stick on top of your screen. Undo it, by right clicking again on the title bar, and clicking “Always on Top” again.

Password Gen (pwgen)

pwgen is a small, neat, command-line program to quickly generate fairly easy-to-remember, fairly secure passwords. You can install it by clicking here, or going to whichever package manager you prefer (synaptic, Add-Remove Programs, apt-get or aptitude) and installing “pwgen”.a screenshot of pwgen with my preferred settings in use

Use it simply by typing “pwgen” in a terminal (“Applications” > “Accessories” > “Terminal”). I tend to run it with the command “pwgen 8 1”, which generates one 8 character password.

Now, if you’re adding a lot of users to a system or something (I am currently at work), using a combination of these tips will save you time… I’ll leave it up to you to work out how to combine them. (Hint: resizing a terminal window like I did above is a good starting point.)