Archive

Archive for August, 2012

Start vuze with Java 7

August 22, 2012 Leave a comment

Problem
I installed Oracle Java 7 to /opt/java. When I start vuze and check Help -> About, it says it is still using Java 6. Hmm…

Solution
Edit the vuze launch script:

JAVA_PROGRAM_DIR="/opt/java/bin/"    # Add the trailing slash!
Categories: java Tags: ,

Auto Login to Windows 7

August 8, 2012 Leave a comment

Problem
I have a Windows 7 in VirtualBox. When I launch it, I don’t want to spend time with logging in. How to skip this step?

Solution
I found the solution here.

In short: launch netplwiz, in the Users tab, uncheck the box next to “Users must enter a user name and password to use this computer”, press Apply, provide the password, then OK, OK.

Categories: windows Tags: ,

Insert syntax highlighted source in Powerpoint

August 7, 2012 Leave a comment

Problem
You want to have syntax highlighted source in Powerpoint.

Solution
First, create an RTF file from the source:

pygmentize -f rtf -o hello.rtf hello.py

Open the RTF file in Word, select the source, then insert it in Powerpoint.

I made a basic script to automate the conversion. Usage:

py2rtf hello.py

The script is available here.

Update (20131030)
What if you want to insert colorized code in HTML?

$ pygmentize -f html -o index.html color_me.py
$ pygmentize -f html -S default >style.css

The parameter of -S (here: default) is the name of the color scheme. Available color schemes:

>>> from pygments.styles import get_all_styles
>>> list(get_all_styles())
['monokai', 'manni', 'rrt', 'perldoc', 'borland', 'colorful', 'default', 'murphy', 'vs', 'trac', 'tango', 'fruity', 'autumn', 'bw', 'emacs', 'vim', 'pastie', 'friendly', 'native']

Then include style.css in index.html:

<head>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>

repl.it

August 7, 2012 Leave a comment

The repl.it project is an attempt to create an online environment for interactively exploring programming languages. It provides a fully-featured terminal emulator and code editor, powered by interpreter engines for more than 15 languages.

All our interpreters are written in (or compiled to) JavaScript, and run completely on the user’s device, regardless or whether it’s a desktop, laptop or phone.” (source)

FAQ here. And yes, they have Python.

Categories: web Tags:

Increase the size of a Virtualbox hard drive (.vdi)

August 3, 2012 Leave a comment

The following entry is based on this post.

Problem
I have a Linux host with a Windows 7 guest. The hard disk of the Windows guest was set to 30 GB but it got full. How could I extend its size to 40 GB for instance?

Solution
Locate the .vdi file of the virtual system. To be safe, make a backup copy of it. After that you can increase its size:

sudo VBoxManage modifyhd Windows7.vdi --resize 40000

Here Windows7.vdi is the name of my .vdi file and 40000 is given in megabytes, which is roughly 40 GB.

Now, if you boot the system and you verify the size of the C: drive, it will still be the old value. The increased size appears as a new unformatted and unused partition. You can join it with the C: partition the following way:

Go to the Control Panel, then System and Security, then Administrative Tools. Here you will see an icon called Computer Management. Start it. Choose Disk Management on the left side. Right click on drive C: and choose “extend volume“. It will be extended in a second. Done.

Update (20140427)
You can also start the Disk Management tool with the command diskmgmt.msc .

Categories: windows Tags: ,

Powerpoint to PDF

August 2, 2012 Leave a comment

I just discovered that Microsoft Powerpoint 2007 supports PDF export. By default this plugin is not installed. Click on the Office button, and under Save as... there will be a menu point about exporting to PDF and XPS. Click on it and you will be redirected to a help file from where you can visit a download page of this export plugin. Once installed, this feature is available under Save as…

Outlook.com

August 2, 2012 Leave a comment
Categories: Uncategorized Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 72 other followers