<?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>Do Know Evil - A Blog by Tyler Mulligan &#187; Command Line</title> <atom:link href="http://www.doknowevil.net/category/command-line/feed/" rel="self" type="application/rss+xml" /><link>http://www.doknowevil.net</link> <description>Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like</description> <lastBuildDate>Sat, 16 Jul 2011 01:25:35 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.5</generator> <item><title>Customizing Colors for Your .bashrc</title><link>http://www.doknowevil.net/2010/10/21/customizing-colors-for-your-bashrc/</link> <comments>http://www.doknowevil.net/2010/10/21/customizing-colors-for-your-bashrc/#comments</comments> <pubDate>Thu, 21 Oct 2010 08:20:35 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Application Management]]></category> <category><![CDATA[Bash]]></category> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[OSX]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[colors]]></category> <category><![CDATA[customization]]></category> <category><![CDATA[ps1]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=830</guid> <description><![CDATA[I&#8217;m working on organizing my dotfiles and part of that process has led me to clean up the way I address colors. I came across a few good sources, for .bashrc colors and decided it&#8217;d be better to create my own. I would like to have used the ones I found on the Arch wiki]]></description> <content:encoded><![CDATA[<p>I&#8217;m working on organizing my <a title="dot files for linux and unix bashrc, bash_aliases and application configuration files" href="http://github.com/z/dotfiles" target="_blank">dotfiles</a> and part of that process has led me to clean up the way I address colors.  I came across a <a title="for bashrc colors" href="http://tldp.org/LDP/abs/html/sample-bashrc.html" target="_blank">few good sources</a>, <a title="few good sources" href="http://wiki.archlinux.org/index.php/Color_Bash_Prompt" target="_blank">for .bashrc colors</a> and decided it&#8217;d be better to create my own.  I would like to have used the ones I found on the Arch wiki but the aliases were a bit odd to me.  They also break consistency as you scroll down.  I&#8217;m not sure if this is due to it being a collaborative wiki or it&#8217;s a way to teach multiple syntaxes/approaches.  In either case I figured the aliases weren&#8217;t as &#8220;standard&#8221; as I thought they might be in that world.</p><p>So I decided to copy them the best of the bunch into geany and modify them with regular expressions.  I used column selection to speed up some of the tasks, such as Title Case formatting and typing the prefixes.</p><pre class="brush:bash"># define colors
Black=&#039;\e[0;30m&#039;    # Black / Regular
Red=&#039;\e[0;31m&#039;      # Red
Green=&#039;\e[0;32m&#039;    # Green
Yellow=&#039;\e[0;33m&#039;   # Yellow
Blue=&#039;\e[0;34m&#039;     # Blue
Purple=&#039;\e[0;35m&#039;   # Purple
Cyan=&#039;\e[0;36m&#039;     # Cyan
White=&#039;\e[0;37m&#039;    # White

BBlack=&#039;\e[1;30m&#039;   # BBlack / Bold
BRed=&#039;\e[1;31m&#039;     # BRed
BGreen=&#039;\e[1;32m&#039;   # BGreen
BYellow=&#039;\e[1;33m&#039;  # BYellow
BBlue=&#039;\e[1;34m&#039;    # BBlue
BPurple=&#039;\e[1;35m&#039;  # BPurple
BCyan=&#039;\e[1;36m&#039;    # BCyan
BWhite=&#039;\e[1;37m&#039;   # BWhite

UBlack=&#039;\e[4;30m&#039;   # UBlack / Underline
URed=&#039;\e[4;31m&#039;     # URed
UGreen=&#039;\e[4;32m&#039;   # UGreen
UYellow=&#039;\e[4;33m&#039;  # UYellow
UBlue=&#039;\e[4;34m&#039;    # UBlue
UPurple=&#039;\e[4;35m&#039;  # UPurple
UCyan=&#039;\e[4;36m&#039;    # UCyan
UWhite=&#039;\e[4;37m&#039;   # UWhite

BGBlack=&#039;\e[40m&#039;    # BGBlack - background
BGRed=&#039;\e[41m&#039;      # BGRed
BGGeeen=&#039;\e[42m&#039;    # BGGreen
BGYellow=&#039;\e[43m&#039;   # BGYellow
BGBlue=&#039;\e[44m&#039;     # BGBlue
BGPurple=&#039;\e[45m&#039;   # BGPurple
BGCyan=&#039;\e[46m&#039;     # BGCyan
BGWhite=&#039;\e[47m&#039;    # BGWhite

NC=&#039;\e[0m&#039;          # Text Reset / No Color</pre><p>Here is a test case:</p><pre class="brush:bash">for c in {,B,U,BG}{Black,Red,Green,Yellow,Blue,Purple,Cyan,White}; do echo -e ${!c}$c${NC}; done; echo -e &quot;${NC}&quot;</pre><p>Here is the same test case without the aliases</p><pre class="brush:bash">for c in {0,1,4}\;{30..37} {40..47}; do echo -e \\e[${!c}${c}m${c}m\\e[0m; done;</pre><p>Here's a PS1 you can try it with</p><pre class="brush:bash">PS1=&quot;${debian_chroot:+($debian_chroot)}\[${BWhite}\]\u\[${NC}\]\[${Yellow}\]@\[${White}\]\h\[${NC}\]:\[${BBlue}\]\w\[${NC}\]$ &quot;</pre><p>I plan to use these quite often as I build out my .bash_aliases but the most immediate use you might find useful is the PS1 generation tool I&#8217;ve setup an alpha of <a href="http://interwebninja.com/ps1-o-matic">http://interwebninja.com/ps1-o-matic/</a></p><p><a href='http://www.doknowevil.net/wp-content/uploads/2010/10/ps1-o-matic-0.5.ogv'>ps1-o-matic-0.5 video in action</a></p><p><img src="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot383-300x29.png" alt="" title="screenshot383" width="300" height="29" class="alignnone size-medium wp-image-842" /><br /> <img src="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot384-300x30.png" alt="" title="screenshot384" width="300" height="30" class="alignnone size-medium wp-image-841" /><br /> <img src="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot386-300x28.png" alt="" title="screenshot386" width="300" height="28" class="alignnone size-medium wp-image-839" /><br /> <img src="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot387-300x41.png" alt="" title="screenshot387" width="300" height="41" class="alignnone size-medium wp-image-838" /></p><p>Below is a screenshot of how I&#8217;m revising the script to use only javascript objects rather than relying on html inputs to store values:<br /> <a href="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot394.png"><img src="http://www.doknowevil.net/wp-content/uploads/2010/10/screenshot394-1024x581.png" alt="" title="screenshot394" width="1024" height="581" class="alignnone size-large wp-image-866" /></a></p><p>I&#8217;m currently at the point where I&#8217;m using jquery ui&#8217;s draggable and sortable to allow segments to be moved around but I have nothing worth sharing yet.  Stay tuned, I&#8217;ll be checking the source into <a href="http://github.com/z" target="_blank">my github account</a> soon.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/10/21/customizing-colors-for-your-bashrc/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure url="http://www.doknowevil.net/wp-content/uploads/2010/10/ps1-o-matic-0.5.ogv" length="4806169" type="video/ogg" /> </item> <item><title>Using Terminal Program &quot;screen&quot; on Linux / UNIX</title><link>http://www.doknowevil.net/2010/10/18/using-terminal-program-screen-on-linux-unix/</link> <comments>http://www.doknowevil.net/2010/10/18/using-terminal-program-screen-on-linux-unix/#comments</comments> <pubDate>Mon, 18 Oct 2010 22:30:06 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[screen]]></category> <category><![CDATA[tmux]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=706</guid> <description><![CDATA[Introduction The terminal program &#8220;screen&#8221; for Linux / UNIX, is a command line tool that allows you to emulate terminals inside a currently running session and detach the &#8216;screen&#8217; to the background. This program may seem obscure to new users because of it&#8217;s abstract nature and unusual key bindings but once you start learning the]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>The terminal program &#8220;screen&#8221; for Linux / UNIX, is a command line tool that allows you to emulate terminals inside a currently running session and detach the &#8216;screen&#8217; to the background.  This program may seem obscure to new users because of it&#8217;s abstract nature and unusual key bindings but once you start learning the basics, the advanced usages don&#8217;t seem that scary.</p><p><b>If you consider yourself to have an advanced sense of the command line</b> and you&#8217;d like to go more advanced out of gate, <b>you should consider skipping ahead to <a href="http://www.doknowevil.net/2010/10/18/sorry-screen-tmux-is-better-but-here-are-some-screen-lik-hotkeys/">my article on the screen successor, tmux which allows for more advanced splitting</a> (and apparently better code).</b></p><h2>Getting Started</h2><p>Below is a walk through of an average screen scenario I&#8217;ve put together to give you an idea of how you might use this program in your workflow.</p><p>to start a basic screen session type:</p><pre class="brush:bash">
screen
</pre><p>this will put you in a virtual session.</p><p>to detach the screen press: ctrl+a, d</p><p>to reattach the screen type:</p><pre class="brush:bash">
screen -r
</pre><p>detach again, then type:</p><pre class="brush:bash">
screen
</pre><p>and detach this. You now have 2 screen sessions open, so when you type screen -r, instead of reattaching, it will list the possible screens to attach. You&#8217;ll see something like the following:</p><pre class="brush:bash">
There are several suitable screens on:
    31454.pts-2.quadjutsu    (10/10/2009 09:45:51 AM)    (Detached)
    31219.pts-2.quadjutsu    (10/10/2009 09:44:27 AM)    (Detached)
Type &quot;screen [-d] -r [pid.]tty.host&quot; to resume one of them.
</pre><p>So I&#8217;d type:</p><pre class="brush:bash">
screen -r 31454
</pre><p>to attach the first one. On systems with &#8216;pkill&#8217; you can type:</p><pre class="brush:bash">
pkill screen
</pre><p>to kill all the screen sesions.</p><p>That&#8217;s one way to separate screens&#8230; another is virtual &#8220;tabs&#8221; within a screen session.</p><p>so lets create a new screen session with:</p><pre class="brush:bash">
screen
</pre><p>Then type:</p><pre class="brush:bash">
ls
</pre><p>so you have some data to reference for which &#8220;tab&#8221; you&#8217;re in</p><p>Then hit: ctrl+a, c</p><p>This will create a new tab.</p><p>to cycle forward through the tabs (next), hit: ctrl+a, n or ctrl+a, [spacebar]<br /> to cycle backwards through the tabs (previous), hit: ctrl+a, p or ctrl+a, [backspace]</p><p>to kill a tab, type: exit</p><p>I found a <a href="http://www.pixelbeat.org/lkdb/screen.html" title="terminal screen program unix linux">good reference for &#8220;screen&#8221; hotkeys at pixelbeat.org</a> if you&#8217;d like to learn more.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/10/18/using-terminal-program-screen-on-linux-unix/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Random gnome-terminal profiles (themes) in Ubuntu</title><link>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/</link> <comments>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/#comments</comments> <pubDate>Thu, 30 Sep 2010 23:20:02 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Application Management]]></category> <category><![CDATA[Bash]]></category> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Window Management]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=794</guid> <description><![CDATA[Introduction Does it ever confuse you if you have too many terminals open at once that look alike? Perhaps you&#8217;re just looking to express your personality or tickle your brain. In any case, if you&#8217;re using the terminal in ubuntu a lot, you may be interested in having random profiles (colors / settings). The concept]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>Does it ever confuse you if you have too many terminals open at once that look alike?  Perhaps you&#8217;re just looking to express your personality or tickle your brain.  In any case, if you&#8217;re using the terminal in ubuntu a lot, you may be interested in having random profiles (colors / settings).</p><p>The concept of the method is pretty simple, define a hotkey that launches a script that picks a random profile you&#8217;ve created and then open the terminal with that profile as a parameter.</p><h2>Prerequisites</h2><p>- Compiz or other hotkey script that will allow you to link to a .sh file<br /> - gnome-terminal<br /> - bash</p><h2>Getting Started</h2><p>You can figure out what Profiles you have by going to <strong>Edit > Profiles</strong> in gnome-terminal.  You likely only have one, &#8220;Default&#8221;, unless you&#8217;re already actively using terminal profiles.  If you only have one, you should create a few, maybe 3 or 4 right now and play with the colors a bit. <strong>Important, don&#8217;t include spaces in the names of the profiles</strong></p><h2>The Script</h2><p>Create a file in your scripts folder (or create a directory if you don&#8217;t have one):</p><pre class="brush:bash">
mkdir ~/scripts
touch ~/scripts/gnome-terminal.sh &amp;&amp; chmod +x ~/scripts/gnome-terminal.sh
gedit ~/scripts/gnome-terminal.sh
</pre><p>Paste the following replacing the Profile names with those of your own (delimited by spaces) and change the number 4 to that of the :</p><pre class="brush:bash">
#!/bin/bash
p=( Default Delta Psi Sigma )
gnome-terminal --window-with-profile ${p[$((RANDOM%${#p[@]}))]}
</pre><p>That ugly looking bit right here is a calculation between a random number (<strong>echo RANDOM</strong>) and the size of the array (<strong>${#p[@]}</strong>), &#8220;random&#8221; % &#8220;length of array&#8221;.  Where % means mod, or remainder of the division. (examples: 7%4 = 3; 6%4 = 2; 5%4 = 1; 4 % 4 = 0; 4 % 3 = 1; 321%321= 0).</p><p>To illustrate more, play with this code:</p><pre class="brush:bash">r=$RANDOM; echo $r; echo $((r % 4))</pre><p>This is how we get a random index value for the array. This value is nested inside the array ${p[r]}, where r is the random, within bounds, array index.  That array then corresponds with a name of our profile and we pass it as a paramater to gnome-terminal with &#8220;&#8211;window-with-profile&#8221;.  So using my define array above, if the random index were &#8220;1&#8243;, &#8220;Delta&#8221; would be echoed.  If the index were &#8220;0&#8243;, Default would be.</p><h2>The Setup</h2><p>Now, I use compiz with the commands plugin, setting my &#8220;command line 0&#8243; to <strong>~/scripts/./gnome-terminal.sh</strong> and my &#8220;run command 0&#8243; under my key bindings tab to <strong>ctrl+alt+t</strong>, but you can associate this script with anything you&#8217;d like to kick it off.  A shortcut icon for example.</p><p>May this inspire you to understand, extend and share.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Restricting a user&#8217;s shell permissions on Ubuntu Server 10.04 with lshell</title><link>http://www.doknowevil.net/2010/09/27/lshell-restricting-a-users-shell-permissions-on-ubuntu-server-10-04/</link> <comments>http://www.doknowevil.net/2010/09/27/lshell-restricting-a-users-shell-permissions-on-ubuntu-server-10-04/#comments</comments> <pubDate>Mon, 27 Sep 2010 23:19:37 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Bash]]></category> <category><![CDATA[Command Line]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[access control]]></category> <category><![CDATA[application permissions]]></category> <category><![CDATA[backups]]></category> <category><![CDATA[game servers]]></category> <category><![CDATA[limited users]]></category> <category><![CDATA[lshell]]></category> <category><![CDATA[security]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=785</guid> <description><![CDATA[As described by apt-cache, the method which I usually begin a package search for in a Ubuntu Server 10.04 environment: z@zentury ~$ apt-cache search lshell lshell - restricts a user&#039;s shell environment to limited sets of commands This is an extremely useful way to restrict a Linux users capabilities. Alternative shells, such as rssh, limit]]></description> <content:encoded><![CDATA[<p>As described by apt-cache, the method which I usually begin a package search for in a Ubuntu Server 10.04 environment:</p><pre class="brush:bash">z@zentury ~$ apt-cache search lshell
lshell - restricts a user&#039;s shell environment to limited sets of commands
</pre><p>This is an extremely useful way to restrict a Linux users capabilities.  Alternative shells, such as rssh, limit you to toggle a specific set of applications, (scp, sftp, cvs, svn, rsync or rdist).  A limited shell is helpful for reasons such as backups or game/application servers where you know/want the user to be able to execute only a specific set of actions. You can however, consider other reasons for restricting users on a Linux based machine.</p><p>A <a href="http://lshell.ghantoos.org/Use%20case" target="_blank">typical use case is provided in the lshell wiki</a>.</p><p>Ubuntu also provides a default in <strong>etc/lshell.conf</strong>, which serves as a good example:</p><pre class="brush:bash"># lshell.py configuration file
#
# $Id: lshell.conf,v 1.20 2009/06/09 19:53:46 ghantoos Exp $

[global]
##  log directory (default /var/log/lshell/ )
logpath         : /var/log/lshell/
##  set log level to 0, 1, 2 or 3  (0: no logs, 1: least verbose)
loglevel        : 2
##  configure log file name (default is %u i.e. username.log)
#logfilename     : %y%m%d-%u

[default]
##  a list of the allowed commands or &#039;all&#039; to allow all commands in user&#039;s PATH
allowed         : [&#039;ls&#039;,&#039;echo&#039;,&#039;cd&#039;,&#039;ll&#039;]

##  a list of forbidden character or commands
forbidden       : [&#039;;&#039;, &#039;&amp;&#039;, &#039;|&#039;,&#039;`&#039;,&#039;&gt;&#039;,&#039;&lt;&#039;, &#039;$(&#039;, &#039;${&#039;]

##  number of warnings when user enters a forbidden value before getting
##  exited from lshell
warning_counter : 2

##  command aliases list (similar to bash’s alias directive)
aliases         : {&#039;ll&#039;:&#039;ls -l&#039;, &#039;vi&#039;:&#039;vim&#039;}

##  a value in seconds for the session timer
#timer           : 5

##  list of path to restrict the user &quot;geographicaly&quot;
#path            : [&#039;/home/bla/&#039;,&#039;/etc&#039;]

##  set the home folder of your user. If not specified the home_path is set to
##  the $HOME environment variable
#home_path       : &#039;/home/bla/&#039;

##  update the environment variable $PATH of the user
#env_path        : &#039;:/usr/local/bin:/usr/sbin&#039;

##  allow or forbid the use of scp (set to 1 or 0)
#scp             : 1

##  allow of forbid the use of sftp (set to 1 or 0)
#sftp            : 1

##  list of command allowed to execute over ssh (e.g. rsync, rdiff-backup, etc.)
#overssh         : [&#039;ls&#039;, &#039;rsync&#039;]

##  logging strictness. If set to 1, any unknown command is considered as
##  forbidden, and user&#039;s warning counter is decreased. If set to 0, command is
##  considered as unknown, and user is only warned (i.e. *** unknown synthax)
#strict          : 1

##  force files sent through scp to a specific directory
#scpforce        : &#039;/home/bla/uploads/&#039;
</pre><p>If this looks like something you would like to be able to do, you can install it with apt-get:</p><pre class="brush:bash">z@zentury ~$ apt-get install lshell</pre><p>You can change a current user to have the limited shell with the following command:</p><pre class="brush:bash">sudo chsh -s /usr/bin/lshell backupbot</pre><p>You can add a new user with a limited shell with the following command (-m creates the home directory):</p><pre class="brush:bash">sudo useradd -m -s /usr/bin/lshell backupbot</pre><p>A <a href="http://lshell.ghantoos.org/Configuration" target="_blank">more detailed configuration guide can be found here</a></p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/09/27/lshell-restricting-a-users-shell-permissions-on-ubuntu-server-10-04/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Reseting your system wide cursor theme in ubuntu</title><link>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/</link> <comments>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/#comments</comments> <pubDate>Wed, 12 May 2010 03:26:46 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Command Line]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[cursor]]></category> <category><![CDATA[kde]]></category> <category><![CDATA[mouse]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=607</guid> <description><![CDATA[If you installed KDE in ubuntu (GNOME based), you may have noticed that when you log back into GNOME, you keep the KDE cursor theme. To fix this, use update-alternatives like so: 0025&#124;z@zentury ~$ sudo update-alternatives --config x-cursor-theme There are 7 choices for the alternative x-cursor-theme (providing /usr/share/icons/default/index.theme). Selection Path Priority Status ------------------------------------------------------------ * 0]]></description> <content:encoded><![CDATA[<p>If you installed KDE in ubuntu (GNOME based), you may have noticed that when you log back into GNOME, you keep the KDE cursor theme.  To fix this, use update-alternatives like so:</p><pre class="brush:bash">0025|z@zentury ~$ sudo update-alternatives --config x-cursor-theme
There are 7 choices for the alternative x-cursor-theme (providing /usr/share/icons/default/index.theme).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
* 0            /etc/X11/cursors/oxy-white.theme          50        auto mode
  1            /etc/X11/cursors/core.theme               30        manual mode
  2            /etc/X11/cursors/handhelds.theme          20        manual mode
  3            /etc/X11/cursors/oxy-white.theme          50        manual mode
  4            /etc/X11/cursors/redglass.theme           20        manual mode
  5            /etc/X11/cursors/whiteglass.theme         20        manual mode
  6            /usr/share/icons/DMZ-Black/cursor.theme   30        manual mode
  7            /usr/share/icons/DMZ-White/cursor.theme   50        manual mode

Press enter to keep the current choice[*], or type selection number:
</pre><p>press &#8220;7&#8243; for the default</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Fastest way to install the media essentials in ubuntu</title><link>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/</link> <comments>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/#comments</comments> <pubDate>Sat, 08 May 2010 02:37:13 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=593</guid> <description><![CDATA[If you&#8217;re coming from Windows, or like me, find yourself living in a live CD while you figure out which step went wrong; you&#8217;ll be interested in the essential media codecs, flash, java, Microsoft fonts, etc. I thought I&#8217;d share the way I did this as quickly as possible in in Ubuntu 10.04 using the]]></description> <content:encoded><![CDATA[<p>If you&#8217;re coming from Windows, or like me, find yourself living in a live CD while you figure out which step went wrong; you&#8217;ll be interested in the essential media codecs, flash, java, Microsoft fonts, etc.</p><p>I thought I&#8217;d share the way I did this as quickly as possible in in <a href="http://www.ubuntu.com" target="_blank">Ubuntu 10.04</a> using the command line.</p><p>Open up terminal, using ctrl+alt+t (Which I&#8217;m very happy about as this has been my default since 8.04). Alternativelty from the main menu -> Applications > Accessories > Terminal</p><p>Make a backup in case you&#8217;re scared, then remove the comments from repositories you need to unlock to access the restricted (proprietary) packages.</p><pre class="brush:bash">
ubuntu@ubuntu:~$ sudo cp /etc/apt/sources.list .
ubuntu@ubuntu:~$ sudo sed -i &#039;s/^# deb/deb/&#039; /etc/apt/sources.list
</pre><p>We do this be matching the first 2 characters with &#8216;# &#8216; and replacing them with &#8221; (nothing).  See the diff below (> indicate original lines, < are changed).</p><pre class="brush:bash">

ubuntu@ubuntu:~$ diff sources.list /etc/apt/sources.list
18,23c18,23
&lt; # deb http://archive.ubuntu.com/ubuntu lucid universe
&lt; # deb-src http://archive.ubuntu.com/ubuntu lucid universe
&lt; # deb http://archive.ubuntu.com/ubuntu lucid-updates universe
&lt; # deb-src http://archive.ubuntu.com/ubuntu lucid-updates universe
&lt; # deb http://security.ubuntu.com/ubuntu lucid-security universe
&lt; # deb-src http://security.ubuntu.com/ubuntu lucid-security universe
---
&gt; deb http://archive.ubuntu.com/ubuntu lucid universe
&gt; deb-src http://archive.ubuntu.com/ubuntu lucid universe
&gt; deb http://archive.ubuntu.com/ubuntu lucid-updates universe
&gt; deb-src http://archive.ubuntu.com/ubuntu lucid-updates universe
&gt; deb http://security.ubuntu.com/ubuntu lucid-security universe
&gt; deb-src http://security.ubuntu.com/ubuntu lucid-security universe
30,35c30,35
&lt; # deb http://archive.ubuntu.com/ubuntu lucid multiverse
&lt; # deb-src http://archive.ubuntu.com/ubuntu lucid multiverse
&lt; # deb http://archive.ubuntu.com/ubuntu lucid-updates multiverse
&lt; # deb-src http://archive.ubuntu.com/ubuntu lucid-updates multiverse
&lt; # deb http://security.ubuntu.com/ubuntu lucid-security multiverse
&lt; # deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
---
&gt; deb http://archive.ubuntu.com/ubuntu lucid multiverse
&gt; deb-src http://archive.ubuntu.com/ubuntu lucid multiverse
&gt; deb http://archive.ubuntu.com/ubuntu lucid-updates multiverse
&gt; deb-src http://archive.ubuntu.com/ubuntu lucid-updates multiverse
&gt; deb http://security.ubuntu.com/ubuntu lucid-security multiverse
&gt; deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
&gt;
&lt;pre class=&quot;brush:bash&quot;&gt;
</pre><p>Now that we uncommented these lines, they will be read next time we update, so lets go ahead and do that now.  Once that is done, we can install the extras.</p><pre class="brush:bash">
ubuntu@ubuntu:~$ sudo apt-get update
ubuntu@ubuntu:~$ sudo apt-get install ubuntu-restricted-extras
</pre><p>Rock and roll.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Installing Firefox 3.5.2 (Shiretoko) on Ubuntu using the default repos and customizing the icon to be more recognizable</title><link>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/</link> <comments>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/#comments</comments> <pubDate>Sun, 30 Aug 2009 15:58:31 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=480</guid> <description><![CDATA[When Firefox 3.5 came out, I along with many others, was eager to try it. For a while I ran it out of the archive directly but this caused minor issues as it&#8217;s a messy solution. At some point I noticed firefox-3.5 in the repository: tyler@quadjutsu:~$ apt-cache search firefox &#124;grep 3.5 abrowser-3.1 - dummy upgrade]]></description> <content:encoded><![CDATA[<p>When <a href="http://www.getfirefox.com">Firefox</a> 3.5 came out, I along with many others, was eager to try it.  For a while I ran it out of the archive directly but this caused minor issues as it&#8217;s a messy solution.  At some point I noticed firefox-3.5 in the repository:</p><pre class="brush:bash">
tyler@quadjutsu:~$ apt-cache search firefox |grep 3.5
abrowser-3.1 - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
abrowser-3.1-branding - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.1 - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.1-branding - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.1-dbg - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.1-dev - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.1-gnome-support - dummy upgrade package for firefox-3.1 -&gt; firefox-3.5
firefox-3.5 - safe and easy web browser from Mozilla
firefox-3.5-branding - Package that ships the firefox branding
firefox-3.5-dbg - firefox-3.5 debug symbols
firefox-3.5-dev - Development files for Mozilla Firefox
firefox-3.5-gnome-support - Support for Gnome in Mozilla Firefox
</pre><p>and proceeded to install it with the following command:</p><pre class="brush:bash">
tyler@quadjutsu:~$ sudo apt-get install firefox-3.5
</pre><p>It runs along-side Firefox 3.0 without a hitch.  I often use the two in tandem while testing web applications.</p><p>Something that bothered me about this was the default icon isn&#8217;t as recongnizable to me as I&#8217;d like it to be.</p><p><a href="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot-about-shiretoko.png"><img src="http://www.doknowevil.net/wp-content/uploads/2009/08/screenshot-about-shiretoko.png" alt="screenshot-about-shiretoko" title="screenshot-about-shiretoko" width="300" height="459" class="alignnone size-full wp-image-481" /></a></p><p>As such I looked into a way to replace it.</p><p>First, I found a replacement icon I liked</p><p><a href="http://www.doknowevil.net/wp-content/uploads/2009/08/hp-firefox-128x128.png"><img src="http://www.doknowevil.net/wp-content/uploads/2009/08/hp-firefox-128x128.png" alt="hp-firefox-128x128" title="hp-firefox-128x128" width="128" height="128" class="alignnone size-full wp-image-486" /></a></p><p>from the <a href="http://www.iconarchive.com/show/hydropro-icons-by-media-design/HP-Firefox-icon.html">following website</a> (where other nice replacements exist).</p><p>Then I went to find the logical location of the files to replace.  First I updated my &#8216;locate&#8217; database file because this software is new, so it&#8217;s not yet known.  This is done automatically daily on a cron but you can update it any time you&#8217;d like as follows:</p><pre class="brush:bash">
tyler@quadjutsu:~$ sudo updatedb
</pre><p>Then I probed for icons I might think would be responsible.</p><pre class="brush:bash">
tyler@quadjutsu:~$ locate firefox |grep lib |grep icon |grep 3.5
/usr/lib/firefox-3.5.2/icons
/usr/lib/firefox-3.5.2/chrome/icons
/usr/lib/firefox-3.5.2/chrome/icons/default
/usr/lib/firefox-3.5.2/chrome/icons/default/default16.png
/usr/lib/firefox-3.5.2/chrome/icons/default/default32.png
/usr/lib/firefox-3.5.2/chrome/icons/default/default48.png
/usr/lib/firefox-3.5.2/icons/document.png
/usr/lib/firefox-3.5.2/icons/mozicon128.png
/usr/lib/firefox-3.5.2/icons/mozicon16.xpm
/usr/lib/firefox-3.5.2/icons/mozicon50.xpm
</pre><p>The first set in the &#8216;/usr/lib/firefox-3.5.2/chrome/icons/&#8217; folder will replace the icons used by the application itself (i.e. the icon in the top of your window).  The latter,  &#8216;/usr/lib/firefox-3.5.2/icons/&#8217; will replace the ones used by shortcut icons.</p><p>Here are all the files for the icons I resized if you&#8217;d like to use them.</p><p><a href="http://www.doknowevil.net/files/firefox-3.5_replacement_chrome_icons.zip">firefox-3.5_replacement_chrome_icons.zip</a><br /> <a href="http://www.doknowevil.net/files/firefox-3.5_replacement_shortcut_icons.zip">firefox-3.5_replacement_shortcut_icons.zip</a></p><p>bash pro-style:</p><pre class="brush:bash">cd Desktop/ &amp;&amp; mkdir firefox_replacement_icons &amp;&amp; cd firefox_replacement_icons
wget http://www.doknowevil.net/files/firefox-3.5_replacement_chrome_icons.zip &amp;&amp; wget http://www.doknowevil.net/files/firefox-3.5_replacement_shortcut_icons.zip
for file in *.zip; do unzip $file; done
sudo cp chrome/* /usr/lib/firefox-3.5.2/chrome/icons/default/
sudo cp shorcuts/* /usr/lib/firefox-3.5.2/icons/</pre>]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2009/08/30/installing-firefox-352-shiretoko-on-ubuntu-using-the-default-repos-and-customizing-the-icon-to-be-more-recognizable/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Object Caching 769/811 objects using disk

Served from: www.doknowevil.net @ 2012-02-04 03:20:43 -->
