Virtualbox and Linux Mint high CPU

I use VirtualBox a lot. Mostly on Windows 10 host and Linux Mint guest (Ubuntu, Linux Mint 18). And it was always horribly slow no matter what cpu/memory/video acceleration settings I used. If using without “3d hardware acceleration” it was just generally slow but using the hardware acceleration was sometimes glitchy and most of the time very high CPU usage reported in htop. Today I finally found a solution – install MATE desktop interface in the linux virtual machine! Turns out Cinnamon interface that comes default with Linux Mint heavily depends on graphics acceleration and Virtualbox just cant do that even with the Guest Additions Iso. Mate desktop interface uses only CPU and in a very efficient way – finally the Virtualbox virtual machine feels like real OS and is real fast, CPU usage went from 10-80% to 0-1% idling.
To switch Linux Mint from Cinnamon to Mate:
1. open terminal, type “sudp apt-get install mate-desktop”
2. log out of cinnamon
3. on login screen click the upper right corner of login box and choose Mate
4. log in and enjoy!

change ubuntu linux mint from cinnamon to mate
change ubuntu linux mint from cinnamon to mate

Install Windows XP/Vista/7 from USB memory stick

Today I got myself a new desktop PC. Since I had a lot of hard drives and a few CD/DVD roms, I ordered a PC setup with smallest HDD available and skipped DVD/RW drive. Once I got the PC I found out the Gigabyte motherboard had no IDE ports. So I searched for alternate installation methods of Windows. I had tried installing from uSB flash drive before but didn’t succeed, the methods were too complicated and with lots of issues. Today I found a nice utility – Novicorp WinToFlash – and it works like a charm!
Dowload here: http://wintoflash.com/
Install WinToFlash, select folder or CD drive where your windows installation files are and create thumb drive with a few clicks. Plug your USB drive in the destination PC, choose “Text mode” on first attempt, install, then choose “GUI mode / continue setup / 1st start” on two next boots. Done!

UPDATE: It’s been a few years and I’ve found even easier tool – Rufus. It comes in portable package as well (just download and run) and while i had no success with another software to install live cd on micro-sd card (inside usb sd adapter), Rufus installed linux (Mint and kubuntu) fast and easy!

Google Chrome proxy password change

Just had a very irritating problem at work. Since I changed my corporate windows network password (it’s a must on regular basis) I need to use the new password for web browser proxy servers. AFAIK the Google Chrome browser was asking for credentials when I installed it. I probably checked “save password” because it never shows up again. Now after changing my windows password Google Chrome wouldnt work – it just shows “This webpage is not available.” for every page or tab. I tried disabling/enabling proxy, used “chrome://net-internals/#tests” to check whats wrong and in the EVENTS section i found that PROXY_AUTH was returning “Access Denied” so I knew it was the new password that didn’t work. After long trial&error tinkering and googling, this is what worked for me:
1. for the Google Chrome shortcut Right-Click (in Windows) and click Properties.
2. Find the Target section (it should end with ..chrome.exe” )
3. append to Target: “–proxy-server=PROXY-SERVER-IP:PORT”
4. it should end like this: \Google\Chrome\Application\chrome.exe” “–proxy-server=10.10.2.2:3128” (example ip)
Thats it! Worked for me, it even didn’t ask for the new password!

P.S. My blog had some malware in the wordpress installation so it was blocked for some time.

Wrong monthly balance in Google Adsense

Currently a lot of users are confused – Google Adsense monthly balance shows more money than you receive in next month`s payment. When payment is issued you probably wonder “ok, maybe the rest of the money will be paid some time later”. But it won`t happen. You might see something like this:

Balance at end of April €223.74
May 24 Payment issued (€98.10)

There is a problem in Google Adsense payments page and they`re trying to fix it. The montly balance is shown incorrectly. To show correct values – go to payments page and change the “view: Last 3 months” dropdown to “View: All time“. Now you should see tha real monthly balance at the end of each month, unfortunately it`s smaller than you hoped ;)

Drupal error fix: Fatal error: Unsupported operand types in ../common.inc on line 1426

If you`re using drupal, you might encounter this error, when upgrading to Drupal 6.16:
Fatal error: Unsupported operand types in path_to_drupal/includes/common.inc on line 1426
It happened to me when I tried to create a node that is unpublished (“Published” checkbox is unchecked) or trying to unpublish a published node.
There various modules that conflict with the 6.16 drupal core common.inc file which is changed in 6.16.
This is a fast fix of core file and it works for me.
Open up the includes/common.inc file, search for:

function url($path = NULL, $options = array()) {

(around line 1418)

Replace this code:

$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => ''
);

with this:

if (!is_array($options)) {
$options = array();
$args = func_get_args();
if (isset($args[1])) $options['query'] = $args[1];
if (isset($args[2])) $options['fragment'] = $args[2];
if (isset($args[3])) $options['absolute'] = $args[3];
}

Search for this line:
function l($text, $path, $options = array()) {

Replace code:

$options += array(
'attributes' => array(),
'html' => FALSE,
);

with:

if (!is_array($options)) {
$options = array();
$args = func_get_args();
if (isset($args[2])) $options['attributes'] = $args[2];
if (isset($args[3])) $options['query'] = $args[3];
if (isset($args[4])) $options['fragment'] = $args[4];
if (isset($args[5])) $options['absolute'] = $args[5];
if (isset($args[6])) $options['html'] = $args[6];
}

Save the common.inc file, you should be done!
Tell me if it worked for you!

Add or remove trailing slash in URL with .htaccess

If you`re using some kind of CMS, usually its normal that each URL works with or without trailing slash, e.g. these URLs would be the same:
http://example.org/about
http://example.org/about/

Still Google, Yahoo, MSN and other search engines treat them as different urls and gives penalty as they are dupliate URLs with identical content.
You have two options – to add or to remove the trailing slash. After a bit of reading I chose to remove the slash from my celica site, because I`m using Drupal CMS that removes trailing slashes for new content and I don`t really want to hack the CMS plugins. To alter the URLs, you need to edit .htaccess file at the root directory of your website ( http://example.org/.htaccess )
Add this code to your .htaccess file to remove trailing slashes:

#get rid of trailing slashes
RewriteCond %{HTTP_HOST} ^(www.)?turbocelica\.lv$ [NC]
RewriteRule ^(.+)/$ http://www.turbocelica.lv/$1 [R=301,L]

or use this code to ADD trailing slash to the end of each URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)([^/])$ http://example.org/$1$2/ [R=301,L]

Make sure you backup your .htaccess file before you edit. It`s easy to get “500 Internal server error” if you don`t know what you`re doing ;)
Read more here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Flash player 9, 10 – security policy file

I encountered problems for last 6 months to upload music on my dj site – www.djnet.lv . I have flash CMS admin on djnet.lv but the songs are uploaded to other site of mine, where HDD space is not a problem. about half year ago I couldnt upload songs from some computers, now its from all computers. It just stops. I had suspicion it had something to do with new Flash Player versions 9 and 10. So today I fixed it just by uploading simple file to my file hosting server: crossdomain.xml.
Flash player always looks for domain.com/crossdomain.xml file when it accesses its contents or uploads something. The is what my security policy file contains:









How to: Cubase problem – no sound output

This might be also useful for other digital audio workstations like Cakewalk Sonar, M-Audio Pro Tools or Adobe Audition. Maybe not.
I tried Cubase (portable version) on my work computer and couldn`t get any sound output. It actually didn`t show any device under VST output devices. Since it`s some basic integrated sound card, it hasn`t ASIO drivers natively, probably. Solution is rather simple – install ASIO4ALL – http://www.asio4all.com/. done :)

Windows Movie Maker crashes and hangs

WMM2 does crash terribly on a new pc. If you`re experiencing crashes every 2 minutes using Windows Movie Maker 2, try disabling codecs. Go to Tools > Options > Compatability. Try unchecking a few codecs, especially “Avisplitter”. It worked for me!
If you cannot solve the crashing, try this page: http://www.papajohn.org/MM2-Issues-Acceleration-and-Codecs.html

How to: Disable new user registration in Drupal

How to: Disable new user registration in DrupalAfter a quick search I didn`t find how to simply switch off new user registration in Drupal. But it has even better feature – access roles. You can specify what usernames/emails/hostnames can access the members area or even register as user.
To disable new user registration, you have to add access rules for existing users. Go to yoursite.com/admin/user/rules/ and add a new rule. For example, first add an allow rule for user “admin“. Then for other existing users. After you have finished, add a deny rule and write “%” in the username field. This will allow to login only the allowed usernames and deny everything else. If the username is not defined it cannot be also registered.
You can even make private site and say to your friends add e.g. “-foo” to their usernames. So you make an allow rule with “%-foo” in username field.
The reason I need to block new user registration is spam. New users register everyday with random spam usernames.