Convert Dynamically Sized VirtualBox VDI Hard Drive to Fixed Size

The Problem

You have got a dynamically sized, VDI virtual hard drive in VirtualBox and would like to convert it into a fixed size hard drive.

You are using Windows.

The Solution

  • Locate VBoxManage.exe on your machine. It should be in the VirtualBox program directory (usually found under C:\Program Files\Oracle\VirtualBox) .
  • Open a command prompt (e.g. by searching for “cmd”+Enter Windows 7 or 8).
  • Go to the directory in which VBoxManage.exe is located by typing something like:

cd “C:\Program Files\Oracle\VirtualBox”

  • Convert your dynamically sized hard drive to a fixed size harddrive using the command:

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd <path-to-source-vdi> <path-to-destination-vdi> –variant Fixed

This might take a while depending on the size of your drive. You probably have used this drive as part of a virtual machine. In order to use the new hard drive you need to go through a few more steps.

  • Open the virtual box manager, go to settings for your machine and remove the old (dynamically sized) drive from the SATA controller for this machine.

  • Go back to the command line and display a list of your currently registered hard drives:

VBoxManage.exe list hdds

  • Manually remove your old drive from the list by running the command:

C:\Program Files\Oracle\VirtualBox>vboxmanage closemedium disk <UUID of your drive> –delete

ATTENTION: This will delete your old hard drive file. You may want to make a backup copy of the image before running this operation.

  • Rename the new (fixed size) hard drive file to the name of your original vdi file. For instance, if your old drive’s name was ‘myhdd-10GB.vdi’ and your new fixed size drive’s name is ‘fixed-10GB.vdi’, rename ‘fixed-10GB.vdi’ to ‘myhdd-10GB.vdi’
  • Go to the VirtualBox Manager and add the freshly renamed drive to the SATA controller for your VM.

Now you should be able to start your VM with the new drive and (hopefully) enjoy the performance benefits of a fixed size drive.

References

HOWTO: Convert VDIs Between Fixed-Sized and Dynamic In VirtualBox

Stackoverflow – Convert VirtualBox dynamic VDI disk image to static, fixed VDI

coderwall – Purge deleted hard disks from Virtual Box

 

Improving Voice Recording with Audacity

Audacity is a powerful and free tool to edit all kinds of audio files. However, the many features it offers can be overwhelming for beginners and more advanced users alike. This guide contains some tips how to go about doing a very specific task with audacity: Improving the quality of recorded voice, for instance for podcasts or voice overs.

This guide is especially meant for situations where you do not have a very good microphone and other professional recording equipment.

Recording

Things to remember while recording:

  • Hold the microphone close, but not so close that there will be cracking and/or overemphasized explosive sounds (such as when speaking the letter ‘p’).
  • Try to find a small room with few flat and hard surfaces (such as a wall). Rooms with plenty of curtains and carpet are better.
  • Try to find a place for recording which you will be able to access again (such as a room in your house). If you record yourself in a different location, your voice might sound noticeably different. WHERE you record is as important as HOW you record.
  • Make sure that there are a few seconds of silence at the beginning and/or end of the recording.

After you have done the recording, post production in Audacity may commence.

Remove Background Noise

  • First, select 1 to 3 seconds of the silence at the beginning and/or end of the recording.
  • Play the selection and assure that it is homogenous. That is, it contains hissing or other kinds of background noise, which does not change (e.g. gets louder or is interrupted by other noises such as clicking a mouse, breathing, etc.).
  • Go to menu Effects / Noise Removal (keyboard shortcut: Alt + C à‘N’ à Enter)
  • Configure the settings as follows (or play around with them for better results):

  • Click on [Get Noise Profile] (keyboard shortcut: Alt + G).
  • Select your whole recording (keyboard shortcut: Ctrl + A).
  • Apply the noise removal by using menu Repeat Last Effect (keyboard shortcut: Ctrl + R).

Note: You might want to repeat this process once more while selecting another region of ‘silence’ – this can help to reduce the background noise even more.

Make the Voice ‘Warmer’

When using cheap microphones, your voice might often sound metallic. To remove this effect, apply this simple filter.

  • Apply the effect

Make the Recording Louder

Applying the previous effect will have made the recording overall less loud. You should now be able to amplify it to make it louder without causing distortions.

  • Select the whole recording
  • Go to menu Effect / Amplify
  • Set the amplification to 2 db to 4 db (NOT as much as you can without causing cropping.

And More

There are plenty of more effects you can apply to a voice recording, for instance, compression or normalization. However, keep in mind that any effect that you add also reduces the quality of your sound file and makes it less authentic. So, only apply effects if you can hear they make a noticeably positive difference (without negative side effects).

Note that you can create an Edit Chain for the equalization and amplification to apply the effects conveniently to many files. While you can use the Noise Filter in an edit chain as well, I would not recommend it, since there are often subtle differences in the background noise between recordings (even if they are recorded in the same room) and the Noise Filter can only apply one noise profile to all files which are to be processed.

References

How to Make Vocal Audio Sound Better in Audacity

#1 Audacity Tutorial: Warm & Clear Voice

The Conscious Mind as Trainer

It might be that our subconscious mind ears often in our urban and large-scale world. It might be that reason and traditional intelligence are the most useful devices to navigate this world.

I’m reading ‘Thinking Fast and Slow’ from Kahneman at the moment and what I’ve read so far seems to have a bias towards our higher mind of reason. Specifically, various instances are discussed in which what humans intuitively feel is the correct answer is logically and/or mathematically false.

However I think it is better to think of our subconscious, automatic mind as a prodigy. Somebody with great potentials but also great flaws. It is our job to be the guide of this prodigy. Thereby not understanding our conscious, reasoning mind as being more trustworthy or superior to our subconscious mind, but understanding it as a facilitator, a manager. The conscious mi d is not the rock band, which amazes millions, it’s the boring guy in the background, which assures that the catering is cared for.

Because our conscious mind is weak – it might give us the illusion that our reasoning mind is us – that we could be the voice talking in our had and deliberately going through the steps of calculating 34 * 15 – but this voice is not who we actually are, it’s a small, insignificant part of what constitutes us; our intuition, the thoughts and processes we are not aware of are much more us – importantly they set the boundaries of what our conscious mind can accomplish.

The conscious mind however can also work as a coach. It can observe the team, send it through drills and training sessions, set the strategy; however, when the real action happens, the conscious mind, just like a coach, stands on the side lines with very little influence.

trainer

A good or a bad trainer can make a crap team into a sterling one. But only a trainer, who accepts his team, and accepts his role in the periphery of the game can accomplish such.

Such I believe the conscious mind should progress, with humility, patience, love and determination.

Steve Jobs and Leadership

There is something wrong with the way Steve Jobs led people. The biography from ‪Isaacson‬ is full of examples how Steve Jobs exercised excessive control, restricting the autonomy of talented employees, or outright abused employees in an inhumane way.

Research suggests that people work better if they are not driven by fear or monetary incentives but by a desire for autonomy and by the desire to become better at whatever they are doing.

Consequently, having a leader like Steve Jobs should be detrimental for any business, preventing employees to realize their full potential. However, it is difficult not to see that Steve Jobs was indeed good for Apple, leading it to unprecedented successes. This contradiction has puzzled me for a while: how can Jobs have exercised such bad leadership, yet be so successful. I think one possible answer might lie in that Jobs did some things outstandingly right, mitigating the effects of his bad leadership style. I think one of these things was that Jobs was a leader to inspire.

Jobs did not led his company through following a carefully justified strategic plan. He led his company through a number of strong visions, which resonated both in his personality as well as in his actions. Some of these visions were:

  • building great products through simplicity, control over end-user experience, and great and delighting design (a product is not ready yet, if it does not surprise and delight)
  • building a company which can last generations
  • building a team exclusively made of top performers

I think this aspect of Jobs’ persona is rather well known and documented. Jobs was a man of the Why, the purpose behind what is done, rather than a man of the How, the way something is achieved. Visions are a powerful psychological instrument, connecting with people’s feelings rather than their logical mind.

Although Jobs led successfully through visions, it should not be forgotten that visions can also be extremely harmful. Hitler was a very skilled leader, leading by grand visions and emotions rather than rational arguments – with well-known devastating outcomes. This is not to say, of course, that Steve Jobs was like Hitler, he certainly was a totally different person. However, I believe, as powerful as visions can be, they can also be dangerous.

James Collins in his book ‘Good to Great‘ suggests that the research of his team into lastingly successful companies revealed that all of these companies were led by so called ‘Level 5 Leaders‘. These leaders, though highly successful, often shun publicity and always emphasize that it is their team driving the success of the company and not them. They are also very passionate about the success of their company. The main factor which distinguished these ‘Level 5 Leaders’ from celebrity CEOs in the data observed by Collins and his team was that companies of Level 5 Leaders continued to be successful after the leaders left.

Apart from an obvious lack of compassion, this could be another downside of Steve Jobs’ leadership style. Will Apple prevail to be as successful as they have been with Jobs at the helm? In any case, however great a leader Jobs was, I do not think that he is a good role model for future leaders. Since, looking at the descriptions in ‪Isaacson‬’s biography, it appears that some of his success was built on compromising the dignity of subordinates; and dignity, in my point of view, is something that should never be compromised on no matter how ‘great’ the endeavour (as should be the law).

 

Picture Credits: http://en.wikipedia.org/wiki/File:Stevejobs_Macworld2005.jpg

Why the Ideal Task is Necessary, Rewarding and Fun

When it comes to organizing our lives, structured and logical approaches are in no short supply. Divide large projects into small tasks. Prioritize what is more important over what is less so. Identify the critical path of tasks leading most surely to success. All these are activities of the conscious and deliberate mind.

Some psychologist like to call this dimension of our mind System 2. System 2 takes care of conscious reasoning and helps us to think through things logically. As might be implied from the very designation of this system, there is a corresponding System 1. This system is generally responsible for subconscious and automatic activities of our brain; which helps us to drive cars and climb stairs without us having to ‘think’ about it explicitly. Some people also like to call these two aspects of our mind the conscious and the subconscious in a dramatic simplification of scientific terminology.

However, notwithstanding the terminology employed, System 1 and System 2 don’t get very far without each other’s help. If we would be consciously thinking about every action we have to take, we would move as fast as a computer from the 1960s rendering msn.com. If we wouldn’t be consciously thinking about anything … well, no need to think too much about that.

It is concerning then that modern methodologies to organize our work rest firmly on the principles of system 2. Anybody who has employed these systems on any significant scale certainly can relate to the picture of being stuck moving at a speed which feels like it could be so much faster. System 1 is undoubtedly the system with more raw power; even if this power is often not directly available to us. However, there are various ways how we can harness the abilities of system 1 – especially if we speak its language of values and emotions.

Thus, I have a proposal here how we could bring a bit of System 1 into the way we organize our tasks. Specifically, I propose that for every task we need to undertake we assess the following three dimensions:

  • Necessity: Does this task need to be done.
  • Reward: Do I expect that completing this task will feel personally rewarding.
  • Fun: Do I think it will be fun to complete this task.

Depressingly, I have little doubt that many of our To Do items will score heavy on the first dimension, necessity – while being less accentuated for the latter two. All the more reason to think carefully about these dimensions and asses their impact for our well-being and productivity.

Necessity

If we do not do what needs to be done, we won’t progress in life. Increasing the level of necessity of our tasks is an exercise in reduction. Cutting out the tasks which are really not that important to have more time for what really matters. There are many systems available to accomplish this, for instance the very popular Getting Things Done.

Reward

We all had these days were we are running around like crazy all day working on one important matter after the other. Only to be rewarded with the stale feeling at the end of the day that really we haven’t accomplished anything at all. On the other hand, sometimes we do something small and seemingly unimportant – such as sending a short message to our loved one or finally sending off this message to Aunt Mary -, which leave us with a feeling of grand satisfaction with ourselves and our life. A lot of the research in the field of Positive Psychology has looked into the various aspects which moderate what leaves us feeling good and what doesn’t.

To some degree it is our individual preferences which affect how rewarding a task feels. Is family the most important for you in your life? Then picking up your daughter from school will certainly feel rewarding. Do want to become the most successfully mergers and acquisitions lawyer in history. Then putting in another hour for the next big case will feel rewarding without a doubt. However, while we are usually quite good at figuring out which tasks will be necessary and which not when we put our mind to it (that is system 2, of course), we are often complete failures at figuring out what tasks will be truly rewarding. Also, just as necessity is not fixture and can change based on our goals, how rewarding something feels is not unalterable. It depends to a large degree on our attitude towards the task.

Keeping this in mind, I have assembled a few rules of thumb to make the tasks we need to do more rewarding and to figure out ways to identify tasks which are rewarding:

  • Do things for others.
  • Attempt difficult things.
  • Think about how a task relates to your life goals (Surely, there’ll be some connection).

Fun

We are usually quite good at indulging in things which are fun to do. Watching our favourite drama show with a good cold beer, go out drinking and bet on horse races, checking the latest gossip about Aunt Mary on Facebook – the opportunities are endless. Unfortunately, many activities linked to issues of greater import in our life, such as family chores and – behold – work, do not overlap with what we consider fun (the exceptions proving the rule).

Unfortunately, we are not great experts in fun either (that is after passing into the second decade of existence). Since, often what we consider fun in the beginning quickly turns into a habit – until we forgot why we started doing it to begin with (think watching television, drinking and betting on horse races and checking Facebook). Thankfully, how entertaining an activity is not only determined by what we do but also by how we do it. Clearing out the rain gutters just becomes this much more fun if you do it with your best buddy while wearing fish masks.

Thus, here a preliminary short list of ideas how any tasks can become more fun.

  • Do things with others.
  • Do things differently or with different tools.
  • Do new things.
  • Do little things in a weird and stupid way.

You might have guessed the punchline of this article from its subtle title: Key to a successful organization of your tasks is to maximize how necessary, rewarding and fun your tasks are. This would assure you are getting more done while being more productive and altogether more happy.

However, this is easier said than done. Thus, if we cannot find tasks that fall within each of these categories, at least we should try to have a healthy mix of tasks falling within the different categories. For instance, to assure that in a day or week, we have some tasks which are necessary but also some tasks which are fun and rewarding.

 

Get the Exact Position and Size of a Window in Windows

Problem

You would like to know the exact pixel position and size of a window in Microsoft Windows.

Solution

Use the very useful utility Sizer. You can download it for free from the page below:

http://www.brianapps.net/sizer/

I downloaded the portable version (download the Zip Package).

Launch sizer.exe from the extracted zip package.

Then right click the title bar of the window of which you would like to know the position and size.

Select the option Resize/reposition from the context menu. Select ‘New entry …’

Now, you can see the width and height as well as the top and left offset for your window:

Remove Duplicates from Array in CoffeeScript

Problem

You have an array in CoffeeScript, which contains equal elements multiple times such as:

[1,1,2,3,3]

You would like to have only unique values in the array. Thus, transform it into:

[1,2,3]

Solution

You can use the following method to accomplish such:

removeDuplicates = (ar) ->
  if ar.length == 0
    return []  
  res = {}
  res[ar[key]] = ar[key] for key in [0..ar.length-1]
  value for key, value of res

alert(removeDuplicates([1,2,3,3,4,4,5]));

References

This solution is based on this approach (with a few minor issues fixed).