<?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>blog.tordeu.com &#187; Debian</title>
	<atom:link href="http://blog.tordeu.com/?cat=12&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.tordeu.com</link>
	<description>a blog about stuff</description>
	<lastBuildDate>Thu, 25 Apr 2013 07:03:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2</generator>
		<item>
		<title>Changing PATH to include /sbin or: How to fix &#8220;bash: ldconfig: command not found&#8221;</title>
		<link>http://blog.tordeu.com/?p=374</link>
		<comments>http://blog.tordeu.com/?p=374#comments</comments>
		<pubDate>Fri, 08 Jun 2012 00:23:51 +0000</pubDate>
		<dc:creator>tordeu</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[sbin]]></category>

		<guid isPermaLink="false">http://blog.tordeu.com/?p=374</guid>
		<description><![CDATA[It&#8217;s been a while, but in the oh so distant past I stumbled upon the following error on my then fairly new Debian Wheezy system: bash: ldconfig: command not found You might encounter this error or something very similar, especially when you are using sudo instead of changing to root with su (see my article <a href='http://blog.tordeu.com/?p=374'>[...]</a>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a while, but in the oh so distant past I stumbled upon the following error on my then fairly new Debian Wheezy system:</p>
<pre>bash: ldconfig: command not found</pre>
<p>You might encounter this error or something very similar, especially when you are using sudo instead of changing to root with su (<a title="How to enable sudo in Linux (here: Debian Squeeze)?" href="http://blog.tordeu.com/?p=31">see my article on how to enable sudo</a>).</p>
<p>&nbsp;</p>
<h2>Problem</h2>
<p>The problem is that programs like ldconfig are located in the  /sbin folder, but this folder is not added to the PATH variable.</p>
<p>If you don&#8217;t know what PATH is:</p>
<p>The path variable is essentially a list of folders. When you type a command in bash (the terminal/command line) like this:</p>
<pre>ldconfig</pre>
<p>then bash will go through all the folders listed in the PATH variable and see if a program with that name is in that folder. If it finds that program, it will execute it.</p>
<p>The problem here is that PATH (the list of directories where bash will look for the program) does not contain the folder /sbin. But because the program is in this folder and bash does not look there, bash will not find the program and instead annoy you with an error.</p>
<p>&nbsp;</p>
<h2>Solution</h2>
<p>The solution is to add  &#8220;/sbin&#8221; to the PATH variable. This can be done by editing the file &#8220;/etc/profile&#8221;.</p>
<p>Type</p>
<pre>sudo nano /etc/profile</pre>
<p>or &#8211; if you are more comfortable with a GUI based text editor &#8211; you can also type</p>
<pre>sudo gedit /etc/profile</pre>
<p>&nbsp;</p>
<p>At the beginning of the file, you will see the following:</p>
<pre>if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi</pre>
<p>This sets the PATH variable for the root user and every other user. The first line that starts with &#8220;PATH=&#8230;&#8221; sets the PATH for the root user and the second line sets PATH for everybody else. So the code fragment basically translates to:</p>
<pre>if user=root then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
otherwise
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"</pre>
<p>The second line is what we have to care right now. The directories in the list are separated by a colon, so the list contains the following directories:</p>
<ul>
<li>
<pre>/usr/local/bin</pre>
</li>
<li>
<pre>/usr/bin</pre>
</li>
<li>
<pre>/bin</pre>
</li>
<li>
<pre>/usr/local/games</pre>
</li>
<li>
<pre>/usr/games</pre>
</li>
</ul>
<p>We want to add a few directories to that, namely:</p>
<ul>
<li>
<pre>/usr/local/sbin</pre>
</li>
<li>
<pre>/usr/sbin</pre>
</li>
<li>
<pre>/sbin</pre>
</li>
</ul>
<p>For ldconfig and a lot of other programs, adding &#8220;/sbin&#8221; would be enough, but I added the others as well, because I thought: &#8220;I don&#8217;t wanna come back two more times, just because I might realize later that I should have added them as well in the first place&#8221;</p>
<p>You could add the directories anywhere in the list, but I like to add them in the same order they appear in the PATH variable for the root user, so I will change the beginning of the file to this (remember to separate the directories with a colon):</p>
<pre>if user=root then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
otherwise
  PATH="<span style="color: #ff0000;">/usr/local/sbin:</span>/usr/local/bin:<span style="color: #ff0000;">/usr/sbin:</span>/usr/bin:<span style="color: #ff0000;">/sbin:</span>/bin:/usr/local/games:/usr/games"
fi</pre>
<p>Save the file; when using nano, just</p>
<ul>
<li>hit &#8220;Ctrl+X&#8221; to quit</li>
<li>then &#8220;Y&#8221; to confirm that you want to save the modified version</li>
<li>then hit the enter key to confirm the filename</li>
</ul>
<p>And finally: Log out and log back in.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tordeu.com/?feed=rss2&#038;p=374</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Disable GNOME3&#8242;s Habbit Of Turning Off The Display After Some Time.</title>
		<link>http://blog.tordeu.com/?p=292</link>
		<comments>http://blog.tordeu.com/?p=292#comments</comments>
		<pubDate>Sun, 15 Jan 2012 04:29:32 +0000</pubDate>
		<dc:creator>tordeu</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tordeu.com/?p=292</guid>
		<description><![CDATA[Gnome3 has the annoying habbit of turning off the monitor after a while, even if you are watching a video. Unfortunately, if you go to System Settings &#62; Screen   you will be surprised that if offers you the possibility to change the time the system has to be idle for the monitor to be <a href='http://blog.tordeu.com/?p=292'>[...]</a>]]></description>
				<content:encoded><![CDATA[<p>Gnome3 has the annoying habbit of turning off the monitor after a while, even if you are watching a video. Unfortunately, if you go to</p>
<address>System Settings &gt; Screen</address>
<address> </address>
<p>you will be surprised that if offers you the possibility to change the time the system has to be idle for the monitor to be turned off from 1 minute to 1 hour. But what is missing is an option to turn this function off entirely.</p>
<p>Fortunately, it is possible to do that, just not in System Settings and you can either do that from command line or with a GUI.</p>
<p><span id="more-292"></span></p>
<h2>Explanation</h2>
<p>I will not explain GSettings here, but just in case you don&#8217;t know: GSettings (which replaces GConf) is used to store the configuration of the GNOME desktops. Don&#8217;t worry, you don&#8217;t need to know GSettings to follow the instructions below. But GSettings is also used to store the information about when to turn off the display. The keys that are important here are the following:</p>
<pre>org.gnome.settings-daemon.plugins.power sleep-display-ac
org.gnome.settings-daemon.plugins.power sleep-display-battery
org.gnome.desktop.session idle-delay</pre>
<p>Those are the keys that the System Settings GUI is changing when you use it.</p>
<p>The first two determine when the display is turned off (on a desktop system that is always plugged in the first value is the important one. The second key is used in case the system is running on a battery, which is important for portable devices like notebooks and tablets).</p>
<p>The third key is important, because it is used to determine when to start the screensaver and lock the screen, although there are additional values that target those two in org.gnome.desktop.session.</p>
<p><span style="text-decoration: underline;">The values of all three keys are in seconds (so a value of 600 stands for 600s = 10min).</span></p>
<p>But because the System Settings GUI does change these three keys altogether and there is a connection between these three, it is probably a good idea for most people to change all three to the same value by hand as well.</p>
<p>&nbsp;</p>
<h2>Using Command Line</h2>
<p>You can use the gsettings command to change the values of the keys.</p>
<p>First, let&#8217;s see what the values of these keys are. You can do that by running the following three commands.</p>
<pre>gsettings get org.gnome.settings-daemon.plugins.power sleep-display-ac
gsettings get org.gnome.settings-daemon.plugins.power sleep-display-battery
gsettings get org.gnome.desktop.session idle-delay</pre>
<p>Each command will print the value of the given key. You will notice (most likely) that all three values are equal and that they reflect the value that is displayed in System Settings. If you change the value in System Settings, you will notice that these three keys do change accordingly.</p>
<p>To set these by hand you can use the following three commands:</p>
<pre>gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac &lt;value&gt;
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery &lt;value&gt;
gsettings set org.gnome.desktop.session idle-delay &lt;value&gt;</pre>
<p>Just replace &lt;value&gt; with the number of seconds you want the system to wait before turning off the display (and potentially locking the screen). To tell the system that it should let the display turned on forever, you can use the value 0:</p>
<pre>gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 0
gsettings set org.gnome.desktop.session idle-delay 0</pre>
<p>&nbsp;</p>
<h2>Using A GUI</h2>
<p>To change the keys you can use &#8220;dconf Editor &#8220;. You can start the program by one of the following ways:</p>
<ul>
<li>go to Applications and either</li>
<ul>
<li>search for dconf or</li>
<li>look for it under &#8220;System Tools&#8221; or</li>
</ul>
<li>press Alt+F2 and enter: dconf-editor or</li>
<li>open a terminal and run &#8220;dconf-editor&#8221;</li>
</ul>
<p>Once dconf Editor starts, you will see the following window:</p>
<div id="attachment_297" class="wp-caption aligncenter" style="width: 534px"><a href="http://blog.tordeu.com/wp-content/uploads/2012/01/1.png"><img class="size-full wp-image-297 " title="dconf-editor_1" src="http://blog.tordeu.com/wp-content/uploads/2012/01/1.png" alt="dconf-editor 1" width="524" height="463" /></a><p class="wp-caption-text">The dconf-editor window after starting the I</p></div>
<p>On the left side you now need to navigate to &#8220;org.gnome.settings-daemon.plugins.power&#8221; (that means: open &#8220;org&#8221;, then &#8211; within &#8220;org&#8221; &#8211; open &#8220;gnome&#8221; and so on until you reach &#8220;power&#8221;). Then, you need to find the keys &#8220;sleep-display-ac&#8221; and &#8220;sleep-display-battery&#8221; on the right side:</p>
<div id="attachment_301" class="wp-caption aligncenter" style="width: 696px"><a href="http://blog.tordeu.com/wp-content/uploads/2012/01/2b.png"><img class="size-full wp-image-301" title="dconf-editor 2b" src="http://blog.tordeu.com/wp-content/uploads/2012/01/2b.png" alt="dconf-editor 2b" width="686" height="596" /></a><p class="wp-caption-text">The dconf-edtior window after navigating to the first key</p></div>
<p>Change both numbers to 0 to prevent the system from turning off the display.</p>
<p>After that you should navigate to &#8220;org.gnome.desktop.session&#8221; on the left side and change the key &#8220;idle-delay&#8221; (on the right side) to 0 as well.</p>
<p>After that, just quit the editor (the changes are automatically saved).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tordeu.com/?feed=rss2&#038;p=292</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to enable sudo in Linux (here: Debian Squeeze)?</title>
		<link>http://blog.tordeu.com/?p=31</link>
		<comments>http://blog.tordeu.com/?p=31#comments</comments>
		<pubDate>Fri, 24 Jun 2011 09:03:38 +0000</pubDate>
		<dc:creator>tordeu</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sudoers]]></category>

		<guid isPermaLink="false">http://blog.tordeu.com/?p=31</guid>
		<description><![CDATA[Introduction In Linux, it is recommended to work in a terminal as a normal user and use sudo to run commands as a superuser in case you need root privileges for a specific task, instead of creating a root session with su and eventually shoot yourself in the foot (if you&#8217;re lucky), which is far <a href='http://blog.tordeu.com/?p=31'>[...]</a>]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In Linux, it is recommended to work in a terminal as a normal user and use sudo to run commands as a superuser in case you need root privileges for a specific task, instead of creating a root session with su and eventually shoot yourself in the foot (if you&#8217;re lucky), which is far more likely this way.</p>
<h2>Problem</h2>
<p>In a fresh Debian (Squeeze) installation however, sudo will not work. If you try to run sudo, you will get the following error message:</p>
<p><span id="more-31"></span></p>
<pre>&lt;username&gt; is not in the sudoers file</pre>
<p>(Of course, instead of &#8220;&lt;username&gt;&#8221; it will list your username)</p>
<h2>Explanation</h2>
<p>Sudo will not work, because the user that is created during the installation is not added to the group &#8220;sudo&#8221;. However, you need to be a member of that group to be able to use sudo (Note: Depending on your distribution, the group might have a different name, like &#8220;sudoers&#8221;, &#8220;admin&#8221; (like in Ubuntu) or maybe something else. In that case you have to look up the name of the group).</p>
<p>You can check if you are a member of that group by getting a list of all groups you a member of by typing in the terminal:</p>
<pre>groups</pre>
<p>The group &#8220;sudo&#8221; will most like not be listed.</p>
<h2>The Solution</h2>
<p>To be able to use sudo, you need to be a member of a group named &#8220;sudo&#8221; (as noted above, this name might be different in other linux distributions). To become a member of this group, open a terminal and first get root access by typing:</p>
<pre>su</pre>
<p>Enter the root password when asked and then type the following:</p>
<pre>adduser &lt;username&gt; sudo</pre>
<p>Replace &lt;username&gt; with your username or the username of the user you want to give the possibility to use sudo (and depending on which linux distribution you use, you might need to replace &#8220;sudo&#8221; with the appropriate name of the group)</p>
<p>Now, that you are a member of this group, you are <span style="text-decoration: underline;">almost</span> done.</p>
<p>Exit your root session by typing:</p>
<pre>exit</pre>
<p>If you now type in</p>
<pre>groups</pre>
<p>you will probably notice that &#8220;sudo&#8221; is still <span style="text-decoration: underline;">not</span> listed and if you try running sudo you will still get an error message complaining that &#8220;&lt;username&gt; is not in the sudoers file&#8221;. Don&#8217;t panic! Just log out and back in to finish the process and if you open a terminal then, everything should be fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tordeu.com/?feed=rss2&#038;p=31</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
