<?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; Ubuntu</title> <atom:link href="http://www.doknowevil.net/category/computers/software/operating-systems/linux/ubuntu/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>Tips for Using Bash in the Linux Terminal &#8211; Part 1</title><link>http://www.doknowevil.net/2010/10/23/tips-for-using-bash-in-the-linux-terminal-part-1/</link> <comments>http://www.doknowevil.net/2010/10/23/tips-for-using-bash-in-the-linux-terminal-part-1/#comments</comments> <pubDate>Sat, 23 Oct 2010 10:13:05 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Bash]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[OSX]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[cli]]></category> <category><![CDATA[shortcuts]]></category> <category><![CDATA[terminal]]></category> <category><![CDATA[tips]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=687</guid> <description><![CDATA[Introduction Bash is the default shell in the terminal on many Linux and UNIX based operating system, such as Ubuntu or Mac OS X. I&#8217;ve mentioned commandlinefu.com before as a great reference for learning some neat tricks with the terminal. I&#8217;ve gained a lot from the site and a few others, such as the Advanced]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>Bash is the default shell in the terminal on many Linux and UNIX based operating system, such as Ubuntu or Mac OS X.  I&#8217;ve mentioned <a href="http://www.commandlinefu.com" title="learn to be a terminal master">commandlinefu.com</a> before as a great reference for learning some neat tricks with the terminal.  I&#8217;ve gained a lot from the site and a few others, such as the <a href="http://tldp.org/LDP/abs/html/" target="_blank">Advanced Bash Scripting Guide</a> and <a href="http://wiki.bash-hackers.org" target="_blank">the bash hackers wiki</a>.  I wanted to share some of the tips I use most often, combined with other information that I&#8217;ve compiled through my use of the terminal.</p><p>I think I should mention that I&#8217;ve been using more applications in the terminal recently.  Some people view this as backwards but I argue just the opposite.  Limiting the amount of times I need to use the mouse and the number of keystrokes I need to make drastically increases my efficiency.  Many bash applications are designed around single keystrokes, layered hotkeys and edit &#8220;modes&#8221;.  GUIs have their place but many of my tasks can be completely more accurately and consistently via the terminal.</p><p>With that said, lets dive in.</p><h2>The Basics</h2><h3>Hotkeys</h3><p>Moving:<br /> <b>Ctrl + a</b> -> Go to the beginning of the line you are currently typing on.<br /> <b>Ctrl + e</b> -> Go to the end of the line you are currently typing on<br /> <b>Alt + f</b> -> Move cursor forward one word on the current line.<br /> <b>Alt + b</b> -> Move cursor backward one word on the current line.</p><p>Editing:<br /> <b>Ctrl + u</b> -> Clears from before the cursor position. If you are at the end of the line, clears the entire line.<br /> <b>Ctrl + k</b> -> Clear from after the cursor. If you are at the beginning of the line, clears the entire line.<br /> <b>Ctrl + w</b> -> Delete the word before the cursor.<br /> <b>Ctrl + h</b> -> Same as backspace.<br /> <b>Ctrl + t</b> -> Swap the last two characters before the cursor.<br /> <b>Esc + t</b> -> Swap the last two words before the cursor.</p><p>Other:<br /> <b>Ctrl + l</b> -> Clear screen (same as clear command).<br /> <b>Ctrl + c</b> -> Kill the current command or process.<br /> <b>Ctrl + z</b> -> Puts whatever you are running into a suspended background process, fg to restore it.<br /> <b>Ctrl + d</b> -> Exit the current shell.</p><p>Oddly, unlike many terminal applications, Bash hotkeys don&#8217;t make a lot of sense to me.  There are very few that are &#8220;intuitive&#8221;.</p><h3>History</h3><p>Press the <b>up arrow for the last command</b> or:</p><p><b>!!</b> &#8212; repeat last command</p><pre class="brush:bash">echo &quot;hello&quot;
!!
</pre><p>Outputs:</p><pre class="brush:bash">z@zentury:~$ echo &quot;hello&quot;
hello
z@zentury:~$ !!
echo &quot;hello&quot;
hello</pre><p><b>ctrl+r</b> is one of the best ways to search through your history.  it will initialize a reverse search as you type.  To go to the next result, press ctrl+r again</p><h2>Advanced</h2><h3>History Expansion/Modification</h3><p>!:0 &#8212; will repeat the first token</p><pre class="brush:bash">cd ~
ls -la
!:0
</pre><p>!:1-3 &#8212; defining a range: 1-3 will repeat the 2nd to 4th tokens (count starts at 0).  It&#8217;s important to note that double quotes will group tokens together.</p><pre class="brush:bash">echo &quot;hello there&quot; &amp;&amp; ls ~
!:3-4</pre><p>!!:s/find/replace/ &#8212; will allow you to replace a part of the command</p><pre class="brush:bash">echo &quot;hello there&quot;
!!:s/hello/hi/</pre><p>Outputs:</p><pre class="brush:bash">z@zentury:~$ echo &quot;hello there&quot;
hello there
z@zentury:~$ !!:s/hello/hi/
echo &quot;hi there&quot;
hi there
</pre><p><i>OR even shorter:</i></p><p>^find^replace</p><pre class="brush:bash">echo &quot;hello there&quot;
^hello^hi</pre><p>Outputs:</p><pre class="brush:bash">z@zentury:~$ echo &quot;hello there&quot;
hello there
z@zentury:~$ ^hello^hi
echo &quot;hi there&quot;
hi there
</pre><h3>Sequences and Pattern Expansion</h3><p>Typically in a Linux or UNIX environment you have access to a command line tool name &#8220;seq&#8221; which <a href="http://www.doknowevil.net/2009/08/15/generating-sequences-of-numbers-or-characters-with-bash/" target="_blank">gone over before</a>.  However, it&#8217;s good to know that bash has built-in sequence expansion and you don&#8217;t need to rely on seq.</p><pre class="brush:bash">echo {a..z}
a b c d e f g h i j k l m n o p q r s t u v w x y z</pre><p>by defining a start and end character with the &#8216;..&#8217; in between, we tell bash to fill in the rest and echo a list for us.  Those are all lowercase, what if you wanted uppercase? simple:</p><pre class="brush:bash">echo {A..Z}
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</pre><p>Or both, with a few extra characters in the mix:</p><pre class="brush:bash">echo {A..z}
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [  ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z</pre><p>It doesn&#8217;t always have to be a-z though,</p><pre class="brush:bash">echo {A..G}
A B C D E F G</pre><p>This also works with numbers:</p><pre class="brush:bash">echo {0..9}
0 1 2 3 4 5 6 7 8 9
echo {0..100}
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100</pre><p>Descending as well as ascending</p><pre class="brush:bash">echo {9..0}
9 8 7 6 5 4 3 2 1 0</pre><p>Echo a specific set</p><pre class="brush:bash">echo {1,4,6,9}
1 4 6 9</pre><p>Applying it</p><h4>Quickly backup a file</h4><pre class="brush:bash">touch file1.txt
cp file1.txt{,.bak}
ls
file1.txt file1.txt.bak</pre><p>explanation: the first parameter is empty, the second is .bak, this expands to >> cp file1.txt file1.txt.bak << and creates the copy</p><h4>Convert an image type</h4><p>If you have image magick installed, you can convert file types pretty easy using this same concept:</p><pre class="brush:bash">sudo apt-get install imagemagick</pre><p>(To install on Ubuntu)</p><pre class="brush:bash">convert file.{jpg,png}</pre><h4>Permutations</h4><pre class="brush:bash">echo {a..c}{a..c}{a..c}
aaa aab aac aba abb abc aca acb acc baa bab bac bba bbb bbc bca bcb bcc caa cab cac cba cbb cbc cca ccb ccc</pre><h2>Stay tuned for Part 2</h2><p>These are some pretty common techniques I use to reduce the amount of typing and thinking required to complete a task in the terminal.  Stay tuned for part 2 and <a href="http://www.commandlinefu.com/commands/by/zed" target="_blank">check out some of my creative usages at commandlinefu.com</a>.<br /> -</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/10/23/tips-for-using-bash-in-the-linux-terminal-part-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Sorry screen, tmux is better (but here are some screen-like hotkeys)</title><link>http://www.doknowevil.net/2010/10/18/sorry-screen-tmux-is-better-but-here-are-some-screen-lik-hotkeys/</link> <comments>http://www.doknowevil.net/2010/10/18/sorry-screen-tmux-is-better-but-here-are-some-screen-lik-hotkeys/#comments</comments> <pubDate>Mon, 18 Oct 2010 22:30:13 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <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=705</guid> <description><![CDATA[Introduction If you&#8217;re familiar with the command line on Linux or UNIX, you&#8217;ve likely heard of a program called &#8220;screen&#8221;, which allows you to create virtual terminal sessions inside of your current terminal. The major benefit to this is the ability to dettach and reattach screen sessions, leaving your programs to act as if you]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>If you&#8217;re familiar with the command line on Linux or UNIX, you&#8217;ve likely heard of a program called <a href="http://www.doknowevil.net/2010/10/18/using-terminal-program-screen-on-linux-unix/" title="screen for UNIX / Linux">&#8220;screen&#8221;, which allows you to create virtual terminal sessions inside of your current terminal</a>.  The major benefit to this is the ability to dettach and reattach screen sessions, leaving your programs to act as if you never left.  Additionally, you can have multiple buffers inside your screen that act like tabs, allowing you to flip between.</p><p>The major difference between screen and tmux is their ability to split and manage splits. Oh yeah, that and hotkeys.  I think they were trying to pay legacy (or force you to change back :-P) by setting up your main key to be &#8220;b&#8221; instead of &#8220;a&#8221;, which is an awkward reach.  Tux Wears Fedora below shares more screen like hotkeys, as do I with some minor tweaks that I combined with the default example in ubuntu /usr/share.</p><p>I became well acquainted at <a href="http://blog.yjl.im/2009/11/migrating-to-tmux-from-gnuscreen.html" target="_blank">Tux Wears Fedora&#8217;s post on tmux migrating from screen</a>.</p><p><a href="http://www.doknowevil.net/wp-content/uploads/2010/06/screenshot109.png"><img src="http://www.doknowevil.net/wp-content/uploads/2010/06/screenshot109-500x312.png" alt="" title="tmux in action" width="500" height="312" class="alignnone size-thumbnail wp-image-712" /></a></p><pre class="brush:bash">
# ~/.tmux.conf
# By Tyler Mulligan. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is a good starting point but you should check out the man page for more
# configuration options if you really want to get more out of tmux

### Unbind existing tmux key bindings (except 0-9).

# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix

# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server

# screen ^C c
unbind ^C
bind ^C new-window
bind c
bind c new-window

# detach ^D d
unbind ^D
bind ^D detach

# displays *
unbind *
bind * list-clients

# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind &quot; &quot;
bind &quot; &quot; next-window
unbind n
bind n next-window

# title A
unbind A
bind A command-prompt &quot;rename-window %%&quot;

# other ^A
unbind ^A
bind ^A last-window

# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window

# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows

# quit \
unbind \
bind \ confirm-before &quot;kill-server&quot;

# kill K k
unbind K
bind K confirm-before &quot;kill-window&quot;
unbind k
bind k confirm-before &quot;kill-window&quot;

# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client

# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind v split-window -h
unbind &#039;&quot;&#039;
bind - split-window -v
bind h split-window -v

# History
set -g history-limit 1000

# Pane
unbind o
bind C-s down-pane

# Terminal emulator window title
set -g set-titles on
set -g set-titles-string &#039;#S:#I.#P #W&#039;

# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left &#039;#[fg=green]#H#[default]&#039;
set -g status-right &#039;#[fg=yellow]#(cut -d &quot; &quot; -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]&#039;

# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on

# Highlighting the active window in status bar
setw -g window-status-current-bg red

# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24

# :kB: focus up
unbind Tab
bind Tab down-pane
unbind BTab
bind BTab up-pane

# &quot; windowlist -b
unbind &#039;&quot;&#039;
bind &#039;&quot;&#039; choose-window
</pre><p>Splitting is what initially caused me to migrate but there are plenty of other features that have lead me to stay. <a href="http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/" target="_blank">this article outlines the benefits in detail</a>.  Once you go tmux, you never go back.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/10/18/sorry-screen-tmux-is-better-but-here-are-some-screen-lik-hotkeys/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </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>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>scp-notifications for GNOME and Ubuntu &#8211; Expanding on My Original Python Script</title><link>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/</link> <comments>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/#comments</comments> <pubDate>Sun, 27 Jun 2010 00:11:15 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Compiz]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Desktop Mods]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[KDE]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[The Internet]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Web Applications]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[libnotify]]></category> <category><![CDATA[notification-daemon]]></category> <category><![CDATA[pynotify]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=698</guid> <description><![CDATA[I&#8217;ve only been coding Python for ~12 hours total, so don&#8217;t expect this to be perfect. Knowing what I know about creating/testing other software and doing my best to scour through very light pynotify documentation, I&#8217;ve begun to build out this script to be more useful / portable / configurable. As the Version 0.6 indicates,]]></description> <content:encoded><![CDATA[<p>I&#8217;ve only been coding Python for ~12 hours total, so don&#8217;t expect this to be perfect.  Knowing what I know about creating/testing other software and doing my best to scour through very light pynotify documentation, I&#8217;ve begun to build out this script to be more useful / portable / configurable.  As the Version 0.6 indicates, I&#8217;m not quite at my goal yet and there is still more to learn to bring it up to that point.</p><p>I&#8217;m releasing this early on my blog just in case I caught any people yesterday who&#8217;ve been experimenting with my research / code so far.  I&#8217;ll share it on github when I evolve it just a bit more.</p><p><a href="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv">Video of it in Action</a></p><pre class="brush:python">
#!/usr/bin/env python
#
# Title: scp-notifications
# Author: Tyler Mulligan (tyler@detrition.net)
# Date: 06/26/2010
# Version: 0.6
# Description:
# Used in combination with an event, such as an action or cronjob, this script
# will scp the latest file from a folder to your server.
#
# Optionally, it can copy the url to your clipboard and/or show a popup with a
# link to the file after succesfully uploading
#
# Orginally developed to be piped to from compiz screenshot tool
# http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv
#
# The MIT License
#
# Copyright (c) 2010 Tyler Mulligan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the &quot;Software&quot;), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE
#

import pygtk
pygtk.require(&#039;2.0&#039;)
import pynotify
import gtk
import sys
import os
import subprocess

# Set Variables
#####################################
user = &quot;user&quot;
host = &quot;server.com&quot;
# All should have trailing slashes
lfolder = &quot;/home/user/screenshots/&quot;
hfolder = &quot;/home/remote_user/screenshots/&quot;
httplink = &quot;http://&quot;+host+&quot;/screenshots/&quot;

# Display
#####################################
t1 = 5000 # timeout for screenshot upload dialog
t2 = 3000 # timeout for screenshot preview
t3 = 7000 # timeout for link dialog

screenshot_preview = 1 # If using with the compiz screenshot plugin, you may want this
popup_link = 1 # another popup
copy_to_clipboard = 0 # automatically copy text to keyboard

# Position
#####################################

# Get screensize &lt; &lt; used for relative positioning
display = gtk.gdk.display_get_default()
screen = display.get_default_screen()
x = screen.get_width() - 1
y = screen.get_height() - 1

# 0 for Automatic Placement
&quot;&quot;&quot;
x1 = 0
y1 = 0
x2 = 0
y2 = 0
x3 = 0
y3 = 0
&quot;&quot;&quot;
# Define Relative Position (assuming top-right)
x1 = x-1
y1 = 12
x2 = x1
y2 = y1 + 100
x3 = x-1
y3 = 12
# Define Static (1920 puts it on my second monitor)
&quot;&quot;&quot;
x1 = 1919
y1 = 12
x2 = x1
y2 = y1 + 100
x3 = 1920
y3 = 12
&quot;&quot;&quot;
#####################################

def upload_cb(n, action):
    assert action == &quot;upload&quot;

    subprocess.call([&quot;scp&quot;, os.path.join(lfolder, f), &#039;%s@%s:%s&#039; % (user, host, hfolder)])

    # setup URL in
    if copy_to_clipboard:
        clipboard = gtk.clipboard_get()
        clipboard.set_text(httplink + f)
        # make our data available to other applications
        clipboard.store()

    # Notification: Link for the clicking
    if popup_link:
        n3 = pynotify.Notification(&quot;Here is your link&quot;,&quot;&lt;a href=&#039;&quot; + httplink + f + &quot;&#039;&gt;&quot; + httplink + f + &quot;&quot;)

        helper = gtk.Button()
        icon = helper.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_DIALOG)
        n3.set_icon_from_pixbuf(icon)

        n3.set_urgency(pynotify.URGENCY_NORMAL)
        if x3:
            n3.set_hint(&quot;x&quot;, x3)
        if y3:
            n3.set_hint(&quot;y&quot;, y3)
        n3.set_timeout(t3)
        n3.connect(&quot;closed&quot;,closen3_cb)

        if not n3.show():
            print &quot;Failed to send notification&quot;
            sys.exit(1)

        closen1_cb(n1)
        closen2_cb(n2)

    gtk.main_quit()
    sys.exit(1)

# Notification 1 was closed
def closen1_cb(n):
    n1.close()
    if screenshot_preview:
        n2.close()
    gtk.main_quit()

# Notification 2 was closed
def closen2_cb(n):
    n2.close()
    gtk.main_quit()

# Notification 2 was closed
def closen3_cb(n):
    n3.close()
    gtk.main_quit()

# The Ignore button was clicked
def ignore_cb(n, action):
    assert action == &quot;ignore&quot;

    closen1_cb(n1)
    closen2_cb(n2)
    gtk.main_quit()

# Main
def main():
    gtk.main()

# Init
if __name__ == &#039;__main__&#039;:
    if not pynotify.init(&quot;Notifier &#039;scp&#039; Option&quot;):
        sys.exit(1)

    # Get latest file and build uri
    start = os.path.abspath(lfolder)
    f = max([(os.path.getmtime(os.path.join(start,p)),p)
         for p in os.listdir(start)])[1]
    uri = lfolder + f

    # Notification: Upload to Server
    n1 = pynotify.Notification(&quot;Upload to Server?&quot;,&quot;Copy the file &#039;&quot; + f + &quot;&#039; to the server?&quot;)

    helper = gtk.Button()
    icon = helper.render_icon(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
    n1.set_icon_from_pixbuf(icon)

    n1.set_urgency(pynotify.URGENCY_NORMAL)
    if x1:
        n1.set_hint(&quot;x&quot;, x1)
    if y1:
        n1.set_hint(&quot;y&quot;, y1)
    n1.set_timeout(t1)
    n1.add_action(&quot;upload&quot;, &quot;Yes, Upload&quot;, upload_cb)
    n1.add_action(&quot;ignore&quot;, &quot;Ignore&quot;, ignore_cb)
    n1.connect(&quot;closed&quot;,closen1_cb)

    if not n1.show():
        print &quot;Failed to send notification&quot;
        sys.exit(1)

    # Notification: Screenshot Preview
    if screenshot_preview:
        n2 = pynotify.Notification(&quot;Screenshot Preview&quot;, &quot;&quot;, uri)
        n2.set_urgency(pynotify.URGENCY_LOW)
        if x2:
            n2.set_hint(&quot;x&quot;, x2)
        if y2:
            n2.set_hint(&quot;y&quot;, y2)
        n2.set_timeout(t2)
        n2.connect(&quot;closed&quot;,closen2_cb)

        if not n2.show():
            print &quot;Failed to send notification&quot;
            sys.exit(1)

    main()
</pre><p>.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure url="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="2797703" type="video/ogg" /> </item> <item><title>Ubuntu Notifications (osd-notify) Sucks, notifications-daemon Rocks &#8211; Exploiting the Goodness with Compiz</title><link>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/</link> <comments>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/#comments</comments> <pubDate>Sat, 26 Jun 2010 04:47:40 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Compiz]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[KDE]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[gtk]]></category> <category><![CDATA[markedwontfix]]></category> <category><![CDATA[notifications]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=677</guid> <description><![CDATA[Introduction The long name for this blog used to be &#8220;Tyler Mulligan&#8217;s Tips and Tricks for Increasing your Efficiency&#8220;. I love finding ways to increase my efficiency and let computers do the work while I focus on more interests aspects of what the computer is providing me with. When I recognize an issue, I find]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>The long name for this blog used to be &#8220;<a href="http://www.doknowevil.net" target="_blank">Tyler Mulligan&#8217;s Tips and Tricks for Increasing your Efficiency</a>&#8220;.  I love finding ways to increase my efficiency and let computers do the work while I focus on more interests aspects of what the computer is providing me with.  When I recognize an issue, I find a way to cut out time by streamlining the process for the most accurate repetition, like any programmer would/should/could.</p><p>I noticed myself taking a lot of screenshots with compiz&#8217; built in screenshot tool (I can hold a hotkey and drag a box to take newspaper style clippings).  This is very fast and simple, I highly recommend enabling this option and getting used to it.  However, I don&#8217;t care much for clicking around on clunky websites to upload images.</p><p>This is where my adventure starts&#8230; when I find out <a href="http://ubuntuforums.org/showthread.php?t=1517950" title="notify-osd doesn't display popup balloons">a very useful feature was deprecated and not replaced in Ubuntu</a>.  I don&#8217;t use the new notification area, it has too much I don&#8217;t need, I never liked the behavior of these new osd-notify notifications which I found out now are even more worthless (sorry team).</p><h2>Using Sane Notifications in Ubuntu</h2><p>After <a href="http://ubuntuforums.org/showpost.php?p=8559795&#038;postcount=8">reinstalling the GNOME default notifications system in Ubuntu</a> I was able to use SANE notifications that actually&#8230; KICK ASS!  I don&#8217;t understand how osd-notify is better than these which even comes with it&#8217;s own notification properties panel.  Maybe it&#8217;s an under the hood thing&#8230;</p><p>Regardless, there is no doubt in my mind that notifications that you hover, can still slightly see but click through but cannot perform any actions, even a close, are just plan stupid and annoying..</p><p><img src="http://interwebninja.com/compiz-screenshots/screenshot5.png" title="Screenshot taken with Tyler Mulligan's Notification 'scp' Option python script for ubuntu and other Linux based operating systems" /><br /> Screenshot of the script I ended up writing using the &#8220;better&#8221; notification system to ask me if I want to upload the screenshot I just took to the server.</p><h2>Linking the notifications</h2><p>I linked the notifications the following way:</p><p><img src="http://interwebninja.com/compiz-screenshots/screenshot3.png" title="Screenshot taken with Tyler Mulligan's Notification 'scp' Option python script for ubuntu and other Linux based operating systems" /></p><h2>Python Script for Notification that Prompts for File Upload to Server</h2><p>Knowing diddly squat about Python, I chugged forward with my classic notification popups that allow for interaction as it had the most activity around it and some examples available in /usr/share/doc/python-notify/examples/</p><p>I ended coming up with the following script thanks to some help from a few people in #python on irc.freenode.org</p><p>This is outside of the scope of this blogpost but this script assumes you have setup passwordless ssh to your server.</p><pre class="brush:python">
#!/usr/bin/env python
#
# Title: Notification &#039;scp&#039; Option
# Author: Tyler Mulligan (tyler@detrition.net)
# Date: 06/25/2010
# Description:
# Used in combination with an event, such as an action or cron
# the latest file from a folder will be scped to your server and will copy
# the http location of the that file to your clipboard
#
# Orginally developed to be piped to from compiz screenshot tool
#
#
# The MIT License
#
# Copyright (c) 2010 Tyler Mulligan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the &quot;Software&quot;), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE
#

import pygtk
pygtk.require(&#039;2.0&#039;)
import gtk
import pynotify
import sys
import os
import subprocess

user = &quot;user&quot;
host = &quot;server.com&quot;
lfolder = &quot;/home/user/screenshots/&quot;
hfolder = &quot;/home/remote_user/screenshots/&quot;
httplink = &quot;http://&quot;+host+&quot;/screenshots/&quot;
timeout = 5000

# Set position
display = gtk.gdk.display_get_default()
screen = display.get_default_screen()
x = screen.get_width() - 1
y = screen.get_height() - 1
#x = 1919
#y = 12

def upload_cb(n, action):
    assert action == &quot;upload&quot;

    start = os.path.abspath(lfolder)
    f = max([(os.path.getmtime(os.path.join(start,x)),x)
          for x in os.listdir(start)])[1]

	# setup URL in clipboard
    clipboard = gtk.clipboard_get()
    clipboard.set_text(httplink + f)
    # make our data available to other applications
    clipboard.store()

    os.system(&#039;scp &quot;%s&quot; &quot;%s@%s:%s&quot;&#039; % (lfolder + f, user, host, hfolder) ).wait()

    n.close()
    gtk.main_quit()

def ignore_cb(n, action):
    assert action == &quot;ignore&quot;
    n.close()
    gtk.main_quit()

if __name__ == &#039;__main__&#039;:
    if not pynotify.init(&quot;Notifier &#039;scp&#039; Option&quot;):
        sys.exit(1)

	# Setup Popup
    n = pynotify.Notification(&quot;Upload to Server?&quot;)
    n.set_urgency(pynotify.URGENCY_NORMAL)
    n.set_timeout(timeout)
    n.set_category(&quot;device&quot;)
    n.add_action(&quot;upload&quot;, &quot;Yes, Upload&quot;, upload_cb)
    n.add_action(&quot;ignore&quot;, &quot;Ignore&quot;, ignore_cb)

    # Set position
    n.set_hint(&quot;x&quot;, x)
    n.set_hint(&quot;y&quot;, y)

    if not n.show():
        print &quot;Failed to send notification&quot;
        sys.exit(1)

    gtk.main()
</pre><p>edit: I updated the script with some position information &#8212; I love that I can put the notifications ANYWHERE on my screen.  I also variablized the timeout.</p><p>edit 2: Here is a video of my improved script in action &#8212; I&#8217;ll post the source later</p><p>http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv</p><h2>Going Beyond</h2><p>The Compiz example is just something that server my immediate needs.  The possibilities are however endless.  You can for example, link this script to a cron job asking you if you want to sync some other sort of file.  Or perhaps you&#8217;d like to add multiple buttons to give yourself a folder / server choice.</p><p>Happy hacking</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <enclosure url="http://cankill.us/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="687321" type="video/ogg" /> <enclosure url="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="687321" type="video/ogg" /> </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>RabbitVCS is the new Nautilus SVN</title><link>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/</link> <comments>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/#comments</comments> <pubDate>Wed, 05 May 2010 01:59:14 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Computers]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[nautilus]]></category> <category><![CDATA[SVN]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=579</guid> <description><![CDATA[I should have written about this months ago. Readers have replied to my previous post about nautilus svn, which I claimed to be the first that didn&#8217;t suck. This is the evolution of it, RabbitVCS (Version Control System), which aims to use the same intuitive, integrated gui for other version control systems, such as git]]></description> <content:encoded><![CDATA[<p>I should have written about this months ago.  Readers have <a href="http://www.doknowevil.net/2009/04/28/nautilussvn-finally-an-svn-gui-for-linux-that-doesnt-totally-suck/">replied to my previous post about nautilus svn</a>, which I claimed to be the first that didn&#8217;t suck.  This is the evolution of it, <a href="http://www.rabbitvcs.org">RabbitVCS (Version Control System)</a>, which aims to use the same intuitive, integrated gui for other version control systems, such as <a href="http://en.wikipedia.org/wiki/Git_%28software%29" target="_blank">git</a> (check the <a href="http://wiki.rabbitvcs.org/wiki/about/roadmap">rabbitvcs roadmap</a> for details on expected support for different versioning system.</p><p><a href="http://www.doknowevil.net/wp-content/uploads/2010/05/context_menu.png"><img src="http://www.doknowevil.net/wp-content/uploads/2010/05/context_menu.png" alt="" title="context_menu" width="827" height="559" class="alignnone size-full wp-image-580" /></a><br /> credit to rabbitvcs for the screenshot</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Packages for nautilus you wish were installed by default in ubuntu</title><link>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/</link> <comments>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/#comments</comments> <pubDate>Wed, 05 May 2010 01:46:27 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Application Management]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[Freeware]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[open source]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=550</guid> <description><![CDATA[Intro Thanks to a tip I picked up at Tombuntu about nautilus, after following up on a trick to add files to mocp through nautilus scripts trackback link from Hilltop Yodler (great article), when doing a google search for GiS for nautilus-actions (apt-get install nautilus-actions). I learned about 3 kick ass additions to the nautilus]]></description> <content:encoded><![CDATA[<h2>Intro</h2><p>Thanks to <a href="http://tombuntu.com/index.php/2007/07/12/install-useful-nautilus-menu-items/" title="See code block below" target="_blank">a tip I picked up at Tombuntu about nautilus</a>, after following up on a <a href="http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/">trick to add files to mocp through nautilus scripts</a> <a href="http://www.hilltopyodeler.com/blog/?p=279" title="more tricks to add files to with nautilus">trackback link from Hilltop Yodler (great article)</a>, when doing a google search for <a href="http://images.google.com/imgres?imgurl=http://linux.softpedia.com/screenshots/Nautilus-actions_2.png&#038;imgrefurl=http://linux.softpedia.com/progScreenshots/Nautilus-actions-Screenshot-4311.html&#038;usg=__HIOtTlLu0P59ZnwHEDslrgllk-Y=&#038;h=478&#038;w=610&#038;sz=166&#038;hl=en&#038;start=1&#038;sig2=To1WEzfgc0FLl-hS6ZIqjQ&#038;um=1&#038;itbs=1&#038;tbnid=jucsR2NLXFKcuM:&#038;tbnh=107&#038;tbnw=136&#038;prev=/images%3Fq%3Dnautilus%2Bactions%26um%3D1%26hl%3Den%26client%3Dfirefox-a%26sa%3DN%26rls%3Dcom.ubuntu:en-US:official%26tbs%3Disch:1&#038;ei=tLrgS-bUNcL98Ab0hPmlBw" title="LOL, this url _ What's a GiS for?">GiS for</a> <a href="http://www.grumz.net/?q=node/387" title="Nautilus Actions _ nautilus-actions">nautilus-actions</a> (apt-get install nautilus-actions).  I learned about 3 kick ass additions to the nautilus menu.  I realized <a href="http://fedoraproject.org/" target="_blank">Fedora Linux</a> and <a href="http://www.linuxmint.com/" target="_blank">Linux Mint</a> had some of these in their context menus but didn&#8217;t make the connection to <a href="http://www.ubuntu.com" target="_blank">ubuntu</a> until now.</p><h2>On with the Show</h2><pre class="brush:bash">sudo apt-get install nautilus-open-terminal nautilus-image-converter nautilus-gksu</pre><p>for some kick ass options in the context (right click) menu of nautilus (your default file manager in ubuntu). For more information, check out the tombuntu article I linked above.</p><pre class="brush:bash">pkill nautilus</pre><p>to restart nautilus and have the new packages in your context menu</p><h2>More</h2><p>If you&#8217;re interested in this, you&#8217;ll probably also like <a href="http://www.doknowevil.net/2010/05/04/adding-context-right-click-menu-options-to-nautilus-ubuntus-default-file-manager-with-nautilus-actions">my article about nautilus-actions</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/feed/</wfw:commentRss> <slash:comments>0</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 950/995 objects using disk

Served from: www.doknowevil.net @ 2012-02-07 07:29:19 -->
