Move Linux Mint Root Partition
I recently added a new disk drive to my workstation and, as part of reorganising, wanted to move the Linux Mint root partition from one disk to another. Naturally I googled duckied it and found a certain amount of useful info.
I used gnuparted to copy the partition from one disk to another. The standard method to reinstall grub on a partition so it will boot appears to be to mount it and use grub-install with the –boot-directory option like this.
Read more →Fried Rice
This is our version of Chinese take-away fried rice. Use whatever meat and vegetables are in the larder. Tasty meal for four
Ingredients
- 2 onions, chopped
- 2 cloves of garlic, chopped
- 2 carrots, grated
- 1/4 white cabbage, thinly sliced
- 1 1/2 cups of easy cook rice
- 250g chopped gammon ham
- 100g cooked prawns
- 100g petit pois
- 1 3/4 cups water or stock
- Vegetable oil
Method
- Put a large dollop of oil into a large skillet or wok.
- Add the onions, garlic, cabbage and carrots and place on a medium heat.
- Cover and let the vegetables cook for a while.
- Add the rice, meat, prawns and peas.
- Add the water and give a good stir.
- Cover and allow to cook until the water is absorbed.
- Add more water if necessary.
- It is possible to get a tasty paella-like crust on the bottom of the pan if timed just right.
Pan fried lamb’s liver, bacon and chorizo
Back in the mid 70’s, I had to do some work at Kingston upon Thames Power Station. When I stopped for lunch, I found a little Greek restaurant opposite in a parade of shops and restaurants. That whole area, including the power station has since been redeveloped, and bears no resemblance. I had their lunch time offer of pan fried kidneys, probably with rice.
When I got home, I mentioned this to she who did most of the cooking at that time and she came up with something which became her kidney special. It evolved into a completely different dish over time.
Read more →Handlers in Android
Using a handler to return results from a worker thread
This has taken me quite a while to put together. There are throw-away remarks in the Android docs about this, but no useful examples. You want to get the results back from a worker thread to your main activity so you can do stuff with them. There are several parts to this.
- The main activity implements Handler.Callback, and has a handleMessage function.
- When the worker thread is created, include a reference to the main activity.
- In the worker thread constructor, create a Handler, including the reference to the main activity.
- When some results need passing back, send a Message back to the main activity using the handler.
public class MyActivity extends Activity implements Handler.Callback
{
//...
// On create
@Override
public void onCreate(Bundle savedInstanceState)
{
//...
WorkerThread worker = new WorkerThread(this);
//...
public boolean handleMessage(Message msg)
{
//...
public class WorkerThread extends Thread
{
Handler handler;
//...
// Constructor
public WorkerThread(Handler.Callback callback)
{
handler = new Handler(callback);
//...
private void someFunction()
{
handler.sendEmptyMessage(WHATEVER);
// or
Message msg = handler.obtainMessage(WHATEVER, thingy);
handler.sendMessage(msg);
//...
The handler will send the message back to the activity in the UI thread, so you can do whatever with the contents.
Read more →Chorizo Egg and Tomato Toasted Sandwich
This is a nice snack for two.
Ingredients
- Two eggs
- Sliced chorizo or crispy bacon
- Four slices of bread
- Tomato thinly sliced
- Cheese sliced
Method
- Toast two slices of bread and fry two eggs
- Meanwhile slice the tomato thinly
- Flip the eggs, otherwise the tomato won’t stay on top
- Layer chorizo slices, egg, tomato slices and cheese slices on each piece of toast
- Put the toast slices on heatproof plates and put under a hot grill to melt the cheese
- Toast the other two slices of bread
- When the cheese is melted take the plates out and press down the other slices of toast on top
- Slice the sandwiches in two diagonally