<?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>Bash Archives - Vavai&#039;s Personal Notes</title>
	<atom:link href="https://www.vavai.net/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>https://vavai.net/tag/bash/</link>
	<description>Life is our precious gift</description>
	<lastBuildDate>Tue, 30 Jul 2019 21:19:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Rsyslog Warning on Docker : rsyslogd: imklog: cannot open kernel log (/proc/kmsg)</title>
		<link>https://www.vavai.net/rsyslog-warning-on-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg/</link>
					<comments>https://www.vavai.net/rsyslog-warning-on-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Tue, 30 Jul 2019 21:19:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Docker]]></category>
		<guid isPermaLink="false">https://www.vavai.net/?p=2379</guid>

					<description><![CDATA[<p>I got this warning message while building Docker images and trying to start rsyslog inside Docker : rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted. rsyslogd: activation of module imklog failed It seems that Unpriviledged cotainers do not have access to kernel log for security reasons. Despite this warning messages, rsyslog running as...</p>
<p>The post <a href="https://www.vavai.net/rsyslog-warning-on-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg/">Rsyslog Warning on Docker : rsyslogd: imklog: cannot open kernel log (/proc/kmsg)</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I got this warning message while building Docker images and trying to start rsyslog inside Docker :</p>


<pre class="wp-block-preformatted">rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted. rsyslogd: activation of module imklog failed</pre>


<p class="wp-block-paragraph">It seems that Unpriviledged cotainers do not have access to kernel log for security reasons. Despite this warning messages, rsyslog running as usual, but if you wish to make the warning dissapear, try to run Docker with &#8211;privileged parameter as below :</p>


<pre class="wp-block-code"><code>docker build --no-cache -t ubuntu-rsyslog .
docker run -it --privileged -h ub-syslog.vavai.net ubuntu-rsyslog</code></pre>
<p>The post <a href="https://www.vavai.net/rsyslog-warning-on-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg/">Rsyslog Warning on Docker : rsyslogd: imklog: cannot open kernel log (/proc/kmsg)</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/rsyslog-warning-on-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Automatically Setting Timezone on Dockerfile</title>
		<link>https://www.vavai.net/automatically-setting-timezone-on-dockerfile/</link>
					<comments>https://www.vavai.net/automatically-setting-timezone-on-dockerfile/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Tue, 30 Jul 2019 00:02:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://www.vavai.net/?p=2374</guid>

					<description><![CDATA[<p>As I lives in Indonesia, I would prefer to use GMT+7 as my selected timezone. It will make my log easier to check and also easier to find events at a certain time. Below are a sample command to set timezone on Ubuntu based docker images : ################################################################# # Dockerfile for Excellent Ubuntu Standard #...</p>
<p>The post <a href="https://www.vavai.net/automatically-setting-timezone-on-dockerfile/">Automatically Setting Timezone on Dockerfile</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">As I lives in Indonesia, I would prefer to use GMT+7 as my selected timezone. It will make my log easier to check and also easier to find events at a certain time.</p>


<p class="wp-block-paragraph">Below are a sample command to set timezone on Ubuntu based docker images :</p>


<pre class="wp-block-preformatted">#################################################################
# Dockerfile for Excellent Ubuntu Standard
# Based on Ubuntu 18.04
# Created by Masim Vavai Sugianto
#################################################################
FROM ubuntu:18.04
MAINTAINER Masim Vavai Sugianto &lt;mynickname@vavai.net&gt;
ARG DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections &amp;&amp; apt-get update &amp;&amp; apt-get install apt-utils tzdata
RUN echo "tzdata tzdata/Areas select Asia\ntzdata tzdata/Zones/Asia select Jakarta" &gt; /tmp/tz ; debconf-set-selections /tmp/tz; rm /etc/localtime /etc/timezone; dpkg-reconfigure -f noninteractive tzdata</pre>
<p>The post <a href="https://www.vavai.net/automatically-setting-timezone-on-dockerfile/">Automatically Setting Timezone on Dockerfile</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/automatically-setting-timezone-on-dockerfile/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bash Script for Replace Multiple Words in a Multiple File</title>
		<link>https://www.vavai.net/bash-script-for-replace-multiple-words-in-a-multiple-file/</link>
					<comments>https://www.vavai.net/bash-script-for-replace-multiple-words-in-a-multiple-file/#comments</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Thu, 07 Jan 2010 09:30:13 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[SUSE Family]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://v2.vavai.net/?p=977</guid>

					<description><![CDATA[<p>I&#8217;m using the following script to replace a configuration file. As example, I&#8217;m trying to create an auto-configuration for setting up PXE boot service. YAST maybe the best tools to do what I want, but YAST need a few step to do.Â  I couldÂ  make a same result with a simple task by preparing default...</p>
<p>The post <a href="https://www.vavai.net/bash-script-for-replace-multiple-words-in-a-multiple-file/">Bash Script for Replace Multiple Words in a Multiple File</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://v2.vavai.net/wp-content/uploads/2010/01/bash-script.png"></a><a href="http://54.254.121.108/wp-content/uploads/2010/01/bash-script11.png"><img decoding="async" class="alignright size-full wp-image-979" style="margin: 5px;" title="bash-script" src="http://54.254.121.108/wp-content/uploads/2010/01/bash-script11.png" alt="" width="150" height="150" /></a>I&#8217;m using the following script to replace a configuration file. As example, I&#8217;m trying to create an auto-configuration for setting up PXE boot service. YAST maybe the best tools to do what I want, but YAST need a few step to do.Â  I couldÂ  make a same result with a simple task by preparing default configuration file (the successful configuration on my server), ask some question and thenÂ  automatically replace some words with the answer.<br />
You may also use the following script on hosting service :<br />
[code language=&#8217;cpp&#8217;]<br />
#!/bin/bash<br />
search_dir=&#8221;/home/vavai/pxe-preconfig/&#8221;<br />
str=&#8221;vavai.com&#8221;<br />
repl_str=&#8221;vavai.net&#8221;<br />
for file in $(grep -l -R $str $search_dir)<br />
do<br />
sed -e &#8220;s/$str/$repl_str/ig&#8221; $file > /tmp/tempfile.tmp<br />
mv /tmp/tempfile.tmp $file<br />
echo &#8220;File has been successfully modified!&#8221; $file<br />
done<br />
echo &#8220;Done !&#8221;<br />
[/code]<br />
If you need to get the dynamic process, modify the script to ask some question and then replace the sed variable with the answer.<br />
But, how if we want to replace multiple string ? Well, it should be easy to use multiple regular expression on sed parameter as below :<br />
[code language=&#8217;cpp&#8217;]<br />
sed -e &#8220;s/$str1/$repl_str1/ig&#8221;  -e &#8220;s/$str2/$repl_str2/ig&#8221; -e &#8220;s/$str3/$repl_str3/ig&#8221;<br />
[/code]</p>
<p>The post <a href="https://www.vavai.net/bash-script-for-replace-multiple-words-in-a-multiple-file/">Bash Script for Replace Multiple Words in a Multiple File</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/bash-script-for-replace-multiple-words-in-a-multiple-file/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 24/59 objects using Disk
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d3b35uem336dgh.cloudfront.net
Lazy Loading (feed)
Minified using Disk
Database Caching 13/33 queries in 0.015 seconds using Disk

Served from: www.vavai.net @ 2026-11-04 08:02:06 by W3 Total Cache
-->