<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; executables</title> <atom:link href="http://www.ghacks.net/tag/executables/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 17:32:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Save disk space with UPX</title><link>http://www.ghacks.net/2010/04/28/save-disk-space-with-upx/</link> <comments>http://www.ghacks.net/2010/04/28/save-disk-space-with-upx/#comments</comments> <pubDate>Wed, 28 Apr 2010 13:11:32 +0000</pubDate> <dc:creator>Ronan Jouchet</dc:creator> <category><![CDATA[Hacking]]></category> <category><![CDATA[Knowledge]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[compress]]></category> <category><![CDATA[disk]]></category> <category><![CDATA[executables]]></category> <category><![CDATA[save]]></category> <category><![CDATA[space]]></category> <category><![CDATA[upx]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=24952</guid> <description><![CDATA[Disk space is cheap, but there are still situations where you&#8217;d like to reclaim space. For me, one of them is getting the maximum of the free Dropbox account I use to synchronize my applications between work and home. hey, don&#8217;t say my sysadmin I do this, he&#8217;d get a heart attack from the sole [...]]]></description> <content:encoded><![CDATA[<p>Disk space is cheap, but there are still situations where you&#8217;d like to reclaim space. For me, one of them is getting the maximum of the free Dropbox account I use to synchronize my applications between work and home. <em>hey, don&#8217;t say my sysadmin I do this, he&#8217;d get a heart attack from the sole thought of a virus among my tools collection</em>.</p><p>Of course {zip/rar}ing everything is a no-go; nobody wants to have to open an archive before being able to launch an application. So what?<br
/> <span
id="more-24952"></span>Enter UPX, the reference packer for executable files. UPX compresses executable files (mostly .exe and .dll under Windows), but contrarily to zip/rar/whatever, it keeps them executable, also preserving  their properties (icon, version&#8230;). All this at the cost of a completely unnoticeable performance hit when starting the application. Sounds good? Let&#8217;s compress everything executable in this Dropbox that is dangerously close to reaching its 2GB limit.</p><ol><li><a
href="http://upx.sourceforge.net/#download">Download UPX</a> from SourceForge and extract it to &lt;upxFolder&gt;.</li><li>Open a command prompt and browse to &lt;upxFolder&gt; (you can find the command prompt in Start &gt; Accessories or run it via Windows+R, then &#8220;cmd&#8221;. Use &#8220;cd FolderName&#8221; to navigate the filesystem).</li><li>Run upx.exe to have a look at the options available. I&#8217;ll use -9 but you can adjust this (for example if you feel a performance hit on an old machine &#8211;<em>I don&#8217;t</em>&#8211;), and -v to have verbose output. Now, navigate to the folder of a program you want to compress and run your freshly-baked command:<br
/> <code>"&lt;upxFolder&gt;\upx.exe" -9 -v *.exe *.dll</code><br
/> (replace &lt;upxFolder&gt; adequately, and keep the quotes around the path, or spaces will cause problems)</li><li>You&#8217;ll see the files being compressed, the compression ratio, as well as the occasional &#8220;<em>AlreadyPackedException: already packed by UPX</em>&#8220;, or &#8220;<em>CantPackException: .NET files (win32/net) are not yet supported</em>&#8220;, or &#8220;<em>IOException: read error: Invalid argument</em>&#8220;. These errors are all OK, UPX just notifies you that it left the file untouched.</li></ol><p>Woot, you already gained 50MB by just compressing big ol&#8217;Inkscape.<br
/> <a
rel="attachment wp-att-24921" href="http://www.ghacks.net/2010/04/28/save-disk-space-with-upx/inkscape/"><img
class="alignnone size-full wp-image-24921" src="http://www.ghacks.net/wp-content/uploads/2010/04/inkscape.png" alt="" width="547" height="306" /></a></p><p>Of course you now want to do this on ALL the executables in a folder. But you&#8217;re lazy, and the perspective of running this line inside hundreds of subfolders leaves you bleak. Lucky you, I&#8217;m lazy too, so I dug <a
href="http://stackoverflow.com/questions/2043869/how-to-execute-a-windows-batch-command-recursively">Stack Overflow</a> to assemble a script that will do the operation recursively.</p><ol><li>Paste this in a text file (of course adjusting the main line like we did before) you will rename to something like upxRecursive.bat<br
/> <code>for /r /d %%x in (*) do (<br
/> pushd "%%x"<br
/> "&lt;upxFolder&gt;\upx.exe" -9 -v *.exe *.dll<br
/> popd<br
/> )<br
/> pause</code></li><li>Move this batch file inside your Dropbox folder, launch it and see the magic. This will take a long time on a big folder filled with executable files, but will seriously slim it down. In my case, I saved 400MB (from 1.7GB to 1.3GB), leaving me with plenty of space for more crap.</li></ol><p><strong>Final notes:</strong></p><ul><li>UPX has been in development for a long time and is praised for its extreme stability and reliability, but could possibly leave you with some exotic executable files that won&#8217;t run after compression. I personally never occurred to me, but accidents happen. In this case, use <code>"&lt;upxFolder&gt;\upx.exe" -d problematicFile.exe</code> to get an uncompressed version. Note it won&#8217;t be byte-identical, if you want to be able to get back to byte-identical versions, you should add the <code>--exact</code> switch at compression time.<br
/> By the way, the folks at <a
href="http://portableapps.com/">PortableApps.com</a> pack all the software they release with UPX. Reassured about its reliability?</li><li>People familiar with <a
href="http://en.wikipedia.org/wiki/Portable_Executable">the win32/pe format</a> will know that .exe and .dll are not its only valid extensions. The full list is &#8220;.exe .dll .cpl .ocx .sys .scr .drv&#8221;. However, I don&#8217;t recommend compressing sensitive files like control panel extensions or driver files, and this is why the line I suggest targets only dll and exe files. Compressing VLC is OK because you can reinstall it if UPX butchers it. Compressing critical software is not.</li><li>I&#8217;m just repeating my previous point, but don&#8217;t want to see angry comments from people doing crazy things with this. Again, <span
style="text-decoration: underline"><strong>don&#8217;t do this on all C: , it -will- wreck your system</strong></span>. Compress executables when you really need it, and inside folders containing only reinstallable applications if things go wrong.</li><li>UPX is multi-platform. My article focuses heavily on Windows because this is the platform where my use case comes from, but you can of course adjust this idea/script for Linux (plus you will probably have access to a saner scripting language than batch).</li><li><em><strong>EDIT</strong>: as pointed by John T. Haller in the comments, PortableApps offers <a
href="http://portableapps.com/apps/utilities/portableapps.com_appcompactor">AppCompactor</a>, a graphical frontend  that relies among others on UPX.</em></li></ul><p><em>Ronan is a geek and musician living in Montreal. He likes scaring wary sysadmins with 2GB folders full of false positives and writes about  software, music and life at <a
href="http://www.flyingmolehill.com/">flying  molehill</a>.</em></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/04/28/save-disk-space-with-upx/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>The different ways to execute a Linux application</title><link>http://www.ghacks.net/2009/06/22/the-different-ways-to-execute-a-linux-application/</link> <comments>http://www.ghacks.net/2009/06/22/the-different-ways-to-execute-a-linux-application/#comments</comments> <pubDate>Mon, 22 Jun 2009 20:37:21 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[executables]]></category> <category><![CDATA[icons]]></category> <category><![CDATA[menus]]></category> <category><![CDATA[run dialog]]></category> <category><![CDATA[starting applications]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=13783</guid> <description><![CDATA[I remember, way back, when I first started using Linux either was either in full-on command line only Linux or I was using Fvwm95. Executing commands in command line meant I had to know the name of the command. And when I was in the Fvwm95 desktop, if there wasn&#8217;t a menu entry for an [...]]]></description> <content:encoded><![CDATA[<p>I remember, way back, when I first started using Linux either was either in full-on command line only Linux or I was using Fvwm95. Executing commands in command line meant I had to know the name of the command. And when I was in the Fvwm95 desktop, if there wasn&#8217;t a menu entry for an application the only other way I could start up an application was to open up the command line and hope I could find the exact command to run. Typically this meant scrolling through the contents of <strong>/usr/bin</strong> with the command <em>ls -l | less</em>. And in today&#8217;s Linux (or at least in my main machine) there are approximately 2004 commands within <strong>/usr/bin</strong>. That could mean a lot of searching.</p><p>Fortunately Linux has grown up quite a bit so it&#8217;s not that difficult to start an application. In fact, I would argue that starting an application in Linux is easier than it is in Windows. How can I say that? Well, why don&#8217;t we examine the various ways you can start an application within Linux and you can make the judgment yourself.</p><p><span
id="more-13783"></span><strong>Command line</strong></p><p>We&#8217;ll start with the more challenging first. Not that the command line is difficult, but it&#8217;s not nearly as easy as finding a menu entry and selecting it.</p><p>If you&#8217;ve been following me enough you probably have read an instance where I have mentioned global commands. A global command is a command that is located within your users&#8217; $PATH. NOTE: You can learn more about this in my article  &#8220;<a
title="Adding directories to your $PATH" href="http://www.ghacks.net/2009/06/03/adding-a-directory-to-your-path/" target="_blank">Adding directories to your $PATH</a>&#8220;. To find out what directories are in your $PATH issue the command <em>echo $PATH</em>. What you see printed out at your prompt are all of the directories which contain commands you can run from anywhere on your system. There may be times when you do not install an application within your path. For those applications you have to enter the <strong>explicit</strong> path to the executable command. Let me explain&#8230;</p><p>Say you install the beta version of Firefox (for testing purposes) in the <strong>/opt</strong> directory. So now you will have a directory <strong>/opt/firefox</strong> and within that directory is the executable command <em>firefox</em>. Since <strong>/opt</strong> isn&#8217;t in your $PATH, if you execute only <em>firefox</em> what will start up is the default firefox on your system. In order to start up Firefox installed in <strong>/opt</strong> you will have to execute the command <em>/opt/firefox/firefox</em>.</p><p>Now let&#8217;s say you are looking for the apt command to add a gpg key<strong></strong> but you&#8217;re not sure of the name. You <strong>are</strong> sure, however, of two things: It is in <strong>/usr/bin</strong> and it has the string &#8220;key&#8221; in the command. You could issue this command to find all matching commands:</p><p><em>ls /usr/bin/*key* </em></p><p>which will list all commands in <strong>/usr/bin<em> </em></strong>that contain the word &#8220;key&#8221;. In that listing you will see <em>apt-key</em>. You now know the name of the command.</p><p><strong>GUI</strong></p><p>There are two main (and universal) ways to start up an application in Linux. The first, and easiest, is to look through your main menu for that command&#8217;s entry. Once you find that command you simply select it to open up the application. One of the issues that is not a universal truth in Linux is menu layout. All Linux desktops lay out their menus differently. But for the most part they hold true to some similarities (Primarily the grouping of applications into submenus like &#8220;Office&#8221;, &#8220;Networking&#8221;, &#8220;Graphics&#8221;, &#8220;Games&#8221;, etc.)</p><p>The next universal method of starting up an application is to open up your desktops&#8217; file manager, navigate to the directory that contains the executable, and double click on the executable. This is much like it is in Windows. Most often you will be navigating to <strong>/usr/bin</strong> to find these executables.</p><p>NOTE: If a command requires a terminal to run you can not run it in this method. The only commands you can start up this way are graphical commands.</p><p><strong>Run prompt</strong></p><div
id="attachment_13784" class="wp-caption alignleft" style="width: 268px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/06/run_dialog.png"><img
class="size-full wp-image-13784" src="http://www.ghacks.net/wp-content/uploads/2009/06/run_dialog.png" alt="Figure 1" width="258" height="167" /></a><p
class="wp-caption-text">Figure 1</p></div><p>In some desktops you will have a &#8220;Run prompt&#8221; within your Start menu. In GNOME and KDE you can open up this dialog by pressing Alt-F2. In my favorite distribution, Elive Compiz, I set this to the Windows Key+F1. Figure 1 shows the Run Dialog in Elive. As you can see I want to start the game Torus Trooper. I start to type &#8220;torus&#8221; and the first matching entry pops up which I can click on to start up the application.</p><p><strong>Final thoughts</strong></p><p>Of course this is Linux so there are many more ways you can find to start up an application. You can create keyboard shortcuts for just about anything or, in some desktops, you can create desktop Icons. In some desktops you can create specific shelves for applications or add mini launchers. But, in general, the methods outlined above will get you through the day in Linux.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/06/22/the-different-ways-to-execute-a-linux-application/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
