<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=3349&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Append date and time to .bash_history at start of session]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=3349</link>
		<description><![CDATA[The most recent posts in Append date and time to .bash_history at start of session.]]></description>
		<lastBuildDate>Sat, 06 Jun 2020 10:21:56 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=22409#p22409</link>
			<description><![CDATA[<div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>Putting it in ~/.bash_profile didn&#039;t work for me. I suppose I have to log out of my desktop session and restart it.</p></div></blockquote></div><p>Yes, that&#039;s right.</p><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>Putting it in ~/.bashrc works every time I open a new terminal on the desktop.</p></div></blockquote></div><p>But then you&#039;ll have a new &quot;##Session begin&quot; section for every time a terminal is opened, which doesn&#039;t appear to be what the OP wants.</p></div></blockquote></div><p>Well. actually that&#039;d be quite good I think . Sometimes I&#039;m switching between normal user and root, and if I come back to something after a while I might see a string of commands in root&#039;s history but there was a break where I dropped back to normal user first. </p><p>As I said, I wouldn&#039;t want it for every single command, but at the start of any shell session is fine and can help a lot to trace things. </p><p>Thanks again to for the suggestions guys! It has helped some with keeping on top of some maintenance for a project where I really must work out a script that runs under cron, at least the gruntwork.</p>]]></description>
			<author><![CDATA[dummy@example.com (Kiwi Rider)]]></author>
			<pubDate>Sat, 06 Jun 2020 10:21:56 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=22409#p22409</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20672#p20672</link>
			<description><![CDATA[<p>I am always willing to learn, you got a point there. <span class="bbc">update-alternatives</span> allows to switch to the mate-terminal-wrapper, I will change my default mode to that proposal. This also fixes the problems with the text in the bash_history. </p><p>Thanks, rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Sun, 22 Mar 2020 16:33:10 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20672#p20672</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20670#p20670</link>
			<description><![CDATA[<div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><p>Don&#039;t use <span class="bbc">pkexec</span> to start a root terminal, that&#039;s a silly idea. Why do the MATE devs do that? <img src="https://dev1galaxy.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p></div></blockquote></div><p>Please can you explain why this is a silly idea?</p></div></blockquote></div><p>Because it runs the entire terminal emulator as root. Using my suggested command runs the emulator under the normal user and just runs the shell as root. See also <a href="https://en.wikipedia.org/wiki/Principle_of_least_privilege" rel="nofollow">https://en.wikipedia.org/wiki/Principle … _privilege</a></p><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>But: I don&#039;t like xterm.</p></div></blockquote></div><div class="codebox"><pre><code># update-alternatives --config x-terminal-emulator # then select your favourite emulator</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 22 Mar 2020 16:02:04 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20670#p20670</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20668#p20668</link>
			<description><![CDATA[<div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>Putting it in ~/.bash_profile didn&#039;t work for me. I suppose I have to log out of my desktop session and restart it. Putting it in ~/.bashrc works every time I open a new terminal on the desktop. If I put it in /root/.bashrc, it works every time I do &#039;su&#039; or &#039;su -&#039; in a terminal.</p></div></blockquote></div><p>Entering:</p><div class="codebox"><pre><code>. ~/.profile
echo &quot;##
##Session begin $(date)
##&quot; &gt;&gt; ~/.bash_history</code></pre></div><p>into /root/.bashrc causes a memory access error (Speicherzugriffsfehler in German), no matter if I use Mate with pkexec, su - or xterm. Whats wrong here? Guess I have to use the rescue mode again.</p><p>It does not matter if the separator is inserted every time I use the root terminal, I like the idea to have a better feeling for when I did something administering my installations. </p><p>BTW: the machine in question is Beowulf Beta from DVD in a VBox with UEFI encrypted with LVM. Rebooting the VM didn&#039;t make a difference. </p><p>rolfie</p><p>Edit: could fix it via opening the root folder under the Mate file manager with administrative privileges and using geany to remove the modifications from the .bashrc file.</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Sun, 22 Mar 2020 15:29:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20668#p20668</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20666#p20666</link>
			<description><![CDATA[<div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><p>Don&#039;t use <span class="bbc">pkexec</span> to start a root terminal, that&#039;s a silly idea. Why do the MATE devs do that? <img src="https://dev1galaxy.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p></div></blockquote></div><p>Please can you explain why this is a silly idea? </p><p>And its not a MATE devs idea. I put something together about a year ago, related to dropping gksu: <a href="https://dev1galaxy.org/viewtopic.php?id=2717" rel="nofollow">https://dev1galaxy.org/viewtopic.php?id=2717</a></p><div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><p>Use this to start a root terminal:</p><div class="codebox"><pre><code>x-terminal-emulator -e su -</code></pre></div></div></blockquote></div><p>That line works fine as additional entry in the menu. </p><p>But: I don&#039;t like xterm. The font is ugly and much too small for my eyes, and the window is too small. Mate terminal gives me exactly what I want and need, and offers to increase the window to a width of 132 characters. </p><p>There should be a way to achieve this. </p><p>rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Sun, 22 Mar 2020 15:21:34 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20666#p20666</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20665#p20665</link>
			<description><![CDATA[<div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>Putting it in ~/.bash_profile didn&#039;t work for me. I suppose I have to log out of my desktop session and restart it.</p></div></blockquote></div><p>Yes, that&#039;s right.</p><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>Putting it in ~/.bashrc works every time I open a new terminal on the desktop.</p></div></blockquote></div><p>But then you&#039;ll have a new &quot;##Session begin&quot; section for every time a terminal is opened, which doesn&#039;t appear to be what the OP wants.</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 22 Mar 2020 15:08:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20665#p20665</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20662#p20662</link>
			<description><![CDATA[<p>Putting it in ~/.bash_profile didn&#039;t work for me. I suppose I have to log out of my desktop session and restart it. Putting it in ~/.bashrc works every time I open a new terminal on the desktop. If I put it in /root/.bashrc, it works every time I do &#039;su&#039; or &#039;su -&#039; in a terminal.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Sun, 22 Mar 2020 13:56:54 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20662#p20662</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20660#p20660</link>
			<description><![CDATA[<p>Don&#039;t use <span class="bbc">pkexec</span> to start a root terminal, that&#039;s a silly idea. Why do the MATE devs do that? <img src="https://dev1galaxy.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p><p>Use this to start a root terminal:</p><div class="codebox"><pre><code>x-terminal-emulator -e su -</code></pre></div><p>Create a file at ~/.local/share/applications/root-terminal.desktop to make the action available via the XDG menu sytem:</p><div class="codebox"><pre><code>[Desktop Entry]
Version=1.0
Name=Root Terminal
Comment=Run terminal emulator as root
Type=Application
Exec=x-terminal-emulator -e su -
Categories=System;TerminalEmulator;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 22 Mar 2020 13:04:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20660#p20660</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20659#p20659</link>
			<description><![CDATA[<p>Tried that and created the .bash_profile in the /root folder of a Beowulf installation in a VM based on the Beta DVD, does not work. I use Mate, the root terminal is started by <span class="bbc">pkexec mate-terminal</span>.</p><p>What can be wrong? Rights?</p><p>rolfie</p><p>PS: seems to work when I start the Mate terminal as user and switch to root with <span class="bbc">su -</span>. How can I make this work via pkexec?</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Sun, 22 Mar 2020 12:46:45 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20659#p20659</guid>
		</item>
		<item>
			<title><![CDATA[Re: Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20290#p20290</link>
			<description><![CDATA[<p>Create a file at <strong>~/.bash_profile</strong> with this content:</p><div class="codebox"><pre><code>. ~/.profile
echo &quot;##
##Session begin $(date)
##&quot; &gt;&gt; ~/.bash_history</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 01 Mar 2020 10:47:30 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20290#p20290</guid>
		</item>
		<item>
			<title><![CDATA[Append date and time to .bash_history at start of session]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=20286#p20286</link>
			<description><![CDATA[<p>Hi there. </p><p>Something I&#039;m not up to figuring out ATM... </p><p>When I log into a machine I&#039;d like to have the current date and time of the session added to ~/.bash_history. </p><p>I don&#039;t want it for every command line, just at the start of the session, eg </p><div class="codebox"><pre><code>##
##Session begin 1 Mar 2020 16:00
##
cd /etc/apt
tail sources.list
....</code></pre></div><p>Sometimes when I&#039;ve been working on something across multiple accounts it&#039;d be nice to be able to start to follow the order a bit easier, so having the date/time I start a session would be quite nice. </p><p>I&#039;m sure someone else has done this but I cannot think of the right search terms to find the answer, nor am I familiar enough with the system to work it out myself at the moment. Everything points to sites explaining how to add a timestamp to every command but I don&#039;t want that, just session starts. </p><p>Session end would be fine as well, as it still separates each day/logon.</p><p>Much thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (Kiwi Rider)]]></author>
			<pubDate>Sun, 01 Mar 2020 03:03:40 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=20286#p20286</guid>
		</item>
	</channel>
</rss>
