<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>The Standard Output (debian)</title><link>http://thestandardoutput.com/</link><description></description><atom:link href="http://thestandardoutput.com/tag/debian.xml" type="application/rss+xml" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 12 Oct 2015 07:59:00 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Debian: Install Packages that were Kept Back</title><link>http://thestandardoutput.com/posts/debian-install-packages-that-were-kept-back/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Have you ever seen this message when updating your Debian-based system: &lt;em&gt;"The
following packages have been kept back"?&lt;/em&gt; Here's why you see it and how to solve
it:&lt;/p&gt;
&lt;p&gt;You just tried to run the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt-get upgrade --show-upgraded -y
&lt;/pre&gt;


&lt;p&gt;... and you get the message:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;The following packages have been kept back
&lt;/pre&gt;


&lt;p&gt;Running &lt;code&gt;apt-get dist-upgrade&lt;/code&gt; is dangerous for a stable environment. The wrong
&lt;code&gt;source.list&lt;/code&gt; setting and you end up with a broken Debian. You might get the
entire application upgraded to a version you don't want. For example, the kernel
upgrade is kept back. You just want to upgrade the kernel, not the entire
distribution.&lt;/p&gt;
&lt;p&gt;A better way to handle a &lt;em&gt;kept back&lt;/em&gt; package is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;sudo aptitude&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If you have kept back package you should see Upgradable Packages on top of
   the list.&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;+&lt;/code&gt; on that list&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;g&lt;/code&gt; twice&lt;/li&gt;
&lt;li&gt;Answer debconf stuff if asked&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;return&lt;/code&gt; to continue&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Q&lt;/code&gt; to quit&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;yes&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;em&gt;kept back&lt;/em&gt; packages are now installed.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>package</category><guid>http://thestandardoutput.com/posts/debian-install-packages-that-were-kept-back/</guid><pubDate>Wed, 03 Dec 2014 02:56:53 GMT</pubDate></item><item><title>Quick Ref: Python Virtualenv use</title><link>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Supposing you have a clean install of a Debian-based distro such as Debian 7
proper or Xubuntu 14.04, this notes will walk you through setting up a Python
development environment where you can leverage the power of Virtualenv through
Virtualenvwrapper.&lt;/p&gt;
&lt;h3&gt;Why virtualenv?&lt;/h3&gt;
&lt;p&gt;When you code in python you will quickly find out that different projects have
different requirements for the python version you need to use and also the
versions of libraries you need to use. Virtualenv will allow you to
compartmentalize the requirements on a per project basis without making you
install libraries and python versions globally or system-wide.&lt;/p&gt;
&lt;h3&gt;Ok, ok... Here are the goods...&lt;/h3&gt;
&lt;p&gt;You have your new shinny install of Debian which comes with a fairly recent
version of python pre-installed (somewhere above 2.7.3). Now you need to install
a package manager for python and the one I use is pip.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install python-pip
&lt;/pre&gt;


&lt;p&gt;Once you have pip installed, you will need to also install virtualenv, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo pip install virtualenvwrapper
&lt;/pre&gt;


&lt;p&gt;Virtualenvwrapper is a very nice layer on top of virtualenv that makes working
with it much more intuitive and convenient.&lt;/p&gt;
&lt;p&gt;Next, you may want to automate a couple of things like I did. First, create a
&lt;code&gt;~/.virtualenvs&lt;/code&gt; directory. This is where virtualenvwrapper will keep track of
your environments. Then open you &lt;code&gt;.bashrc&lt;/code&gt; file and add a few lines to it:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;export WORKON_HOME=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="x"&gt;/.virtualenvs&lt;/span&gt;
&lt;span class="x"&gt;if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then&lt;/span&gt;
&lt;span class="x"&gt;    . /usr/local/bin/virtualenvwrapper_lazy.sh&lt;/span&gt;
&lt;span class="x"&gt;fi&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now you are ready to start working, so open a new terminal, setup a virtual
environment, and start cranking out some python code. Here's a quick reference
for virtualenvwrapper:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start new virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Leave the current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;deactivate&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List all available virtual environments?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lsvirtualenv -b&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter an existing virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List packages installed in current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pip freeze&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remove a virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rmvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start a virtual environment with specific python version?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name] -p /usr/bin/python3.4&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;[env-name]&lt;/code&gt; above with your actual environment name and enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</guid><pubDate>Fri, 06 Jun 2014 07:55:33 GMT</pubDate></item><item><title>Running XFCE 4.10 on Debian 7.4</title><link>http://thestandardoutput.com/posts/running-xfce-410-on-debian-74/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The Debian 7 series (a.k.a. Wheezy or stable) repositories are currently serving
the &lt;code&gt;xfce4&lt;/code&gt; package at version 4.8 and the upgrade to XFCE 4.10 series is not
slated to occur until the next major version relase, known as Jessie or testing
currently. But I want to use XFCE 4.10 now...&lt;/p&gt;
&lt;p&gt;Luckly, there is a way for me to pick and choose certain packages from
different Debian repositories, while still maintaining proper dependencies. So,
here's how I installed it on Debian 7:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First I installed the latest Debian stable with a default XFCE desktop. This
    is version 7.4 at the time of this writing. I got it
    &lt;a href="http://cdimage.debian.org/debian-cd/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-xfce-CD-1.iso"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I installed it with the Desktop, SSH, and Base System options checked.&lt;/li&gt;
&lt;li&gt;Next I booted the new Debian 7 system and logged in. I had a default Debian
    install with XFCE 4.8 desktop.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next I edited my &lt;code&gt;sources.list&lt;/code&gt; file like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo &amp;lt;editor-of-choice&amp;gt; /etc/apt/sources.list
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;And inserted the following repository at the bottom of the &lt;code&gt;sources.list&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;deb&lt;/span&gt; &lt;span class="s"&gt;http://ftp.us.debian.org/debian/&lt;/span&gt; &lt;span class="kp"&gt;testing&lt;/span&gt; &lt;span class="kp"&gt;main&lt;/span&gt;
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I also had to ensure that the default release in the Apt system remained
    configured to use &lt;code&gt;wheezy&lt;/code&gt;. I created a file like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo &amp;lt;editor-of-choice&amp;gt; /etc/apt/apt.conf.d/30default-release
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In that file I inserted the following directive:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nt"&gt;APT&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;:Default-Release&lt;/span&gt; &lt;span class="s2"&gt;"wheezy"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I saved and closed the files above and then ran the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get update
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then I was able to install XFCE 4.10 by issuing the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get -t testing install xfce4 xfce4-terminal
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Recap&lt;/h3&gt;
&lt;p&gt;This is what I have done so far: I installed Debian 7 with the default XFCE 4.8
desktop. I edited the &lt;code&gt;sources.list&lt;/code&gt; file to add a reference to the Debian
testing repository. I made sure that the default Apt repository remained the
stable one. Then I updated the Apt system and installed XFCE 4.10 from testing.
Note that with the &lt;code&gt;-t&lt;/code&gt; option, &lt;code&gt;apt&lt;/code&gt; will track the package in the given
release until the package version or newer is available in default release.&lt;/p&gt;
&lt;h3&gt;Let's Make it Look Better&lt;/h3&gt;
&lt;p&gt;At this point, I logged out and then back in and I had the new XFCE 4.10 desktop
available. But that's not quite enough. I wanted to make it look better by
installing a good looking theme. My personal favorite theme for XFCE is
&lt;a href="http://shimmerproject.org/project/greybird/"&gt;Greybird&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let's dispense with the fluff and get down to just the stuff:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install gtk-engine-murrine
mkdir ~/.themes
cd ~/Downloads/
git clone https://github.com/shimmerproject/Greybird
cp -R Greybird ~/.themes
&lt;/pre&gt;


&lt;p&gt;Then I used XFCE &lt;em&gt;Settings Manager&lt;/em&gt; to set the &lt;em&gt;Appearance&lt;/em&gt; and the &lt;em&gt;Window
Manager&lt;/em&gt; settings to use the new Greybird theme.&lt;/p&gt;
&lt;p&gt;I also installed the Faenza icon theme:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;mkdir ~/Downloads/faenza
cd ~/Downloads/faenza
wget http://faenza-icon-theme.googlecode.com/files/faenza-icon-theme_1.3.zip
unzip faenza-icon-theme_1.3.zip
sudo ./INSTALL
&lt;/pre&gt;


&lt;p&gt;Running as sudo will install the theme globally in &lt;code&gt;/usr/share/icons&lt;/code&gt;. Also
ensure that the permissions on the Faenza folders under &lt;code&gt;/usr/share/icons&lt;/code&gt; is
properly set to &lt;code&gt;drwxr-xr-x&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That's it... Enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>xfce4</category><guid>http://thestandardoutput.com/posts/running-xfce-410-on-debian-74/</guid><pubDate>Sun, 16 Feb 2014 00:15:26 GMT</pubDate></item><item><title>Connecting to a Cisco VPN from Linux</title><link>http://thestandardoutput.com/posts/connecting-to-a-cisco-vpn-from-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The folks at the new job are running a Cisco VPN. While it's very straight
forward to connect using the AnyConnect client from Windows, the steps to do it
in Linux are not so clear cut, because the AnyConnect client for Linux
constantly drops the connection for me and won't hold it for more than 30
seconds. So, this is how you do it from a Debian-based Linux:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the "network-manager-openconnect-gnome" package&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install network-manager-openconnect-gnome
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open the Network Manager applet from the task bar&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Click on VPN Connections&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click Configure VPN...&lt;/p&gt;
&lt;p&gt;&lt;img alt="Connection Manager" src="http://farm4.staticflickr.com/3809/11579146506_34832851d9_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the Add button&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VPN Connection Type should be Cisco AnyConnect Compatible VPN&lt;/p&gt;
&lt;p&gt;&lt;img alt="Edit VPN" src="http://farm6.staticflickr.com/5534/11578352075_b07319b0b6_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a name for your connection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Enter a value for the Gateway (IP or Host Name)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click Save&lt;/p&gt;
&lt;p&gt;&lt;img alt="VPN Connection Type" src="http://farm8.staticflickr.com/7300/11579146496_459710e377_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then go back to the Network Manager applet on the task bar&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Select VPN Connections and then select the one you just created&lt;/li&gt;
&lt;li&gt;On the Connect to VPN dialog, choose the VPN host and&lt;/li&gt;
&lt;li&gt;Click the Conect button&lt;/li&gt;
&lt;li&gt;Enter your Username and Password&lt;/li&gt;
&lt;li&gt;Lastly, click Login&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This approach has been working really well and reliably for me and I hope it
will for you too.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/connecting-to-a-cisco-vpn-from-linux/</guid><pubDate>Fri, 27 Dec 2013 06:15:00 GMT</pubDate></item><item><title>Manage your PostgreSQL Database from a Remote Machine</title><link>http://thestandardoutput.com/posts/manage-your-postgresql-database-from-a-remote-machine/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;At home I have my main development workstation and then I spin up VMs that mimic
my production environment to run different types of integration tests. One of
these VMs is running a relatively recent version of PostgreSQL. By default,
PostgreSQL is setup to allow connections coming from the local host only. In
this article I will walk through the steps of setting up PostgreSQL so that it
allows connections from other machines also.&lt;/p&gt;
&lt;h3&gt;Setup Remote Connections&lt;/h3&gt;
&lt;p&gt;There are, essentially, two lines in two different PostgreSQL configuration
files that need to be changed to allow remote connections to work.  The first
file is &lt;code&gt;postgresql.conf&lt;/code&gt; and this is usually found at
&lt;code&gt;/etc/postgresql/9.1/main/&lt;/code&gt; on Debian-based systems. Open that file and find the
line that starts with &lt;code&gt;listen_addresses&lt;/code&gt;. By default the value assigned to it
should be &lt;code&gt;'localhost'&lt;/code&gt;. Change that so the line reads like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;listen_addresses = '*'
&lt;/pre&gt;


&lt;p&gt;The second file is called &lt;code&gt;pg_hba.conf&lt;/code&gt;. In this file you need to look for a
IPv4 local connections line that starts with &lt;code&gt;host&lt;/code&gt;. By default, the line reads
the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;host    all             all             127.0.0.1/32            md5
&lt;/pre&gt;


&lt;p&gt;You need to change this line to read like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;host    all             all             10.0.0.0/24             trust
&lt;/pre&gt;


&lt;p&gt;For all intents and purposes, the default is telling PostgreSQL to accept
connections only from the localhost (that's what the &lt;code&gt;/32&lt;/code&gt; is for), while we are
changing the value to allow any host with an IP starting with 10.0.0.* to
connect. The above will only work after you restart PostgreSQL with the
following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo /etc/init.d/postgresql restart
&lt;/pre&gt;


&lt;p&gt;Again, YMMV if you are using anything other than Debian.&lt;/p&gt;
&lt;h3&gt;Allowing Connections Through a Firewall&lt;/h3&gt;
&lt;p&gt;The above is really all you have to do with PostgreSQL proper to allow remote
connections. But if you are like me, you are probably running a firewall on your
systems also and you will need to punch a whole for PostgreSQL to talk through.
You can find out more about how I setup my IPTables firewall by
&lt;a href="http://gorauskas.org/SecuringYourDebianBasedVM.html" title="Securing your Debian-based VM"&gt;reading this&lt;/a&gt;. In my case, I need to allow only one system (my
workstation) to connect to the VM hosting PostgreSQL. I created the following
lines in my IPTables configuration file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;# Allow connections to Postgres DB Server from hurricane
-A INPUT -p tcp -s 10.0.0.90 --sport 1024:65535 -d 10.0.0.60 --dport 5432 \
         -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -s 10.0.0.60 --sport 5432 -d 10.0.0.90 --dport 1024:65535 \
         -m state --state ESTABLISHED -j ACCEPT
&lt;/pre&gt;


&lt;p&gt;In the above, the first line allows traffic on port 5432 into the local system
from the &lt;code&gt;10.0.0.90&lt;/code&gt; IP address, which is my development workstation. The second
line allows the local system to send traffic out via port 5432, which is the
default port used by PostgreSQL.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;To allow remote connections to your PostgreSQL instance, all you have to do is
edit &lt;code&gt;postgresql.conf&lt;/code&gt; and &lt;code&gt;pg_hba.conf&lt;/code&gt;. Also remember to address firewall
configuration issues that may arise.&lt;/p&gt;&lt;/div&gt;</description><category>database</category><category>debian</category><category>linux</category><category>postgresql</category><guid>http://thestandardoutput.com/posts/manage-your-postgresql-database-from-a-remote-machine/</guid><pubDate>Fri, 29 Nov 2013 05:56:11 GMT</pubDate></item><item><title>Resume interrupted downloads with cURL in Linux</title><link>http://thestandardoutput.com/posts/resume-interrupted-downloads-with-curl-in-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I have recently been trying to download an ISO of a certain Linux distro, but I
find myself at the wrong end of a crappy connection. I tried downloading it with
both Firefox and Chrome but both choked very early in the process and current
speed would go down to 0 and after a while the connection would just cutoff with
no way to resume the download from where I left off.&lt;/p&gt;
&lt;p&gt;Fear not because [cURL][curl] comes to the rescue. After typing &lt;code&gt;Up-Arrow&lt;/code&gt; and
&lt;code&gt;Enter&lt;/code&gt; more time than I care to admit, I decided to let the computer do the
hard work and automate this thing. So I created a small Bash script called
&lt;code&gt;acurl.sh&lt;/code&gt; (for Automated cURL) that looks like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;export ec=1;&lt;/span&gt;

&lt;span class="x"&gt;while [ &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ec&lt;/span&gt;&lt;span class="x"&gt; -gt 0 ]; do&lt;/span&gt;
&lt;span class="x"&gt;    /usr/bin/curl -O -C - &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;1;&lt;/span&gt;
&lt;span class="x"&gt;    export ec=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;?;&lt;/span&gt;
&lt;span class="x"&gt;done&lt;/span&gt;

&lt;span class="x"&gt;if [ &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ec&lt;/span&gt;&lt;span class="x"&gt; -eq 0 ]; then&lt;/span&gt;
&lt;span class="x"&gt;    echo "Downloaded &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;1";&lt;/span&gt;
&lt;span class="x"&gt;fi&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;What's going on above is that I have a while loop that is checking the exit code
of &lt;code&gt;curl&lt;/code&gt;. This exit code is captured by assigning the value of &lt;code&gt;$?&lt;/code&gt; to the
variable &lt;code&gt;$ec&lt;/code&gt;. If &lt;code&gt;curl&lt;/code&gt; exit code is larger than 0 then continue trying to
download the file, which is represented by parameter &lt;code&gt;$1&lt;/code&gt;, from where we left
off, which is accomplished by passing the parameter &lt;code&gt;-C&lt;/code&gt; to &lt;code&gt;curl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Assuming that the script above is located somewhere in the &lt;code&gt;$PATH&lt;/code&gt;, then using
it is as simple as this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;acurl.sh http://distrodomain.org/downloads/linux-distro-version-platform.iso
&lt;/pre&gt;


&lt;p&gt;This is definitely a brute force approach, but it does the work.&lt;/p&gt;
&lt;p&gt;[curl]: http://curl.haxx.se/ "cURL"&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>programming</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/resume-interrupted-downloads-with-curl-in-linux/</guid><pubDate>Mon, 14 Oct 2013 04:59:23 GMT</pubDate></item><item><title>How to Change the Default Browser in Xubuntu</title><link>http://thestandardoutput.com/posts/how-to-change-the-default-browser-in-xubuntu/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I am using Xubuntu 12.04 on my main workstation at home and for the longest time
I have been trying to make Google Chrome my default browser on that
machine. I've tried several things that didn't work or worked but would not
persist when I rebooted the machine. Well, that changed just recently...&lt;/p&gt;
&lt;p&gt;Recently I found out that there is a configuration file at
&lt;code&gt;~/.local/share/applications/mimeapps.list&lt;/code&gt; that you can change and make it
stick. Just replace all references to &lt;code&gt;firefox.desktop&lt;/code&gt; with
&lt;code&gt;google-chrome.desktop&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here are the relevant current values:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[Added Associations]&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/http&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;exo-web-browser.desktop;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/https&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;exo-web-browser.desktop;google-chrome.desktop;&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/ftp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/chrome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;text/html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-htm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-shtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/xhtml+xml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xhtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xht&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;

&lt;span class="k"&gt;[Default Applications]&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;application/x-mimearchive&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/http&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/https&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/ftp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/chrome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;text/html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-htm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-shtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/xhtml+xml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xhtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xht&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;The &lt;code&gt;...&lt;/code&gt; above means that I omitted 1 or more lines for brevity. Hope this
works for you too.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/how-to-change-the-default-browser-in-xubuntu/</guid><pubDate>Sun, 13 Oct 2013 03:38:00 GMT</pubDate></item><item><title>Burn an ISO to a USB stick</title><link>http://thestandardoutput.com/posts/burn-an-iso-to-a-usb-stick/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Several of the Debian CD and Debian Live images are created using isohybrid
technology, which means that they may be used in two different ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They may be written to CD/DVD and used as normal for CD/DVD booting.&lt;/li&gt;
&lt;li&gt;They may be written to USB flash drives, bootable directly from the BIOS of
  most PCs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The most common way to copy an image to a USB flash drive is to use the dd
command on a Linux machine:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dd if=file.iso of=/dev/device bs=4M; sync
&lt;/pre&gt;


&lt;p&gt;where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;file.iso&lt;/code&gt; is the name of the input image, e.g. netinst.iso&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/dev/device&lt;/code&gt; is the device matching the USB flash drive, e.g. /dev/sda,
  /dev/sdb. Be careful to make sure you have the right device name, as this
  command is capable of writing over your hard disk just as easily if you get
  the wrong one!&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bs=4M&lt;/code&gt; tells dd to read/write in 4 megabyte chunks for better performance;
  the default is 512 bytes, which will be much slower&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sync&lt;/code&gt; is to make sure that all the writes are flushed out before the
  command returns.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/burn-an-iso-to-a-usb-stick/</guid><pubDate>Fri, 11 Oct 2013 07:20:26 GMT</pubDate></item><item><title>Install the Real Firefox on Debian 7</title><link>http://thestandardoutput.com/posts/install-the-real-firefox-on-debian-7/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;If you have ever played around with the Debian distribution proper, you will
quickly notice that Firefox is not available as a browser and in its place is
something called IceWeasel. Here I will show you how to install the real Firefox
browser on Debian 7.&lt;/p&gt;
&lt;p&gt;The first step is to remove the IceWeasel package if it's installed:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get remove iceweasel
&lt;/pre&gt;


&lt;p&gt;Next, we will make use of a Linux Mint package repository that targets Debian
proper. To do this add the following line to you &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;deb&lt;/span&gt; &lt;span class="s"&gt;http://packages.linuxmint.com&lt;/span&gt; &lt;span class="kp"&gt;debian&lt;/span&gt; &lt;span class="kp"&gt;import&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now when you update your package list you will see an error like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get update
... a ton of output ...
W: GPG error: http://packages.linuxmint.com debian Release: The following
signatures couldn&lt;span class="err"&gt;'&lt;/span&gt;t be verified because the public key is not available:
NO_PUBKEY 3EE67F3D0FF405B2
&lt;/pre&gt;


&lt;p&gt;This happens because you don't have the proper key for the Linux Mint
repository. To get a valid PGP key do the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gpg --keyserver pgp.mit.edu --recv-keys 3EE67F3D0FF405B2
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gpg --export 3EE67F3D0FF405B2 &amp;gt; 3EE67F3D0FF405B2.gpg
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-key add ./3EE67F3D0FF405B2.gpg
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo rm ./3EE67F3D0FF405B2.gpg
&lt;/pre&gt;


&lt;p&gt;Now you should be able to update the package list successfully. Then what's left
to do is to install firefox and you can do that like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install firefox firefox-l10n-en-us
&lt;/pre&gt;


&lt;p&gt;Enjoy firefox!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/install-the-real-firefox-on-debian-7/</guid><pubDate>Sun, 02 Jun 2013 09:35:22 GMT</pubDate></item><item><title>Grepping Multiple Files Recursively</title><link>http://thestandardoutput.com/posts/grepping-multiple-files-recursively/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Recently I was faced with the task of looking for the occurences of a variable
name in all files in a directory recursively. Here is a quick bash incantation
that accomplishes that:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;find . -type f -print0 &lt;span class="p"&gt;|&lt;/span&gt; xargs -0 grep -l variable-name
&lt;/pre&gt;


&lt;p&gt;The above can be understood better if we break it down at the pipe character. To
the left of the pipe we use the &lt;code&gt;find&lt;/code&gt; command to generate a list of file names
recursively starting at the current directory. We use &lt;code&gt;find&lt;/code&gt; with the &lt;code&gt;-print0&lt;/code&gt;
action because we are passing the output to another program via a pipe and this
way the list of file names come out delimited by a null character. Next, we feed
the output of &lt;code&gt;find&lt;/code&gt; to the input of &lt;code&gt;xargs&lt;/code&gt; which will split the long list of
file names into sublists and calls &lt;code&gt;grep&lt;/code&gt; once for every sublist. The &lt;code&gt;grep&lt;/code&gt;
command then filters the list of file names and returns only the ones that
contain the &lt;code&gt;variable-name&lt;/code&gt; string in them.&lt;/p&gt;
&lt;p&gt;Pretty cool, eh?&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/grepping-multiple-files-recursively/</guid><pubDate>Thu, 18 Apr 2013 04:26:25 GMT</pubDate></item><item><title>Dependency error when trying to install Dropbox on Debian 6 (Squeeze)</title><link>http://thestandardoutput.com/posts/dependency-error-when-trying-to-install-dropbox-on-debian-6-squeeze/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I use &lt;a href="https://www.dropbox.com/"&gt;Dropbox&lt;/a&gt; on all of my systems and while not
very secure, Dropbox is a quick and easy way to backup and share files. I
recently rebuilt a machine with Debian 6 to use it as a test server for some of
the work I am doing on some web apps and when I tried to install the .deb
package you can
&lt;a href="https://www.dropbox.com/downloading?src=index"&gt;download from the Dropbox web site&lt;/a&gt;,
I was getting this annoying error message that said &lt;em&gt;Error: Dependency is not
satisfiable: libnautilus-extension1 (&amp;gt;= 1:2.22.2)&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;On the site, Dropbox offers installable packages for the Fedora and Ubuntu
distributions of Linux. Well, I am using Debian and Ubuntu, being a Debian-based
distro, should be compatible, right? You would think so... Turns out that the
issue is in a dependency in the manifest of the Ubuntu package, as the error
message has already alluded to.&lt;/p&gt;
&lt;p&gt;Technically, you could download the Dropbox source tar ball and compile it
yourself, but what's the fun in that... I like to get to the bottom of things.
I downloaded the &lt;em&gt;nautilus-dropbox_0.6.7_amd64.deb&lt;/em&gt; package and when you try to
install it using &lt;code&gt;dpkg -i&lt;/code&gt; you'll get broken packages. That tells me that the
problem was not with the dependencies themselves, but with the .deb manifest
inside the package not specifying dependencies correctly. In order to fix this
you will need to unpack the .deb file, change the dependency specification and
then repackage it. Here's how you can do that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the place where you download the Dropbox .deb file to. This is
    usually the Downloads folder inside your home directory.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new directory to extract the package to&lt;/p&gt;
&lt;pre class="code literal-block"&gt;mkdir -p extract/DEBIAN
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract the files from the .deb package&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dpkg -x nautilus-dropbox_0.6.7_amd64.deb extract/
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract the control information (manifest) from the package&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dpkg -e nautilus-dropbox_0.6.7_amd64.deb extract/DEBIAN
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open the &lt;code&gt;extract/DEBIAN/control&lt;/code&gt; file with your favorite editor&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Find the dependencies line, which starts with the text &lt;code&gt;Depends:&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;On that line, look for the offending dependency spec:
    &lt;code&gt;libnautilus-extension1 (&amp;gt;= 1:2.22.2)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Notice the version number of this dependency. On my Debian 6 machine, the
    version of that library is 2.30.1. Notice that the Ubuntu package has a &lt;code&gt;1:&lt;/code&gt;
    prepended to the package version number in the dependency spec. To make it
    work in Debian 6 you will need to edit that to remove the &lt;code&gt;1:&lt;/code&gt; from the spec
    so that it looks like this: &lt;code&gt;libnautilus-extension1 (&amp;gt;= 2.22.2)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Save the file and exit your editor&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new directory called build&lt;/p&gt;
&lt;pre class="code literal-block"&gt;mkdir build
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebuild the .deb package by using the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dpkg-deb -b extract/ build/
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You will notice that a brand new .deb package is now available in the build
    directory you just created.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now you can install this new package by issuing the command&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dpkg -i nautilus-dropbox_0.6.7_amd64.deb
&lt;/pre&gt;


&lt;p&gt;while in the &lt;code&gt;build&lt;/code&gt; directory.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should now be able to use your Dropbox without any installation
problems. While this problem solving exercise was fun, there is also an easier
way to accomplish the same end result and that is to download the Dropbox source
tarball and run the usual &lt;em&gt;configure, make, make install&lt;/em&gt; trifecta.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/dependency-error-when-trying-to-install-dropbox-on-debian-6-squeeze/</guid><pubDate>Wed, 01 Jun 2011 05:13:44 GMT</pubDate></item><item><title>Changing the hostname of a Debian server</title><link>http://thestandardoutput.com/posts/changing-the-hostname-of-a-debian-server/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I am doing web development using Python on a Linux environment and the plan for
the final product is to be hosted at &lt;a href="http://www.linode.com/," title="Linode"&gt;Linode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As such, I want to setup a integration test environment that looks a little like
the stuff at Linode and namely, the cheap VM specs that they offer.  So I
created a default VM in &lt;a href="http://www.virtualbox.org/," title="VirtualBox"&gt;VirtualBox&lt;/a&gt;
on my development workstation that looks like the Linode 512 VM. This default VM
is a template whose purpose is to be cloned into other VMs and moved into the
test server for execution. I will go into the software specs (what's installed
in it) some other time.&lt;/p&gt;
&lt;p&gt;Suffice it to say that moving the VM to the test server has 2 caveats that I
haven't quite addressed in a graceful manner yet. One of the issues happens when
I boot the new VM in the test server using the cloned VDI file and it loses the
eth0 network interface. The other issue is related to the hostname of the VM and
I will discuss this here today.&lt;/p&gt;
&lt;p&gt;When I created the default VM on the workstation I chose the hostname
&lt;em&gt;change-hostname&lt;/em&gt; for it in an effort to thwart any inclinations of not changing
such setting. I use debian-based operating systems exclusively and in the case
of the VM, it is a Ubuntu server 10.04. In order to change the hostname in such
machines, you need to follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;em&gt;/etc/hostname&lt;/em&gt; file with your favorite editor. On Debian-based
    systems this file constains the hostname of the current machine.&lt;/li&gt;
&lt;li&gt;Delete the current name and change it to whatever you like&lt;/li&gt;
&lt;li&gt;Save the file and exit your editor&lt;/li&gt;
&lt;li&gt;Reset the hostname by running the following command:&lt;pre class="code literal-block"&gt;sudo /etc/init.d/hostname start
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is it... Pretty easy, but I want to automate it a little more; Too many
steps to do manually.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/changing-the-hostname-of-a-debian-server/</guid><pubDate>Mon, 30 May 2011 17:54:45 GMT</pubDate></item><item><title>How to resize a VirtualBox VDI file</title><link>http://thestandardoutput.com/posts/how-to-resize-a-virtualbox-vdi-file/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I am running Ubuntu Lucid on my workstation at home, but sometimes I still need
to go back to Windows to get something done that I haven't quite figured out
how to do in Linux yet. For that I am running VirtualBox on the workstation
from which I spin up a Windows 7 VM.&lt;/p&gt;
&lt;p&gt;I initially created the VM with 32 GB of hard drive space. That turned out to
be too little and after the base Win7 OS and a few applications I was using
over 15 GB. So I figured that I needed more hard disk space and I thought that
I could just enlarge the pesky VDI file for the Win7 VM (it stands for Virtual
Desktop Image and that's the default VM image file format used by VBox).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/5767015885/" title="Win7 VBox VM Before Resize"&gt;&lt;img alt="Win7 VBox VM Before Resize" src="http://farm4.static.flickr.com/3270/5767015885_22f73b1714_m.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Before&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Well, it turns out that &lt;em&gt;in nature&lt;/em&gt; you can't really pick up a hard disk, open
it up, and throw in a new platter. In a &lt;em&gt;virtual&lt;/em&gt; world, however, you get to
play &lt;em&gt;God&lt;/em&gt; and manipulate it any way you choose. All you have to do is clone
and modify your original VDI file. Here's what you need:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;VirtualBox. &lt;a href="http://thestandardoutput.com/2011/05/virtualbox-on-debian-based-distros/," title="Install VBox"&gt;Read this&lt;/a&gt; to install it on a Debian-based Linux distro.&lt;/li&gt;
&lt;li&gt;Windows 7... But any other OS ISO image or disk will do.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://gparted.sourceforge.net/," title="GParted"&gt;GParted&lt;/a&gt;, the Gnome partition
    editor.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Assuming that you already downloaded the GParted ISO, installed VirtualBox and
created some VM of which you want to resize the VDI file, here's how you do it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal (we'll be using the command line for this).&lt;/li&gt;
&lt;li&gt;Find the VDI file you want to resize. This is usually under &lt;code&gt;~/VirtualBox VMs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now clone the VDI by issuing the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;VBoxManage clonevdi Win7_64bit.vdi Win7_64bit_Larger.vdi
&lt;/pre&gt;


&lt;p&gt;Where the first file name is the input file and the second file name the
output.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then resize the VDI (I grew mine from 32 to 64 GB):&lt;/p&gt;
&lt;pre class="code literal-block"&gt;VBoxManage modifyvdi Win7_64bit_Larger.vdi --resize 65536
&lt;/pre&gt;


&lt;p&gt;Where the first parameter is the input file name and the resize parameter
takes the new size in megabytes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the graphical VirtualBox manager, create a new VM using the cloned and
    expanded VDI file. I would pay special attention to use the same setting as
    the original VM that you cloned from.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Now boot the new VM using the GParted ISO image that you downloaded
    earlier. We will use it to resize the partition inside the VDI.&lt;/li&gt;
&lt;li&gt;On the boot screen you will want to choose to boot using the Live GParted
    instance. We will use it to resize the partition in the VDI.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once the live CD has booted up and the GParted application is running,
    select the partition you want to resize by clicking on it and then click the
    resize button.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/5767015957/" title="GParted Step 1"&gt;&lt;img alt="GParted Step 1" src="http://farm4.static.flickr.com/3332/5767015957_9f81947a7f_m.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then select the handle at the end of the partition and slide it to fill up
    the entire unused space area. Click the resize button.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/5767558446/" title="GParted Step 2"&gt;&lt;img alt="GParted Step 2" src="http://farm4.static.flickr.com/3602/5767558446_cb91feb79a_m.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next click the apply button on the GParted toolbar and watch the magic
    happen. Once done, click close and reboot the VM.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/5767558500/" title="GParted Step 3"&gt;&lt;img alt="GParted Step 3" src="http://farm4.static.flickr.com/3251/5767558500_ac1e56e8ed_m.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The first time you boot after performing the steps above, Windows will
    likely want to check the disk for consistency. Let it happen and Windows
    will reboot itself.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/5767016165/" title="Win7 VBox VM After Resize"&gt;&lt;img alt="Win7 VBox VM After Resize" src="http://farm3.static.flickr.com/2716/5767016165_e390a0ea15_m.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;After&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;After this process, my Windows 7 VM was able to see a much larger drive. Let me
know in the comments if you have questions or suggestions about how to improve
this process.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>virtualbox</category><guid>http://thestandardoutput.com/posts/how-to-resize-a-virtualbox-vdi-file/</guid><pubDate>Sat, 28 May 2011 09:32:29 GMT</pubDate></item><item><title>VirtualBox on Debian-based distros</title><link>http://thestandardoutput.com/posts/virtualbox-on-debian-based-distros/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;There is
&lt;a href="http://www.virtualbox.org/wiki/linux_Downloads" title="Oracle
VirtualBox Install"&gt;a really great write up&lt;/a&gt; on how to install and maintain the latest Oracle VirtualBox
package on a Debian-based Linux distribution.&lt;/p&gt;
&lt;p&gt;Here are the steps in a nutshell:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add a line to the &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;deb&lt;/span&gt; &lt;span class="s"&gt;http://download.virtualbox.org/virtualbox/debian&lt;/span&gt; &lt;span class="kp"&gt;lucid&lt;/span&gt; &lt;span class="kp"&gt;contrib&lt;/span&gt; &lt;span class="kp"&gt;non-free&lt;/span&gt;
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download and add the Oracle public key:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install VirtualBox:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get update
sudo apt-get install virtualbox-4.0
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That's basically it... Do refer to the link above for extra details and some
caveats.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>virtualbox</category><category>virtualization</category><guid>http://thestandardoutput.com/posts/virtualbox-on-debian-based-distros/</guid><pubDate>Sat, 28 May 2011 06:35:42 GMT</pubDate></item><item><title>Restoring Installed Packages in Debian</title><link>http://thestandardoutput.com/posts/restoring-installed-packages-in-debian/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I have an older laptop that runs Ubuntu Linux and one of the issues that comes
up regularly is that Ubuntu releases a new version every 6 months and I usually
flatten the disks on that machine and do a fresh install. The base system is
great and very usable, but there are several packages that I install manually
after the fact, most of them being programming tools. There is a quick way for
you to list out all installed packages and then restore them after upgrading
and I will cover that technique here.&lt;/p&gt;
&lt;p&gt;Note: The instructions listed here are for Debian based distributions that use
.deb based packages.&lt;/p&gt;
&lt;h3&gt;Backing up a list of installed packages&lt;/h3&gt;
&lt;p&gt;In order to list out all installed packages and save them to a text file, you
can do this from the shell:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dpkg --get-selections &amp;gt; installed-packages.txt
&lt;/pre&gt;


&lt;p&gt;Let's deconstruct the above command:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;dpkg&lt;/code&gt; is the Debian package manager&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--get-selections&lt;/code&gt; is the parameter or action that lists all the currently
    installed packages. You can also pass a pattern to this action to generate
    different types of package lists. Look at the man pages for details.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;gt; textfilename.txt&lt;/code&gt; will redirect the standard output to the text file
    specified.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Restoring the list of installed packages&lt;/h3&gt;
&lt;p&gt;When you need to restore the installed packages from a previous state, you can
run the following command from the shell:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dpkg --set-selections &amp;lt; installed-packages.txt
&lt;/pre&gt;


&lt;p&gt;The command above is a little different and those differences mean:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--set-selections&lt;/code&gt; is the action that sets the package selections using a file
    read in from standard in.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt; textfilename.txt&lt;/code&gt; will read the contents of the file and send them to
    standard in.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Backing up and restoring your package installation list is a really simple
procedure in Debian based distributions. You can even script it out and run it
on a schedule and then save it to a cloud storage service such as Dropbox. Let
me know what you think and if you have a better process.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>cool stuff</category><category>debian</category><category>linux</category><category>package</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/restoring-installed-packages-in-debian/</guid><pubDate>Thu, 19 May 2011 23:15:40 GMT</pubDate></item></channel></rss>