<?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>Linux &#8211; Arun&#8217;s blog</title>
	<atom:link href="https://arunns.net/category/operating-systems/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://arunns.net</link>
	<description>Arun&#039;s blog</description>
	<lastBuildDate>Mon, 23 Oct 2023 18:38:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>Change SoftHSM SO / USER Pin</title>
		<link>https://arunns.net/change-softhsm-so-user-pin/</link>
					<comments>https://arunns.net/change-softhsm-so-user-pin/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Sun, 16 Aug 2020 15:39:03 +0000</pubDate>
				<category><![CDATA[DNSSEC]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenDNSSEC]]></category>
		<category><![CDATA[SoftHSM]]></category>
		<category><![CDATA[opendnssec]]></category>
		<category><![CDATA[softhsm]]></category>
		<category><![CDATA[softhsm pin]]></category>
		<guid isPermaLink="false">https://letushare.com/?p=892</guid>

					<description><![CDATA[we&#8217;ll explore how to change these pins using the pkcs11-tool utility, assuming that you already know the existing pin. Why Change User and SO Pins? Changing your User and SO pins is an essential practice to ensure the security of your cryptographic storage. It helps safeguard your sensitive data and maintain the integrity of your [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>we&#8217;ll explore how to change these pins using the <code>pkcs11-tool</code> utility, assuming that you already know the existing pin.</p>



<p><strong>Why Change User and SO Pins?</strong></p>



<p>Changing your User and SO pins is an essential practice to ensure the security of your cryptographic storage. It helps safeguard your sensitive data and maintain the integrity of your system.</p>



<p><strong>Changing the SO Pin</strong></p>



<p>The SO pin, or Security Officer pin, is the master pin that provides access to all functions within the SoftHSM. To change it, follow these steps:</p>



<ul>
<li>Open your terminal and run the following command:</li>
</ul>



<p>pkcs11-tool &#8211;module /usr/lib64/pkcs11/libsofthsm2.so &#8211;login &#8211;login-type so &#8211;change-pin</p>



<p>Make sure to replace <code>--module</code> with the actual path to <code>libsofthsm2.so</code>.</p>



<p><strong>Changing the User Pin</strong></p>



<p>The User pin is specific to individual users and provides access to their cryptographic storage. To change it, use the following command:</p>



<ul>
<li>In your terminal, enter the following command:</li>
</ul>



<p>pkcs11-tool &#8211;module /usr/lib64/pkcs11/libsofthsm2.so &#8211;login &#8211;login-type user &#8211;change-pin</p>



<p>replace <code>--module</code> with the correct path to <code>libsofthsm2.so</code>.</p>



<p><strong>Using a Different Slot</strong></p>



<p>In some cases, you might need to work with a different slot. To specify a different slot, you can use the <code>--slot</code> option followed by the slot number. For example:</p>



<p>pkcs11-tool &#8211;module /usr/lib64/pkcs11/libsofthsm2.so &#8211;login &#8211;login-type so &#8211;change-pin &#8211;slot 1</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/change-softhsm-so-user-pin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Encrypt secondary disk &#8211; Linux</title>
		<link>https://arunns.net/encrypt-secondary-disk-linux/</link>
					<comments>https://arunns.net/encrypt-secondary-disk-linux/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Fri, 07 Aug 2020 10:33:55 +0000</pubDate>
				<category><![CDATA[Encryption]]></category>
		<category><![CDATA[File system]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Mint]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cryptsetup]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[linux disk encryption]]></category>
		<guid isPermaLink="false">http://letushare.com/?p=877</guid>

					<description><![CDATA[To set up cryptographic volumes, you need to back up the data first and restore data after the encryption is setup. rsync -Pav &#60;source/> &#60;backup_destination/> Once the backup is completed, install cryptsetupsudo apt install cryptsetup Create the encrypted partitionsudo cryptsetup --verbose --verify-passphrase luksFormat &#60;device_name>Provide passphrase once prompted, you could use fdisk -l to find the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>To set up cryptographic volumes, you need to back up the data first and restore data after the encryption is setup.<br><br><code>rsync -Pav &lt;source/> &lt;backup_destination/></code><br><br>Once the backup is completed, install cryptsetup<br><code>sudo apt install cryptsetup</code><br><br>Create the encrypted partition<br><code>sudo cryptsetup --verbose --verify-passphrase luksFormat &lt;device_name></code><br>Provide passphrase once prompted, you could use fdisk -l to find the correct device.<br><br>Open the encrypted device<br><code>sudo cryptsetup luksOpen /dev/vdb1 vdb1</code> # the device name was vdb1 in my case<br>This will prompt the passphrase to open the device<br><br>Create the required file system<br><code>mkfs.ext4 /dev/mapper/vdb1</code><br><br>You could remove the ext4 reservation if not required<br><code>tune2fs -m 0 /dev/mapper/vdb1</code><br><br>Create mount directory<br><code>mkdir /mnt/secondary</code><br><br>Mount the device<br><code>mount /dev/mapper/vdb1 /mnt/secondary</code><br><br></p>



<p></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/encrypt-secondary-disk-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>#git switch to branch without merge on local repo</title>
		<link>https://arunns.net/git-switch-to-branch-without-merge/</link>
					<comments>https://arunns.net/git-switch-to-branch-without-merge/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Thu, 23 Jul 2020 12:13:44 +0000</pubDate>
				<category><![CDATA[GIT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MAC OS X]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git branch]]></category>
		<category><![CDATA[git checkout]]></category>
		<category><![CDATA[git pull branch]]></category>
		<guid isPermaLink="false">http://arunns.com/?p=872</guid>

					<description><![CDATA[To switch from master to a branch or branch to another without merge. git branch*master $ git fetch origin &#60;new_branch> $ git checkoutBranch legacy set up to track remote branch legacy from origin.Switched to a new branch ‘new_branch' $ git pull $ git branch* new_branchmaster]]></description>
										<content:encoded><![CDATA[
<p>To switch from master to a branch or branch to another without merge.<br><br><code>git branch<br>*ma</code>ster<br><br><code>$ git fetch origin &lt;new_branch></code></p>



<p><code>$ git checkout<br>Branch legacy set up to track remote branch legacy from origin.<br>Switched to a new branch ‘new_branch'</code></p>



<p><code>$ git pull</code></p>



<p><code>$ git branch</code><br><code>* new_branch<br>master<br></code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/git-switch-to-branch-without-merge/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>git # move directory or file</title>
		<link>https://arunns.net/git-move-directory-or-file/</link>
					<comments>https://arunns.net/git-move-directory-or-file/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Wed, 22 Jul 2020 07:06:20 +0000</pubDate>
				<category><![CDATA[GIT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MAC OS X]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git mv]]></category>
		<category><![CDATA[gitlab]]></category>
		<guid isPermaLink="false">http://arunns.com/?p=867</guid>

					<description><![CDATA[Move or rename a file, a directory, or a symlink # clone the repogit clone &#60;repo-url>git mv &#60;source_file_or_directory> &#60;destination>git status # will show the change detailsgit commit -am "comment_for_the_change"git push # push changes to repo]]></description>
										<content:encoded><![CDATA[
<p>Move or rename a file, a directory, or a symlink</p>



<p># clone the repo<br><code>git clone &lt;repo-url></code><br><code>git mv &lt;source_file_or_directory> &lt;destination></code><br><code>git status</code> # will show the change details<br><code>git commit -am "comment_for_the_change"</code><br><code>git push</code> # push changes to repo<br></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/git-move-directory-or-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>DNSSEC with BIND 9.10 and native PKCS#11</title>
		<link>https://arunns.net/dnssec-with-bind-9-10-and-native-pkcs11/</link>
					<comments>https://arunns.net/dnssec-with-bind-9-10-and-native-pkcs11/#comments</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Mon, 18 Jan 2016 13:10:49 +0000</pubDate>
				<category><![CDATA[BIND]]></category>
		<category><![CDATA[DNSSEC]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind 9.10]]></category>
		<category><![CDATA[dnssec]]></category>
		<category><![CDATA[dnssec-keyfromlabel]]></category>
		<category><![CDATA[dnssec-signzone]]></category>
		<category><![CDATA[native pkcs#11]]></category>
		<category><![CDATA[pkcs11]]></category>
		<category><![CDATA[pkcs11-keygen]]></category>
		<category><![CDATA[softhsm]]></category>
		<category><![CDATA[softhsm2-util]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=849</guid>

					<description><![CDATA[DNSSEC with BIND and native PKCS#11 support (BIND &#38; SoftHSM) Bind 9.10.0-P1 supports the native PKCS#11 mode, instead of the openssl based PKCS#11. You can either compile it with (./configure --enable-native-pkcs11 \ --with-pkcs11=provider-library-path) or install prebuilt packages. Upon writing this blog, Fedora 23, has built-in bind-9.10.3-7.P2 and SoftHSM (Software based HSM) SoftHSM is an implementation [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>DNSSEC with BIND and native PKCS#11 support (BIND &amp; SoftHSM)</strong></p>
<p>Bind 9.10.0-P1 supports the native PKCS#11 mode, instead of the openssl based PKCS#11. You can either compile it with (<code>./configure --enable-native-pkcs11 \<br />
--with-pkcs11=provider-library-path</code>) or install prebuilt packages.</p>
<p>Upon writing this blog, Fedora 23, has built-in bind-9.10.3-7.P2 and <a href="https://www.opendnssec.org/softhsm/" target="_blank" rel="noopener">SoftHSM</a> (Software based HSM)</p>
<p><a href="https://www.opendnssec.org/softhsm/" target="_blank" rel="noopener">SoftHSM</a> is an implementation of a cryptographic store accessible through a PKCS #11 interface</p>
<p><strong>Install the required packages</strong></p>
<p># <code><a href="https://de.wikipedia.org/wiki/DNF_%28Dandified_Yum%29" target="_blank" rel="noopener">dnf</a> install bind-chroot bind-pkcs11 softhsm bind-pkcs11-utils </code></p>
<p>bind-chroot-32:9.10.3-7.P2.fc23.x86_64<br />
bind-pkcs11-9.10.3-7.P2.fc23.x86_64<br />
softhsm-2.0.0rc1-3.fc23.x86_64<br />
bind-pkcs11-utils-9.10.3-7.P2.fc23.x86_64</p>
<p><strong>Initialize the SoftHSM repository</strong><br />
<code># softhsm2-util --init-token 0 --slot 0 --label softhsm</code><br />
enter the user and security pin</p>
<p><strong>Generate the keys (Key Signing Key and Zone Signing Key)</strong></p>
<p>You may use the algorithm and key size depends on your requirement.<br />
<code># pkcs11-keygen -a RSASHA256 -b 2048 -l sample_ksk</code><br />
Enter Pin:<br />
<code># pkcs11-keygen -a RSASHA256 -b 2048 -l sample_zsk</code><br />
Enter Pin:</p>
<p><code># pkcs11-list<br />
Enter Pin:<br />
object[0]: handle 2 class 2 label[12] 'sample_ksk' id[0]<br />
object[1]: handle 3 class 2 label[12] 'sample_ksk' id[0]<br />
object[2]: handle 4 class 3 label[12] 'sample_zsk' id[0]<br />
object[3]: handle 5 class 3 label[12] 'sample_zsk' id[0]</code></p>
<p>Create a pair of BIND9 key files using dnssec-keyfromlabel-pkcs11 utility, since we are using pkcs#11 backend the label must be <a href="https://tools.ietf.org/html/rfc7512" target="_blank" rel="noopener">pkcs#11 uri</a> format. Don&#8217;t know how safe it is to store the pin on the file system, but yes we have to create a text file with the HSM pin. Not sure if the dnssec-keyfromlabel can prompt for the pin.<br />
<code><br />
# dnssec-keyfromlabel-pkcs11 -a RSASHA256 -f KSK -l 'pkcs11:object=sample_ksk;pin-source=/etc/token_pin' example.com<br />
Kexample.com.+005+46938.key<br />
# dnssec-keyfromlabel-pkcs11 -a RSASHA256 -l 'pkcs11:object=sample_zsk;pin-source=/etc/token_pin' example.com<br />
Kexample.com.+005+46939.key</code></p>
<p>The resulting files can be used to sign the zone, as per the BIND documentation &#8211; &#8220;Unlike the normal K* files, which contain both public and private key data, these files will contain only the public key data, plus an identifier for the private key which remains stored within the HSM. Signing with the private key takes place inside the HSM.&#8221;</p>
<p>Include the keys in zone file or specify the key path on the named configuration.<br />
<code><br />
echo "$INCLUDE Kexample.com.+005+46938.key" &gt;&gt; example.com.zone<br />
echo "$INCLUDE Kexample.com.+005+46939.key" &gt;&gt; example.com.zone</code></p>
<p><code><strong>Signing the zones</strong><br />
# dnssec-signzone-pkcs11 example.com<br />
Verifying the zone using the following algorithms: RSASHA2.<br />
Zone fully signed:<br />
Algorithm: RSASHA2: KSKs: 1 active, 0 stand-by, 0 revoked<br />
ZSKs: 1 active, 0 stand-by, 0 revoked<br />
</code><br />
<code># head example.com.signed<br />
; File written on Mon Jan 18 16:02:19 2016<br />
; dnssec_signzone version 9.10.3-P2-RedHat-9.10.3-7.P2.fc23</code></p>
<p>Reference: <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0ahUKEwiO5o6RtrPKAhVFPBQKHWx_B2AQFggcMAA&amp;url=https%3A%2F%2Fftp.isc.org%2Fisc%2Fbind9%2F9.10.3-P2%2Fdoc%2Farm%2FBv9ARM.pdf&amp;usg=AFQjCNH7Rqjh2_YNcb073tymT7RmyCGz4g&amp;bvm=bv.112064104,d.d24" target="_blank" rel="noopener">BIND 9 Administrator Reference Manual</a><br />
<a href="https://ftp.isc.org/isc/bind/cur/9.10/doc/arm/Bv9ARM.ch04.html" target="_blank" rel="noopener"> https://ftp.isc.org/isc/bind/cur/9.10/doc/arm/Bv9ARM.ch04.html</a><br />
<a href="https://wiki.opendnssec.org/display/SoftHSMDOCS/SoftHSM+Documentation+v2.0" target="_blank" rel="noopener">SoftHSM documentation</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/dnssec-with-bind-9-10-and-native-pkcs11/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Setup GeoIP (PECL) for piwik geolocation and updating old visits</title>
		<link>https://arunns.net/setup-geoip-pecl-for-piwik-geolocation-and-updating-old-visits/</link>
					<comments>https://arunns.net/setup-geoip-pecl-for-piwik-geolocation-and-updating-old-visits/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Wed, 26 Feb 2014 09:35:17 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Setup GeoIP (PECL) for piwik geolocation and updating old visits]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=789</guid>

					<description><![CDATA[GeoIP is the recommended way to accurately determine the location of the visitor, by default geolocation settings may provide in accurate result. To enable GeoIP(PECL) from redhat/centos machines: # yum install php-pecl-geoip #apachectl restart # php -m &#124; grep -i geo geoip From Piwik, Settings &#8211;> Geolocation &#8211;> GeoIP (PECL) To reindex the old visits: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>GeoIP is the recommended way to accurately determine the location of the visitor, by default geolocation settings may provide in accurate result.</p>
<p>To enable GeoIP(PECL) from redhat/centos machines:<br />
<code># yum install php-pecl-geoip</code><br />
<code>#apachectl restart</code><br />
<code># php -m | grep -i geo<br />
geoip</code></p>
<p>From Piwik, Settings &#8211;> Geolocation &#8211;> GeoIP (PECL)</p>
<p>To reindex the old visits:<br />
<code># cd misc/others<br />
# php ./geoipUpdateRows.php<br />
[note] Found working provider: geoip_pecl<br />
90094 rows to process in piwik_log_visit and piwik_log_conversion....<br />
.<br />
.<br />
.<br />
100% done!</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/setup-geoip-pecl-for-piwik-geolocation-and-updating-old-visits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>download rtmp videos</title>
		<link>https://arunns.net/download-rtmp-videos/</link>
					<comments>https://arunns.net/download-rtmp-videos/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Sun, 16 Feb 2014 21:26:48 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Download RTMP videos]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=785</guid>

					<description><![CDATA[To download RTMP (http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol) videos, # apt-get install rtmpdump $ rtmpdump -r < rtmp://url/ > -o < output_file.mp4 > eg: $ rtmpdump -r rtmp://foobar.com/mp4:videos/123/foo.mp4" -o foo.mp4]]></description>
										<content:encoded><![CDATA[<p>To download RTMP (http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol) videos,</p>
<p><code># apt-get install rtmpdump<br />
$ rtmpdump -r < rtmp://url/ > -o < output_file.mp4 ></code></p>
<p><code>eg:<br />
$ rtmpdump -r rtmp://foobar.com/mp4:videos/123/foo.mp4" -o foo.mp4</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/download-rtmp-videos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Send attachments from command line with mutt</title>
		<link>https://arunns.net/send-attachments-from-command-line-with-mutt/</link>
					<comments>https://arunns.net/send-attachments-from-command-line-with-mutt/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Thu, 13 Feb 2014 08:54:49 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell script]]></category>
		<category><![CDATA[Send attachments from command line with mutt]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=783</guid>

					<description><![CDATA[To send e-mails from command line with attachments using mutt. Set the from address with EMAIL= -s &#8211; Subject -a &#8211; attachment file recipient name -c &#8211; for CC -b &#8211; for BCC create a text file (eg: /tmp/testmessage) , with the body of the message. EMAIL="foo@bar" mutt -s "Subject" -a test.doc foo1@bar -c foo2@bar [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>To send e-mails from command line with attachments using mutt.</p>
<p>Set the from address with EMAIL=<br />
-s &#8211; Subject<br />
-a &#8211; attachment file<br />
recipient name<br />
-c &#8211; for CC<br />
-b &#8211; for BCC<br />
create a text file (eg: /tmp/testmessage) , with the body of the message.</p>
<p><code>EMAIL="foo@bar" mutt -s "Subject" -a test.doc foo1@bar -c foo2@bar  < /tmp/testmessage
</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/send-attachments-from-command-line-with-mutt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create bootable USB on OSX</title>
		<link>https://arunns.net/create-bootable-usb-on-osx/</link>
					<comments>https://arunns.net/create-bootable-usb-on-osx/#respond</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Sun, 26 Jan 2014 18:45:49 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MAC OS X]]></category>
		<category><![CDATA[Create bootable USB on OSX]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=779</guid>

					<description><![CDATA[&#8211; Identify the disk number for the USB disk inserted, usually you can find it from the &#8220;Name&#8221; and &#8220;Size&#8221; field. Below eg: , We inserted a USB with 4.1 GB size (so as the identified: &#8220;disk2&#8221;.) Open terminal and execute the following commands: sh-3.2$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>&#8211; Identify the disk number for the USB disk inserted, usually you can find it from the &#8220;Name&#8221; and &#8220;Size&#8221; field.<br />
Below eg: , We inserted a USB with 4.1 GB size (so as the identified: &#8220;disk2&#8221;.)<br />
Open terminal and execute the following commands:</p>
<p>sh-3.2$ diskutil list<br />
/dev/disk0<br />
#:                       TYPE NAME                    SIZE       IDENTIFIER<br />
0:      GUID_partition_scheme                        *120.0 GB   disk0<br />
1:                        EFI EFI                     209.7 MB   disk0s1<br />
2:          Apple_CoreStorage                         119.0 GB   disk0s2<br />
3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3<br />
/dev/disk1<br />
#:                       TYPE NAME                    SIZE       IDENTIFIER<br />
0:                  Apple_HFS Macintosh HD           *118.7 GB   disk2<br />
/dev/disk2<br />
#:                       TYPE NAME                    SIZE       IDENTIFIER<br />
0:                            UNTITLED        *4.1 GB     disk2</p>
<p>&#8211; Unmount the disk<br />
sh-3.2$ diskutil unmountDisk /dev/disk3<br />
Unmount of all volumes on disk3 was successful</p>
<p>&#8211; write the ISO file to USB using dd command<br />
sh-3.2$ sudo dd if=Downloads/ubuntu-12.04.3-desktop-i386.iso of=/dev/disk2 bs=1m<br />
Password:<br />
707+0 records in<br />
707+0 records out<br />
741343232 bytes transferred in 139.059398 secs (5331126 bytes/sec)</p>
<p>&#8211; Unmount the disk<br />
sh-3.2$ diskutil eject /dev/disk3<br />
Disk /dev/disk3 ejected</p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/create-bootable-usb-on-osx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Virus scanning for file uploads with clamav/php</title>
		<link>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/</link>
					<comments>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/#comments</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Sat, 20 Apr 2013 12:29:44 +0000</pubDate>
				<category><![CDATA[Clamav]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[integrate antivirus with uploads]]></category>
		<category><![CDATA[LibClamAV Error: cl_load(): Can't get status of /var/lib/clamav]]></category>
		<category><![CDATA[php-clamav]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=751</guid>

					<description><![CDATA[Download and install the following packages, in case your repository has those package just use the management tool to install. Ubuntu/Debian/Mint # apt-get install clamav clamav-db clamd clamav-devel php-devel Redhat # yum install php-devel # wget http://pkgs.repoforge.org/clamav/clamav-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamd-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.7-1.el5.rf.i386.rpm # rpm -Uvh clam* # freshclam # service clamd [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Download and install the following packages, in case your repository has those package just use the management tool to install.</p>
<p>Ubuntu/Debian/Mint</p>
<blockquote><p># apt-get install clamav clamav-db clamd clamav-devel php-devel</p></blockquote>
<p>Redhat</p>
<blockquote><p># yum install php-devel<br />
# wget http://pkgs.repoforge.org/clamav/clamav-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamd-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.7-1.el5.rf.i386.rpm<br />
# rpm -Uvh clam*<br />
# freshclam<br />
# service clamd start</p></blockquote>
<p><strong>Configure php-clamav</strong></p>
<p>Download php-clamav from from sf.net</p>
<blockquote><p># wget http://downloads.sourceforge.net/project/php-clamav/0.15/php-clamav_0.15.7.tar.gz<br />
# tar xvzf php-clamav_0.15.7.tar.gz<br />
# cd php-clamav-0.15.7/<br />
# phpize<br />
#./configure &#8211;with-clamav<br />
# make<br />
# cp modules/clamav.so /usr/lib/php/modules/</p></blockquote>
<p>Add the modules to php.ini if required.</p>
<blockquote><p>extension=clamav.so</p></blockquote>
<p>Make sure the module is loaded</p>
<blockquote><p># php -i | grep -i clam<br />
clamav</p></blockquote>
<p>Incase you see the following error create a symlink to clamav path<br />
LibClamAV Error: cl_load(): Can&#8217;t get status of /var/lib/clamav</p>
<blockquote><p># ln -s /var/clamav /var/lib/clamav</p></blockquote>
<p>Test script<br />
Get the testing virus file from http://www.eicar.org/86-0-Intended-use.html and save it on a file (eg: /tmp/virus.txt)</p>
<p>Create a php script:<br />
cat &gt; check_virus.php<br />
<!--?php $file = '/tmp/virus.txt'; $retcode = cl_scanfile($file, $virusname); if ($retcode == CL_VIRUS) { echo ."Virus found name : ".$virusname; } else { echo .cl_pretcode($retcode); } ?--></p>
<blockquote><p>&lt;?php<br />
$file = &#8216;/tmp/testing.txt&#8217;;<br />
$retcode = cl_scanfile($file, $virusname);<br />
if ($retcode == CL_VIRUS) {<br />
echo .&#8221;Virus found name : &#8220;.$virusname;<br />
} else {<br />
echo .cl_pretcode($retcode);<br />
}<br />
?&gt;</p>
<p>$ php check_virus.php<br />
Virus found name : Eicar-Test-Signature</p></blockquote>
<p>./arun</p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
