Access Apache on VirtualBox OS from Host OS

Problem

You have a RHEL or CentOS 6 VirtualBox Virtual Machine and a Windows or other host and would like to access a web server on the VM from the Host OS.

Solution

Assure that the Apache Web Server is available and started on the guest OS:

`sudo httpd start`

Assure that firewall allows the guest OS to handle web requests.

Type ` sudo system-config-firewall` and enable the WWW service.

Configure port forwarding for the VM. Go to the VM settings in the Oracle VM VirtualBox Manager / Page ‘Network’.

Click on the button [Port Forwarding] and add an entry such as the following:

Now, on your host OS, you should be able to see the Apache Server test page when opening `http://localhost:8080` in a browser.

Troubleshooting

Since every system is configured differently there might be some problems you encounter. If you don’t see the test page, you could try the following:

  • Disable SELinux by opening the file ` /etc/selinux/config` and setting the configuration to ` SELINUX=disabled` (see a more detailed guide here)
  • This tutorial assumes that you use the default NAT network adapter for you VM. If you use a ‘host-only’ or ‘bridged’ connection, the process will be a bit different.

References

Stackoverflow – How to SSH to a VirtualBox guest externally through a host? Very helpful, also read the comments

Stackoverflow – Apache restart causes DocumentRoot must be a directory, even though it is a directory and there seem to be no privilege issues

CentOS Board – Basic firewall config (just port 80 and ssh 22)

 

Import GitHub project to Android Studio

Problem

You have an existing GitHub project and would like to import it to Android Studio.

Solution

Perform the following steps to import your project.

Step 1: Install git for Windows

It can be downloaded for free from git-scm.com.

Most settings available during the installation process should be compatible with Android studio. Just choose the settings you deem the most appropriate.

Step 2: Link git executable to Android Studio

Open Android Studio and got to Settings. In the Setting dialog open the page Version Control / Git. Here define the path to the git executable you have just installed.

Step 3: Get the Path to your Repository from Github

Go to the GitHub page and get the HTTPs path to your repository. For instance:

https://github.com/mxro/WallOfTheWiseAndroid.git

Step 4: Import the Git project to Android Studio

Go to Android Studio and go to Menu / VCS / Checkout from Version Control / Git

Paste the HTTPS path you obtained from GitHub in the previous step and click on [Clone].

Provide your GitHub username and password.

Now the project should be imported to Android Studio and you should be able to commit and push future changes back to GitHub.

References

Android Studio Git Tutorial (Part 1) « Wii’s Blog

github – How to clone a remote git repository with Android Studio? – Stack Overflow

Setup Android Developer Studio | devroyal.de

Setting Up eclipse Luna with Maven for Android

As of August 2014, don’t even try this.

Officially, the Google Eclipse plugin supports Eclipse 4.4 (Luna) at present. However, in order to be able to create projects which are both Maven projects and Android projects you will need to install the m2e-android plugin. This currently does not support eclipse Luna. Probably, if you create a new Android project based on the archetype suggested by the m2e-android plugin, you might get errors such as:

  • …R cannot be resolved to a variable
  • Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (execution: default-generate-sources, phase: generate-sources)
  • Project configurator “me.gladwell.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator” is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration.
  • Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:proguard (execution: default-proguard, phase: process-classes)

My recommendation is to use Android Studio.

You can easily add Maven dependencies to projects in Android Studio. Just locate the ‘build.gradle’ file in your application directory and add a compile dependency.

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