Thursday 11 September 2014

Deshoogling Shoogled Video

I have previously posted some advice about how to use VirtualDub and deshaker to get rid of the shaky video that is a feature of the Sanyo HD2000 that I use. In the intervening years, lots of other cheap HD cameras have hit the market that are even shakier. I am thinking of the GO Pros and the iPhones.

SO it is time to revisit my post - which could not get audio working.

Here is my fresh solution.

We open the file through a ffmpeg virtualdub input plugin, apply the deshaker filter once, then frameserve the second pass through avisynth proxy, to avidemux to apply final filters and compression settings.

So lets get started. To actually open the file we need VirtualDub. You don't want the portable version, so get the full fat version here:

http://virtualdub.sourceforge.net/

I have been using version 1.10.4, so anything later than that should be fine.

You simply unzip the VirtualDub-1.10.4.zip file to wherever you want, and then go into the folder. You will find a file in there called "auxsetup.exe". Run that. You want to choose the option to "Install Handler". This is going to let you frameserve out of VirtualDub. This is why you can't use the portable version, because it needs to make system changes.

Next you need to be able to open the file. I am dealing with mp4 files containing x264 and AAC streams. If ffmpeg can't decode your file, it's officially weird. There is a very useful plugin for virtualdub which lets you open any file that ffmpeg can access. You can download it here:

http://sourceforge.net/projects/virtualdubffmpeginputplugin/

Again, you just need to unzip the VirtualdubFFMpegPlugin_0817.zip that results. You end up with two folders and a readme. Copy the contents of the plugins32 folder into the plugins32 folder in your virtualdub installation folder. You need to include the "ffdlls" sub-folder.

So far, so good. You can now test your system by running virtualdub, and trying to open your mp4 file. Hopefully that should work. You can further test the system by choosing the file menu, and "Start Frame server...". In the dialogue box that follows, just choose "Start". You will not be running multiple frameservers, but if you are here is where you would give them individual names. In the next window, you need to name your placeholder file. This is the signpost that avisynth is going to open to access the frameserved data. I name my file "frameserver.vdr" and stick it in a temp folder. It's tiny. Once you save this, virtualdub shrinks down to a frameserver info window, with the only option to "Stop Frameserving".

Next, open a new instance of virtualdub, and try to open the frameserver.vdr file. This should work, and should give you access to the data. You should be able to see the counters change on the info window as you browse through the file.

You might be able to open this .vdr file directly in avidemux, or any other encoder of your choice. If so, best of luck you you. I couldn't. Even when I renamed it to "frameserver.avs", which is the avisynth file type.

Tune in next time for more hilarious adventure of how to deshoogle!

Saturday 26 May 2012

Digital Photo Frames

Digital Photos are great. No really, fantastic. But they are utterly worthless if no one gets to see them. You have couple of options. First, stick them all on Facebook. Alternatively, if you do not want to share your personal family life with the entire planet, carry them around with you on a phone (the twenty first century version of the photo in the wallet). Lastly, stick them in a digital photo frame, and stick it somewhere visible.

This post is about getting digital photos the right size and dimensions to display on a digital photo frame. Modern camera's take photographs at a resolution massively higher than modern digital photo frames can handle. So to compensate we have to reduce the size of the images so they display properly.

First of all dump all the images you are working with into one folder. Open a terminal and navigate to the folder where the images are. Secondly, spaces in the filenames will break this, so we have to replace them with underscores using this very handy command which I did not write because it uses SED!:

find . -name '* *' | while read file;
do
target=`echo "$file" | sed 's/ /_/g'`;
echo "Renaming '$file' to '$target'";
mv "$file" "$target";
done;

Anyway, if your frame has a resolution of 800x480 (common for small cheap frames at the time of writing) you can scale all of the images using:

for file in *.{jpg,JPG}; do echo $file && convert -resize 800x480 -quality 80 $file small_$file; done

The really handy thing with the [resize] command is that it doesn't change the aspect ratio, so it either fits the image to 800 wide, or 480 high, and then puts black lines in at the sides to fit the image in.

Friday 27 January 2012

Skyrim

For a change, it is a new year after all, I present my comments on levelling a character in Skyrim.

Skyrim is the latest installment of the Elder Scrolls series, which has been running for nigh on twenty years. I missed Arena, the first one, but thoroughly enjoyed Daggerfall the sequel. I tried Morrowind, and didn't like it. Too weird, dark and depressing. Oblivion was awesome but quirky, and Skyrim is Oblivion with all the stuff I didn't like taken out.

These games are openworld roleplaying games. They are more like toys than games, because you can fiddle around to your hearts content. In the same was as any self respecting role playing game, you can level your character, meaning improving their statistics and skills as you gain in experience.

The Elder Scolls series operates a world levelling system, which I really didn't like in Oblivion. Basically as you get harder, so does the whole world. The result is that you feel you are running on a treadmill, constantly expending effort just to stay still. Skyrim seems to do this much more subtly, so that certain environments are inherently easier/harder no matter what your level. This is good and means you can still feel like a god like mage in some places.

So, how to build character efficiently? Why efficiently? Well every skill increase you get goes towards your overall level. You don't nominate the skills that affect your level like in Oblivion. A simple exploit in Oblivion was to nominate crap like speechcraft and acrobatics, which take ages to increase through normal use. You would then "dabble" in the real stuff. That meant you could max out all the schools of magic and still be level 2. The world treated you like a level 2 character, meaning you could destroy everything you encountered with one or two spells.

Skyrim doesn't do this. Any skill counts towards level, so you want to make sure you only level skills you are going to use in your final character. That's efficient levelling.

OK, so the game starts, and you pick your character. If I am going magey, I do like a high elf magicka bonus. The dragon attacks just in the nick of time, and you are up and running. My advice is to follow this guy, not the guard. Shortly thereafter you find yourself in a room with the NPC asking you to grab a key from a corpse to open a door. Now is the time to level your sneak skills - if you want to. Crouch behind the NPC, sneak, and hit him with a dagger. He is flagged as unkillable by the game, and will never turn on you. This will very quickly level up your sneaking. So quickly you may be over level 10 before you get around to unlocking the door. This, children, is what we call an exploit. It is not a realistic sequence of events. Normal people don't let you stab them in the back several hundred times. This will not work with the guard, so if you want to level sneak, follow Ralof.

You can take the tedium out of stabbing the NPC in the back by blasting him with flames to level your destruction skill. This takes a bit longer because when he hits zero health the skill stops levelling. You only get skill increases when you are actually causing damage.

What next? Well, that depends on your goal. My goal is to create a hard as nails spell caster assassin type. The main early choice you have to make in this role is whether to sneak or go invisible. You can go invisible by levelling illusion to 75 and casting the requisite spell, or by levelling alchemy to produce invisibility potions. Sneaking requires the sneak skill obviously. I have yet to decide which is the better option. You are going to end up levelling alchemy anyway - see below for more information - but I tend to spend a long time invisible so would need to carry a lot of potions. To level efficiently, you really should choose between sneak and illusion.

Every time you level up you get to choose to increase one of health, magicka or stamina. Health gives you your hit points, magicka your spell casting reservoir, and stamina your sprint time/carrying capacity. In the beginning put it all in magicka. You are going to need a decent capacity. However, don't go overboard. As you'll see below, we are going to be crafting a 100% lower casting cost suit. This means that ultimately spell costs in one discipline will be nil. As in do not require magicka. You're going to look pretty stupid with your 500 sized magicka reservoir and nothing to spend it on.

Also, because the world still levels, when you reach late thirties in level, there are bandit archers around who can one shot kill a mage with only 100 health. That's just embarrassing. I have yet to work out what the right balance is, but it will have to take into account whether you go illusion or sneak. The other spells you are likely to be casting are soul trap, and healing, which don't use a massive amount of magicka.

Money, money, money.

Just like real life, you are not going to get anything done until you have got some serious wonga behind you. To get serious wonga you need to be able to run a profitable business. In various forum posts and hints and tips columns about the game, a typical wonga obtaining strategy is "enchant banish on iron daggers, sell for £££'s". This is completely correct and completely useless at the same time. Y'see you need to learn the banish enchantment before you can enchant it onto any dagger, iron or otherwise. Weapons that come with this enchantment are levelled items, so do not appear at the start of the game. I didn't start seeing them being offered for sale until level 33.

So, something else to start then. At the beginning of the game making and selling enchanted weapons is an easy way to spend money instead of making it. Your profit margins are just too narrow to make it worthwhile. Instead, I heartily recommend the potion run. Here's how it works. First get some seed capital. You pop out of the tutorial near Riverwood, so nip in there. Sell all your loot from the tutorial dungeon. You now have two options. If you like scenery, it's time to go on a grand tour of all the major cities. Walk to Riften, Windhelm, Winterhold, Dawnstar, Morthal, Solitude, Markarth, Falkreath and Whiterun in that order. Kill any animals/bandits and pick any flowers/mushrooms you come across. In Winterhold, join the college to get a room with wardrobes that you can permanently store stuff in. Go to the first guild quest to get a free shield spell, and to get access to trainers. Do not go on to the second quest yet. The second option is identical to the first, but you need a bit more seed capital. Just walk up to Whiterun, and take the wagon from there to all the other locations to cut down on exploring time. Keep any ingredients you find. Sell any weapons and armour, unless they have enchantments you don't know. Take any skins to a blacksmith and convert them to leather strips. Store these in your room in the college if you get too many.

You are now ready to start the alchemy grand tour. Using fast travel visit every alchemist in every city (apart from Winterhold) and buy as many of their ingredients as you can afford. Just empty their inventories, apart from Void Salts which are more expensive than any potion you can make from them. Now, go to this website http://www.endoftheweb.se/skyrim/index.php and type in the ingredients you have, and search for the most valuable potions you can find. Make them, and use them to fund the next round of ingredient purchasing. Rinse this, and repeat. In particular, watch out for Giant's toes and wheat. Combined they make a potion worth over 500 gold pieces. Wheat is easy to find, at any of the farms around Whiterun. Giant's toes are harder to part from their owners, so grab them from alchemists whenever you see them.

If you do not want to use a thinks for you website like that, then to make good cash from Alchemy, you want to make the following four potions: Invisibility, Paralysis, Damage Magicka Regen, or Slow.

For invisibility, you want to hoover up Chaurus Eggs, Ice Wraith Teeth, Luna Moth Wing, Nirnroot, Vampire Dust. Mix any two together and you'll have an invisibility potion worth a few hundred gold. You can add a third ingredient to 'power' up the potion. Nordic Barnacle and Namiras Rot work well.

For Paralysis, make sure you buy Briar Heart, Canis Root, Imp Stool, and Swamp Fungal Pod. Again, any two mixed together will get you a health profit. Snowberries or Slaughterfish Eggs and Scales make a good catalyst.

There are many more key ingredients for Damage Magicka Regen. You can collect Bear Claws, Blue Butterfly Wing, Blue Mountain Flower, Chickens Egg, Glow Dust, Hanging Moss, Nightshade, Spider Egg, and Spriggan Sap. Lavendar is the catalyst you want for this potion, although it won't work for every combination.

Lastly, for Slow potions, you want Deathbell, Large Antlers, River Betty, and Salt Pile. Creep Cluster and Scaly Pholiota make good friends with this potion.

When your speech skill hits 25, stop by the Black-Briar Meadery in Riften, and ask the chap behind the counter about the place. You get an option to persuade him, which exercises your speech. (You can actually start this earlier if you have the money to bribe him up to speech 25). You can now hit enter repeatedly to level up your speech skill to whatever value you want. I would recommend taking it to 50. This lets you get the Merchant perk, which lets you sell anything to any shopkeeper. So you do not have to trail from alchemist to smith, to general store. A prerequisite for this is the Alure perk, which gets you better prices from the opposite sex. Most alchemists are women and most blacksmiths are men, so there is no "right" sex to be.

You now have a decent money making trade which will serve you well. It is time to start thinking about weapons and armour. As you are going around your grand tour, start visiting every smith. Buy Iron Ore. Don't buy the ingots, just the ore. The Ironbreaker mine in Dawnstar is a decent place to get a dozen or so lumps of ore, just grab a pick axe from inside the mine. For some reason that's not theft. Then visit a smelter which you can find in Windhelm, Whiterun, and outside said mine. You don't get them in every smith's. Smelt the ore into ingots. Then grab your leather strips, go to the forge and start spamming iron daggers. They need one ingot and strip per dagger. Make between five and six hundred of these and you should hit 100% smithing without spending a penny. Why not do this to make money? Well, you could, but it takes ages to gather the ore. There are maybe only one or two lumps available from a typical smith. Also the daggers sell for less than the ore and strips combined, so if you want cash, you should just sell the raw materials. You can speed up this process by buying the raw materials direct from the smiths. This is expensive, but works out find as long as you pay with potions. Get the merchant perk, buy all the materials you need, then sell the smith some potions to get your cash back.

You then want to start enchanting your daggers. Why? Well a standard iron dagger sells for, say, 5 gold pieces. An iron dagger enchanted with damage magicka sells for 250 gold pieces. To enchant you need to know the enchantment, have an item to enchant, and a filled soul gem. You can buy soul gems from most trading wizards in the College, from most court wizards, and from most general stores. For our purposes a petty soul gem is as good as a grand soul gem. Why? You can buy a filled petty soul gem for under 100gp. Your dagger should not have cost you anything if you harvested the resources yourself, but at most has a construction cost of 10-20gp. With a petty soul gem you can increase its value to 250gp. That's double your investment, which is a very healthy return. Common soul gems can easily cost 200gp-300gp, but only get you a small bump in the value of the dagger, to maybe 275gp. So, you end up breaking even at best. With a grand soul gem you still only get a dagger worth maybe 300gp, and you've spent over 1000gp on it. Petty = better.

If you are running low on leather strips and you are going hunting anyway, you can buy the Soul Trap spell from Phinis Gestor at the college. Load up with empty petty soul gems, then do a wild animal run - I suggest doing laps around the mountain Whiterun is built on - casting soul trap on the animals before you kill them. You'll get skins and souls in one go. If you do this, it can make financial sense to buy some empty lesser or common soul gems. The cost per unit is low enough, and it means you don't have to do too much shopping around for pettys before you get down to some serious hunting. If your potion crafting job is netting you enough cash, you may just want to buy the soul gems filled. If you do a grand tour, including the college, of all general traders, you should get a couple of dozen filled pettys/lesser per lap.

The best starting enchantment is damage magicka. This is better than any of the elemental damage enchantments. If you are staying out of dungeons at this point, get into the habit of checking the weapons that smiths have for sale as you tour around. Grab the cheapest magicka damage weapon you can find, and remember to pay in potions. Then disenchant it at an arcane enchanter, and bingo. Start enchanting those daggers, and hey presto you have a new source of income. As you level enchanting, every 10 points increases the power of the enchantment, so the daggers should increase in value.

The next best enchantments are damage stamina or absorb health. These should boost your dagger value from 250gp to 500gp or thereabouts. Filled common soul gems now also make financial sense, although still not as much sense as pettys. I am not sure what level weapons with these enchantments become available for purchase, because I wasn't paying enough attention. Grab them as soon as you see them. I was level 33 when I saw my first Banish enchanted weapon for sale. This really kicks things into top gear. A banish dagger has a value of 1750gp.

Once you can start to make banishing daggers, your financial woes are at an end. One grand tour for filled soul gems, followed by some smithing and enchanting in Windhelms marketplace, will net you 20,000 to 40,000 worth of daggers. It's now time to start spending that cash.

Get your smithing up to one hundred by just buying the necessary ore/ingots/strips and paying in daggers of banishing. Then enchant your way up to 100 as well. While you are levelling enchanting, and alchemy come to think of it, make sure you get the 5/5 quality perks at the very base of the tree as they increase the sale cost of your items. We now need to consider combat, which isn't something that has been important to date - other than wild animals. Go and see Faralda in the College, and get some destruction training. She can take you all the way to 90. Make sure to take plenty of daggers along to pay with. From 85-90 is going to cost 20,000 - 25,000, so you are looking at 25-30 daggers of banishing to pay for it all. It is probably best to buy training in destruction as you are levelling smithing alchemy and enchanting. Why? You only get 5 training boost per level. If you are mid thirties in level and you boost destruction from 80-85 that's enough to increase your level anyway, at which point you can go straight from 85-90. However, you you are mid-thirties and you go from 30-35 in destruction, that's hardly a blip on your overall level, and you will have to level your crafting skills to gain a level before you can go 35-40.

Pick a form of destruction damage, I like shock, and grab the perks to specialise in it. You can also get the perks to make novice/adept spells cheaper to cast, which can make the game easier if you have to do dungeon runs before hitting 100 smithing/enchanting. Once you get to those levels though, buy some armour with fortify destruction and resist magic. Disenchant the armour to learn those enchantments. Then buy or make some plain light armour. With 100 in enchanting you can make four items, chest, helm, necklace, ring, with over 25% reduction cost for destruction. That means you can cast any destruction spell for free. So you can dual cast Thunderbolt for over 200 shock damage per hit. For free. Bye bye giants and dragons, and pretty much anything else that crosses your path. At 100 enchanting you want to grab the dual effect perk, which lets you add another ability to the armour. Resist magic is very useful, but can only go on the ring and necklace for a total, at 100 skill, of just over 50%. On your helm and chest, you probably want either another magic school such as restoration for cheap wards and healing, or some miscellaneous stuff like extra magicka, waterbreathing, lockpicking, or fortify light armour to boost your armour rating.

Your greaves and boots can't take the magic enchantments, but both can take carry weight, which helps you haul loot out of dungeons. The greaves will also take fortify light armour, and the boots will take muffle, or fortify sneaking, which cancels out the noise of light armour making you much harder to detect when invisible or sneaking. I ended up with:

Helm: Fortify Destruction and Magicka
Chest: Fortify Destruction and Light Armour
Arms: Fortify Carry Weight and Light Armour
Feet: Fortify Carry Weight and Sneak
Neck: Fortify Destruction and Resist Magic
Finger: Fortify Destruction and Resist Magic

To finish off your armour, give it a bit of a boost. Grab the arcane blacksmith perk to be able to work on magic items, then grab the elven (or whatever kind of armour you have) perk. Both require steel to get there, so just grab it. Now you'll need moonstone and quicksilver (if you have the gilded elven chest plate, which you should) ingots. These let you improve the armour ratings of each item at a workbench, adding a significant amount to the armour rating. You probably also want to level light armour along with destruction to get the most out of your armour, picking up the extra ratings perks when they are available.

You are now ready to start some serious dungeon delving. One of the very first quests you get offered is at the Riverwood traders. You need to grab a claw from a dungeon. Don't do this one until you are ready to rock and roll. The problem is that in the dungeon you find a heavy (25) stone which is part of a quest given by the Whiterun mage. You cannot drop the stone as it is a quest item. It weights 25. Is you hand it over it all but triggers the first dragon battle, which triggers random dragon attacks all over the place, which really interrupt the grand tour earning strategy.

If facing one big baddie, constantly thunderbolt him in the face. If facing more than one, chain lightning the whole group. Dual cast the buggers as well, because with your suit of armour, you can benefit from the increased damage per second, and ignore the disproportionate magicka cost increase. At this point, with this build, you should be about level 38, with 5 perks available. You could pump them into speech to get better prices, but a suitable amulet does that job much more efficiently. You also need to make a final decision about sneak/illusion, which is where your next big levelling boost is going to come from. The game is pretty advanced at this stage. You'll have bears and sabre toothed tigers prowling around. Just remember though, thunderbolt to the face. Apart from storm atronachs, that just tickles them.

Once you start offing dragons, gather up their scales and start forging Dragon Scale armour which is very, very, tasty and comes in light and heavy varieties.

Friday 23 December 2011

Formatting Video for iPad

This, I have to say, has been one of the most gratifying things to work out in my entire experience of working stuff out. The iPad is an excellent device for consuming media, especially video. The problem is getting video in a format suitable for the iPad without forking over dosh to Apple.

The best I have been able to come up with to date is Handbrake, which has built in modes for the iPad. What it doesn't do is batch convert a whole directory to iPad format.

So joy of joys, I present the Ubuntu commands necessary for this (assuming you have installed the requisite packages all of which are listed in my how to build a custom Live CD posts).

target_resolution="1024x576" &&
target_bitrate="2.5M" &&
minimum_bitrate="0k" &&
maximum_bitrate="3.5M" &&
audio_bitrate="256k" &&
audio_sample_rate="48000" &&
audio_channels="2" &&
input_extension="mkv" &&
number_of_threads="8" &&
for file in *.$input_extension; do \
ffmpeg -y -i "$file" \
-pass 1 -f mp4 \
-s $target_resolution -vcodec libx264 -threads $number_of_threads -b $target_bitrate \
-bt 100k -maxrate $maximum_bitrate -minrate $minimum_bitrate -bufsize 2M \
-flags2 +mixed_refs -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 2 -refs 2 -coder 0 -me_method umh -me_range 90 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 \
-rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 90 -an /dev/null && \
ffmpeg -y  -i "$file" \
-pass 2 -f mp4 \
-acodec libfaac -ar $audio_sample_rate -ab $audio_bitrate -ac $audio_channels \
-s $target_resolution -vcodec libx264 -threads 8  -async 2205 -b $target_bitrate \
-bt 100k -maxrate $maximum_bitrate -minrate $minimum_bitrate -bufsize 2M \
-flags2 +mixed_refs -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 2 -refs 2 -coder 0 -me_method umh -me_range 90 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 \
-rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 90 \
"${file%.$input_extension}.mp4" \
 ; done

You fill in the details between the quotes at the beginning, copy and paste the code into a command line in a directory containing video files of type .input_extension and it will convert all the files to .mp4 suitable for playing on an iPad. All files will have exactly the same resolution and bitrate, which may not be desirable, so check in advance by examining your files.

You can change the target bitrate to whatever you like, within reason, and the iPad will still play the files. You will want to carefully check the aspect ratio of the files going in to make sure that these settings work. If they start in 16:9 this will spit them out in 16:9 at 1024x576. 4:3 files will need the target_resolution changed to "1024x768" for instance.

Don't make the mistake I made of running several instances of this command at the same time - because they will overwrite each others variables.

As a bonus, here are the commands necessary to extract audio from a clip in an iPod/iPhone friendly format:

audio_bitrate="128k" &&
audio_sample_rate="48000" &&
audio_channels="2" &&
input_extension="flv" &&
for file in *.$input_extension; do \
ffmpeg -y -i "$file" -vn \
-acodec libfaac -ar $audio_sample_rate -ab $audio_bitrate -ac $audio_channels \
"${file%.$input_extension}.m4a" \
; done

Same rules apply.

Friday 11 November 2011

Fixing a fucked Grub2

I have recently encountered a fucked Grub2. This is the latest version of Grub that comes with, amongst other things, Ubuntu Natty. You can't fix it the way I described in the past. That's for Grub1 only.

Why did I end up with a fucked grub? I was stupid. It was entirely my fault. You see, I BELIEVED that this time, when I upgraded my Ubuntu installation from Natty to Oneiric, I wouldn't end up with an unresponsive pile of crap as the result. More fool me.

Because I am not a total buffoon, I made a drive image before attempting the upgrade. I thought I would give True Image Home 2011 another go at being an actual backup program rather than a pointless waste of time. Surprisingly it actually worked. Just about. It had a funny check box thing with some nonsensical question about hard drive ID or some such other thing. I didn't check it. In my experience checking boxes when you do not know what they do is a bad thing.

I now know what this box was asking. It was asking "do you want me not to fuck up your grub when I restore this image?". Oh dear.

So, I was left with a non-working grub. Helpfully I managed to sort it all out, by running these commands from a terminal window on a LiveUSB system.

First of all I mounted the recalcitrant drive into the LiveUSB environment. That's sounds scary. In practice, it means I clicked on the "Places" menu and selected the anonymous drive that was the same size as my Ubuntu, rather than Home, partition on the disk in question.

I then got my terminal window open, and found out where this partition had been mounted by running

mount | tail -1


This command prints the last line [tail -1] of the output of the command to tell you about all [mount]ed partitions. The partition we are interested in should be the last one, because we only just mounted it.

The output I got was along these lines:

/dev/[sdxy] on /media/[string of letters and numbers] type ext4 (rw,nosuid,nodev,uhelper=devkit)


That told me the name of the partition [/dev/[sdxy]] and where it was mounted [/media/[string of letters and numbers]]. That's all I need to know. The next job was to double check that this was the right partition. To do that I just [l]i[s]ted the contents of the [boot] folder on that partition as follows:

ls /media/[string of letters and numbers]/boot


This properly displayed the contents of the boot folder, so I knew I was on the right track. The last step was to run the command to fix everything. This was:

sudo grub-install --boot-directory=/media/[string of letters and numbers]/boot /dev/[sdx]


Please note that I was installing the grub to /dev/[sdx] and NOT /dev/[sdxy], for whatever x and y I got.

And then, surprisingly, it worked fine.

Friday 4 November 2011

More Ubuntu Wifi Joy

My neighbours are flooding my house with super strength wifi signals. or so it seems. I can't get a reliable signal in the upstairs room where the desktop machine is located. My routers is already set on the "I hate my neighbours, make my signal as loud as possible", setting and that is no longer doing the business.

The obvious solution is to change the channel on which the router is broadcasting. The router I use has an auto setting for this, which I presume means is scans around to find a clear channel and then uses that.

This would be an excellent solution if solving IT problems was completely unlike playing fucking Jenga. Yes, this setting change has fixed the reception problem upstairs, but now the netbook refuses to detect the wifi at all. Fucking spiffing.

This is a driver and software problem. I know this because I can boot to a USB Key, and it works find. I can dual boot to my LFS installation (see posts passim) and that works fine as well. It's just the installed ubuntu that doesn't fucking work. All I did was change the wifi channel for fucks sake. No amount of cursing and swearing appeared to fix this.

I eventually decided to manually install the same network drivers as I have running on the LFS installation. This worked fine. Until the next time I rebooted, when they were overwritten by later drivers, which don't fucking work. I have tried to uninstall the newer drivers, but it's as hard to get rid of the fuckers as it is Michael Meyers. Every time I reboot, the bastards pop into existence once more. Pain in the arse.

(Incidentally the fucking useless drivers, on whatever channel my router is now using because they worked find on the old one, are the broadcom hybrid sta drivers 5.100.something.something. The drivers that actually fucking work are version 5.60.48.36)

All of this explains why I now have a script on my desktop called "get_my_fucking_network_working.sh" which contains the following commands:

cd /tmp
cp '/home/[user]/Dropbox/Essential Drivers/Wireless Drivers/hybrid-portsrc-x86_32-v5.60.48.36.tar.gz' .
mkdir hybrid_wl
cd hybrid_wl
tar -xzvf ../hybrid-portsrc-x86_32-v5.60.48.36.tar.gz
unzip '/home/[user]/Dropbox/Essential Drivers/Wireless Drivers/sta_5.60.48.36_2.6.33_kernel_patch.zip'
patch -p0 < patch
unzip '/home/[user]/Dropbox/Essential Drivers/Wireless Drivers/sta_5.60.48.36_2.6.34_multicast_kernel_patch.zip'
patch -p0 < patch_hybrid_multicast
make clean
make
sudo rmmod b43
sudo rmmod b44
sudo rmmod b43legacy
sudo rmmod wl
sudo rmmod ssb
sudo rmmod ndiswrapper
sudo rmmod lib80211_crypt_tkip
sudo rmmod lib80211
sudo modprobe lib80211
sudo insmod wl


I have to run this script every time I boot. Joy of all joys.

Friday 14 October 2011

Evolution

Unable to retrieve message Lost connection to Evolution Exchange backend process Absolute fucking bastard. I hate evolution and the way it connects, or rather doesn't connect, to exchange server, with the passion of a thousand, whatever it is's that makes gamma-ray bursts.