<?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>Plugged.in</title>
	<atom:link href="http://www.plugged.in/feed" rel="self" type="application/rss+xml" />
	<link>http://www.plugged.in</link>
	<description>I.T. Resources for I.T. Professionals</description>
	<lastBuildDate>Thu, 17 May 2012 22:19:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CSS3 Borders &#8211; What&#8217;s New ?</title>
		<link>http://www.plugged.in/programm-in/web-developer/css3-borders-whats-new.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-borders-whats-new</link>
		<comments>http://www.plugged.in/programm-in/web-developer/css3-borders-whats-new.html#comments</comments>
		<pubDate>Thu, 17 May 2012 21:58:56 +0000</pubDate>
		<dc:creator>polatahmet</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[border-image]]></category>
		<category><![CDATA[border-radius]]></category>
		<category><![CDATA[box-shadow]]></category>
		<category><![CDATA[cascading stylesheets]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=413</guid>
		<description><![CDATA[Hi there, it&#8217;s me again. Today, i&#8217;m gonna talk about CSS3 border features. By using CSS3, you can; create rounded borders (it was really a big problem cause we had to use images or junk javascript libraries) box shadows (it was also a big problem) use image files as border without using a design program [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there, it&#8217;s me again.</p>
<p>Today, i&#8217;m gonna talk about CSS3 border features.</p>
<p>By using CSS3, you can;</p>
<ul>
<li>create rounded borders (it was really a big problem cause we had to use images or junk javascript libraries)</li>
<li>box shadows (it was also a big problem)</li>
<li>use image files as border</li>
</ul>
<p>without using a design program like Adobe Photoshop or some javascript plugins.</p>
<p>&nbsp;</p>
<h4>CSS3 Rounded Corners</h4>
<p>In CSS3 creating rounded borders is a piece of cake. Just apply following css code to your elements.</p>
<p>Usage:</p>
<blockquote><p>-webkit-border-radius: 5px 5px 3px 3px;</p>
<p>-moz-border-radius: 5px 5px 3px 3px;<br />
-ms-border-radius: 5px 5px 3px 3px;<br />
-o-border-radius: 5px 5px 3px 3px;</p>
<p>border-radius: 5px 5px 3px 3px;</p></blockquote>
<p>Syntax:</p>
<blockquote><p>border-radius: top-left-radius, top-right-radius, bottom-right-radius, bottom-left-radius;</p></blockquote>
<p>You can see there are various codes for each browser.</p>
<p>Briefly,</p>
<p>Mozilla Firefox needs &#8220;-moz-&#8221; prefix,</p>
<p>Chrome and Safari needs &#8220;-webkit-&#8221; prefix,</p>
<p>Opera needs &#8220;-o-&#8221; prefix,</p>
<p>Internet Explorer needs &#8220;-ms-&#8221; prefix (will be deprecated),</p>
<p>and for last &#8220;border-radius&#8221; code is used for general CSS3 border styling.</p>
<h4>CSS3 Box Shadow</h4>
<p>With CSS3 you can use &#8220;box-shadow&#8221; property to add shadow to boxes.</p>
<p>Usage:</p>
<blockquote><p>-webkit-box-shadow: 0 0 5px #d5d5d5;<br />
-moz-box-shadow: 0 0 5px #d5d5d5;<br />
box-shadow: 0 0 5px #d5d5d5;</p></blockquote>
<p>Syntax:</p>
<blockquote><p>box-shadow: <em>h-shadow v-shadow blur spread color</em> inset;</p></blockquote>
<p>As you see, you should add &#8220;-webkit-&#8221; prefix for Safari and Chrome, &#8220;-moz-&#8221; prefix for Mozilla Firefox and lastly &#8220;box-shadow&#8221; property for general CSS3 Shadow effects.</p>
<p>Syntax:</p>
<blockquote><p>box-shadow: (horizontal dimension of shadow, can be a negative value), (vertical dimension of shadow, also can be a negative value), (shadow blur amount), (hex code of shadow color)</p></blockquote>
<h4>CSS3 Border Image</h4>
<p>To create border images for your elements, you should use border-image property.</p>
<p>Right now, Internet Explorer does not support border-image property.</p>
<p>For other browsers you should add prefixes just like other border properties(ex. &#8220;-moz-&#8221;, &#8220;-webkit-&#8221;, &#8220;-o-&#8221;)</p>
<p>Usage:</p>
<blockquote><p>-moz-border-image:url(border.png) 30 30 round;<br />
-webkit-border-image:url(border.png) 30 30 round;<br />
-o-border-image:url(border.png) 30 30 round;<br />
border-image:url(border.png) 30 30 round;</p></blockquote>
<p>Syntax:</p>
<blockquote><p>border-image: <em>source slice width outset repeat</em>;</p></blockquote>
<p>border-image-source: the path to the border image file.</p>
<p>border-image-slice: inward offsets of the border image.</p>
<p>border-image-width: width of border image.</p>
<p>border-image-outset: the amount by which the border image area extends beyond the border box.</p>
<p>border-image-repeat: type of repetition, repeat, round, stretch.</p>
<p>&nbsp;</p>
<p>That&#8217;s all for now.</p>
<p>I&#8217;ll tell more about javascript equivalents of CSS border properties for fallback support  and other CSS3 features later.</p>
<p>Enjoy your CSS3 styles, and have a nice day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/programm-in/web-developer/css3-borders-whats-new.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Generation in UNIX</title>
		<link>http://www.plugged.in/linux/linux_help/password-generation-in-unix.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=password-generation-in-unix</link>
		<comments>http://www.plugged.in/linux/linux_help/password-generation-in-unix.html#comments</comments>
		<pubDate>Thu, 17 May 2012 09:35:41 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[password bash python md5]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=410</guid>
		<description><![CDATA[Below I&#8217;ll describe a couple of nice methods to generate passwords using Python and Bash. Actually there are a lot of ways you can accomplish this especially with bash, but using the /dev/urandom file seems to be the most clever one. The /dev/urandom device doesn&#8217;t only generate read-friendly characters, so it&#8217;s best to filter out [...]]]></description>
			<content:encoded><![CDATA[<p>Below I&#8217;ll describe a couple of nice methods to generate passwords using Python and Bash.</p>
<p>Actually there are a lot of ways you can accomplish this especially with bash, but using the <strong>/dev/urandom</strong> file seems to be the most clever one.</p>
<p>The <strong>/dev/urandom</strong> device doesn&#8217;t only generate read-friendly characters, so it&#8217;s best to filter out the ones we&#8217;d like. The best tool for that would be <strong>tr</strong>.</p>
<p><strong>$ cat /dev/urandom | tr -dc [:alnum:] | head -c 10</strong></p>
<p>This will generate a password from 10 alphanumeric characters.</p>
<p>It will not include some characters though, such as <strong>. ! &#8211; _</strong> which are useful for passwords. So this line would be a little more &#8220;secure&#8221;.</p>
<p><strong>$ cat /dev/urandom | tr -cd &#8220;[:alnum:]\.\-_\!&#8221; | head -c 10<br />
</strong><br />
To generate a password in Python, using the <strong>string</strong> and <strong>random</strong> module would be a clever touch. Let&#8217;s try something like this,</p>
<blockquote><p>>>> import string, random<br />
>>> def passgen(length) :<br />
&#8230;     keys = list(string.ascii_letters + string.digits)<br />
&#8230;     return &#8220;&#8221;.join(random.choice(keys) for i in range(length)
</p></blockquote>
<p>With this definition of the passgen function, we can generate alphanumeric passwords with whatever length we want. If you&#8217;d like to include all characters available, try the one below:</p>
<blockquote><p>>>> import string, random<br />
>>> def passgen(length) :<br />
&#8230;     keys = list(string.ascii_letters + string.digits + &#8220;.,;:-_()@\&#8221;\\[]?!&#8217;^+*$%&#038;/=~`<>|&#8221;)<br />
&#8230;     return &#8220;&#8221;.join(random.choice(keys) for i in range(length)</p></blockquote>
<p>A sample output :</p>
<blockquote><p>>>> passgen(16)<br />
&#8216;pP!3p&#8221;(-uxdIqpAK&#8217;</p></blockquote>
<p>You can find some methods of password generation using MD5 algorithms. For example for password generation in MySQL some people prefer this method;</p>
<p><strong>>SELECT SUBSTRING(MD5(RAND()) FROM 1 FOR 5)</strong></p>
<p>But this will generate very very weak passwords, no uppercase characters and a lot of characters missing, not even to mention the non-alpha numeric characters. Also you&#8217;ll have a limit for maximum character number since the MD5 algorithm has a limit for it. So it&#8217;s best to stay away from the md5 approach for password generation. Some people also use it for bash password generation too (which is wrong! due to same reasons)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/linux_help/password-generation-in-unix.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nmap : Scanning Methods</title>
		<link>http://www.plugged.in/network/nmap-scanning-methods.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nmap-scanning-methods</link>
		<comments>http://www.plugged.in/network/nmap-scanning-methods.html#comments</comments>
		<pubDate>Mon, 07 May 2012 14:27:42 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scan]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tcp]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=394</guid>
		<description><![CDATA[Earlier we&#8217;ve discussed <a href="http://www.plugged.in/network/nmap-target-specification-in-detail.html" title="Nmap : Target Specification in Detail">target specification</a> in detail. But it is almost as import to choose your method to scan the target host. Nmap can scan in various algorithms, we should choose wisely considering the network, operating system and firewalls. Even though we usually don&#8217;t know what network architecture [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier we&#8217;ve discussed <a href="http://www.plugged.in/network/nmap-target-specification-in-detail.html" title="Nmap : Target Specification in Detail">target specification</a> in detail. But it is almost as import to choose your method to scan the target host. Nmap can scan in various algorithms, we should choose wisely considering the network, operating system and firewalls. Even though we usually don&#8217;t know what network architecture or operating system the target is affiliated to, these methods are also useful for determining such information.</p>
<p>To understand the background of scanning, we should know some basic thing about the &#8220;three-way handshake&#8221; that occurs during a network connection. The three-way handshake is another way of describing the SYN/ACK method. When a computer sends a &#8220;Hello&#8221; signal to a target machine, it actually sends a SYN packet. After receiving this packet, if the target is listening, it will normally respond with a SYN/ACK packet. When the first computer receives this SYN/ACK packet, it will respond back to the target machine with an ACK packet. This way, the three-way handshake is accomplished.</p>
<p>The SYN/ACK handshake is analogously described by talking on the phone (back on the old days when there weren&#8217;t caller id&#8217;s!). When we dial some number, we basically send a SYN signal, when the target answers the phone saying &#8220;Hello?&#8221;, it actually is a SYN/ACK packet, meaning &#8220;I&#8217;m listening?&#8221;, after that when we introduce ourselves as in &#8220;Hi, I&#8217;m calling from VeriTeknik&#8221;, then we&#8217;re sending the last ACK packet.</p>
<p>Now since we understand what SYN, SYN/ACK and ACK means, we can start digging around with nmap and see what it uses these information for.<br />
By the way, for what it&#8217;s worth, SYN stands for <em>synchronize</em> and ACK stands for <em>acknowledge</em>.</p>
<p><strong>The TCP Scan</strong></p>
<p>Like we&#8217;ve discussed earlier in our target specification post, nmap executes a TCP scan with the <strong>-sT</strong> option. A TCP scan is accomplished with the full three-way handshake, meaning that when we ask nmap to execute a TCP scan on a port on some target, it will send a SYN, wait for the SYN/ACK and send back the ACK, after these, it will tell us that the port is open (or closed). Since we&#8217;re going all the way through with the three-way handshake in this method, even though it seems the most reliable one on standard targets (not behind firewall etc.) it has the slightest possibility to flood the target.</p>
<p>Here&#8217;s is the basic command to perform one.</p>
<p><strong>$ nmap -sT 10.20.30.40</strong></p>
<p><strong>The SYN Scan</strong></p>
<p>This is the most popular scan type of nmap. In fact, it is also the default option on nmap, meaning if you don&#8217;t specify any scan type, nmap will use the default SYN scan method.</p>
<p>The SYN scan is popular because it is faster. This comes from the fact that it doesn&#8217;t complete the three-way handshake. It only goes through the two steps of the handshake, first sending the SYN packet, waiting for a SYN/ACK packet, after this, instead of sending an ACK packet, it sends an RST (<em>reset</em>) packet, which tells the target to disregard any previous packets and close the connection between the two machines. The advantage of this is that the RST packet is much smaller than the ACK packet. Even though it may sound like one tiny packet won&#8217;t change much, when you add up hundreds (or thousands) of ports on multiple hosts, tiny packets do matter! Also, sending less information to the target always means less possibility to flood it.</p>
<p><strong>$ nmap -sS 10.20.30.40<br />
$ nmap 10.20.30.40</strong></p>
<p><strong>The UDP Scan</strong></p>
<p>Overlooking the UDP scanning technique is a common rookie mistake. Even though most services use the TCP ports today, UDP ports are still essential and cause security vulnerabilities. Also, UDP ports are as useful as TCP ports for getting information on the system.</p>
<p>Note that both TCP and SYN scanning use the TCP method of connection. There are basically two methods for computers to communicate, either the TCP (<em>Transmission Control Protocol</em>) or the UDP (<em>User Datagram Protocol</em>). TCP ensures that the packets sent from one computer to another arrive at the receiver intact and in the order they were sent. But, UDP has no such mechanism, it just sends the data and we never know whether it arrived to the target or not. There are many advantages and disadvantages between the two technologies including speed, reliability, error checking etc. The important thing is to know which one to use under your case.</p>
<p>Comparing the UDP scan to our analogous example of the phone call, it is often described with a mailing system. It is like when we write a mail (not an e-mail, the regular ones!), put a stamp on it, no return address and put it in the mailbox. Maybe sometime the post officer will pick it up, deliver it to the address. You&#8217;ll never know if the mail reached its destination or not, and the receiver might not know the origin.</p>
<p><strong>$ nmap -sU 10.20.30.40</strong></p>
<p>Don&#8217;t forget that even though people tend to think that services run on TCP ports, a lot of them still stick with the UDP ones, such as DNS, DHCP, SNMP, or TFTP.</p>
<p><strong>The Xmas Scan</strong></p>
<p>This scan method is based on the technical descriptions on the RFC 793 (page 65) of TCP. If the target operating system is bound to the RFC, then when dealing with TCP connections it should obey the following two rules.</p>
<p><strong>* If a closed port receives a packet that doesn&#8217;t have a SYN, ACK or RST flag, the port should respond with an RST packet of its own.<br />
* If an open port receieves a packet that doesn&#8217;t have a SYN, ACK or RST flag, the packet should be ignored.</strong></p>
<p>So, according to these rules, if a send a packet that doesn&#8217;t contain any one of SYN, ACK and RST, and if the relevant port does not answer back, that port should be open. So when we tell Nmap to perform a Xmas scan on a target, it simply sends FIN, PSH and URG packet flags on. The name Xmas comes from the fact that it has so many flags set to &#8220;on&#8221; as if it lights like a Christmas tree!</p>
<p>The problem with this scan type is that we <em>assume</em> the target operating system fully complies with the RFC standard of the TCP. Linux and Unix operating systems do, but Microsoft operating systems don&#8217;t. Ironically this makes Linux systems vulnerable to this scan type.</p>
<p><strong>$ nmap -sX -p- -PN 10.20.30.40</strong></p>
<p><strong>Null Scan</strong></p>
<p>This type of scanning is almost the same with the Xmas scanning method. Instead of switching some of the flags &#8220;on&#8221;, with the Null scan, Nmap switches everything &#8220;off&#8221;. This way, the closed ports will respond with a RST flag. (if the operating system complies with the RFC standards)</p>
<p>These type of scans are important when scanning a system behind firewalls. Some firewalls block communication establishment by filtering SYN packets. Since our scanning packets with the Xmas and Null scans don&#8217;t have a SYN packet, the firewall won&#8217;t filter it. Well, bear in mind that since we don&#8217;t have a SYN packet, it is not possible to establish a connection, but the point is scanning for ports, and that is possible without a SYN packet!</p>
<p><strong>$ nmap -sN -p- -PN 10.20.30.40</strong></p>
<p><strong>FIN Scan</strong></p>
<p>This is also almost the same with Xmas and Null scans, this time, nmap only sends the packet with the FIN flag &#8220;on&#8221;.</p>
<p><strong>$ nmap -sF -p- -PN 10.20.30.40</strong></p>
<p><strong>ACK Scan</strong></p>
<p>This scan type does <em>not</em> directly look for open ports. Instead it tests whether our ACK packets reach the ports or not. By default, it only has the ACK flag set. An unfiltered (ex. no firewall) system would return with RST packets when an ACK packet reaches it, regardless of the port state being open or closed. If a port doesn&#8217;t respond, or it responds with ICMP error messages, nmap will label it as filtered, if the port responds with an RST packet, it will be labeled as &#8220;reachable&#8221;. Detecting if reachable ports are open or not, is not checked by this scan. This type of scan is very useful to check the security of a target.</p>
<p><strong>$ nmap -sA -p- -PN 10.20.30.40</strong></p>
<p><strong>Window Scan</strong></p>
<p>This one is similar to the ACK scan, but categorizes the port filtered or unfiltered depending on the value the returning package&#8217;s RST flag is. On some systems open ports have a positive window size, but the closed ports have a window size equal to zero. So when a port replies RST, instead of labeling it as unfiltered (like it does in ACK scan), nmap will read the TCP Window value of the RST package. If the value is zero, the port is filtered, if it has a positive value, it is labeled as unfiltered. This type of scan does not work on most of the systems. In fact, if most of the ports you scan from 1000 ports are open, and only a few are closed, it is possible that the values are incorrect, the few closed ones might be the open ports and the open labeled ones might be the closed ones.<br />
So, things can get the other-way around, use the feedback with caution!</p>
<p><strong>$ nmap -sW -p- -PN 10.20.30.40</strong></p>
<p><strong>Additional Options for Detailed Information</strong></p>
<p>Lastly, there are a few options to remember that can give us great detail about the target system.</p>
<p><strong>Version detection :</strong> The <strong>-sV</strong> switch tries to determine what version of a service is running on a detected open port. This is great when scanning either UDP ports or unusual ports. If you find an unusual port number to be open, a version scan might tell you whether it is an SSH service running or an HTTP.</p>
<p><strong>Operating System detection :</strong> The <strong>-O</strong> switch is for determining the operating system of the target. This does not 100% work but it does give some clues. It also tries to determine the kernel version, if it fails to get the kernel version, it sometimes reports possibilities in percentages.</p>
<p>Another option for Operating System and Version detection is the <strong>-A</strong> switch. This does not provide as much detail as the -O option but is still useful.</p>
<p><strong>The Speed :</strong> You can choose the speed of each scan with the <strong>-T</strong> switch. The timing switch ranges on a numeric scale from 0 to 5, with 0 being the slowest scan.</p>
<p>It is important to know the backgrounds of a scan when executing it. Otherwise the results would seem meaningless to the scanner. Go ahead and try scanning your own systems. Don&#8217;t forget that if you have multiple servers, nmap also has a nice way of dealing with <a href="http://www.plugged.in/network/nmap-target-specification-in-detail.html" title="Nmap : Target Specification in Detail">target specification</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/network/nmap-scanning-methods.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Export the Private Key From a .PFX With OpenSSL</title>
		<link>http://www.plugged.in/linux/how-to-exporting-private-key-from-pfx-with-openssl.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-exporting-private-key-from-pfx-with-openssl</link>
		<comments>http://www.plugged.in/linux/how-to-exporting-private-key-from-pfx-with-openssl.html#comments</comments>
		<pubDate>Mon, 07 May 2012 13:01:34 +0000</pubDate>
		<dc:creator>Cevdet Kaymaz</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[export pfx]]></category>
		<category><![CDATA[openssl export]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=388</guid>
		<description><![CDATA[If you have a .pfx file and you need it&#8217;s private.key, then you can use OpenSSL for extracting .pem from .pfx ( the openssl software is available at <a href="http://openssl.org" target="_blank">openssl.org</a> ) To export the private key ( .pem ) from the PFX file and save it to a PEM file : $openssl pkcs12 -in [...]]]></description>
			<content:encoded><![CDATA[<p>If you have  a .pfx file and you need it&#8217;s private.key, then you can use OpenSSL for extracting .pem from .pfx ( the openssl software is available at <a href="http://openssl.org" target="_blank">openssl.org</a> )</p>
<p>To export the private key ( .pem ) from the PFX file and save it to a PEM file :</p>
<blockquote><p>$openssl pkcs12 -in /path/to/file_name.pfx -nocerts -out private_key_name.pem</p></blockquote>
<p>If you want to remove the password from the private key file :</p>
<blockquote><p>$openssl rsa -in private_key_name.pem -out new_private.pem</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/how-to-exporting-private-key-from-pfx-with-openssl.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Zimbra Mail Server) Unable to determine enabled services from LDAP</title>
		<link>http://www.plugged.in/linux/zimbra-mail-server-unable-to-determine-enabled-services-from-ldap.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zimbra-mail-server-unable-to-determine-enabled-services-from-ldap</link>
		<comments>http://www.plugged.in/linux/zimbra-mail-server-unable-to-determine-enabled-services-from-ldap.html#comments</comments>
		<pubDate>Fri, 04 May 2012 13:34:15 +0000</pubDate>
		<dc:creator>Cevdet Kaymaz</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[ldap service error]]></category>
		<category><![CDATA[service error]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=377</guid>
		<description><![CDATA[[zimbra@ck]$ zmcontrol start Host mail.plugged.in Starting ldap&#8230;Done. Unable to determine enabled services from ldap. Enabled services read from cache. Service list may be inaccurate. Starting logger&#8230;Failed. Starting logswatch&#8230;ERROR: service.FAILURE (system failure: ZimbraLdapContext) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) zimbra logger service is not enabled! [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>[zimbra@ck]$ zmcontrol start<br />
Host mail.plugged.in<br />
        Starting ldap&#8230;Done.<br />
Unable to determine enabled services from ldap.<br />
Enabled services read from cache. Service list may be inaccurate.<br />
        Starting logger&#8230;Failed.<br />
Starting logswatch&#8230;ERROR: service.FAILURE (system failure: ZimbraLdapContext) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)<br />
zimbra logger service is not enabled!  failed.</p></blockquote>
<p>The usual reason for this error is expired an SSL certificate.</p>
<p><span id="more-377"></span><br />
This error usually happens if your SSL certificate has expired. There are two solutions for this problem.</p>
<p><strong>The first solution is renewing your certificate and deploying it with the following command :</strong></p>
<p>&nbsp;</p>
<blockquote><p>[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr deploycrt comm /opt/zimbra/ssl/zimbra/commercial/your_new_ssl.crt /path/to/ca_bundle.crt</p></blockquote>
<p>After this you need to restart zmcontrol.</p>
<p><strong>The second solution is regenerating self-signed certificate.</strong></p>
<blockquote><p>[zimbra@ck]$ su &#8211; zimbra -c &#8216;zmcontrol stop&#8217;<br />
[zimbra@ck]$ rm -rf /opt/zimbra/ssl/*<br />
[zimbra@ck]$ rm -rf /opt/zimbra/ssl/.rnd<br />
[zimbra@ck]$ /opt/zimbra/java/bin/keytool -delete -alias my_ca -keystore /opt/zimbra/java/jre/lib/security/cacerts -storepass changeit<br />
[zimbra@ck]$ /opt/zimbra/java/bin/keytool -delete -alias jetty -keystore /opt/zimbra/mailboxd/etc/keystore -storepass `su &#8211; zimbra -c &#8216;zmlocalconfig -s -m nokey mailboxd_keystore_password&#8217;`</p></blockquote>
<p>Then you need to edit  /opt/zimbra/bin/zmcertmgr file ( you can use &#8216;vi&#8217; )</p>
<p>Find validation_days=365 and change to validation_days=3650</p>
<p>And save /opt/zimbra/bin/zmcertmgr</p>
<blockquote><p>[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr createca -new<br />
[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr deployca -localonly<br />
[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr createcrt self -new<br />
[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr deploycrt self</p>
<p>[zimbra@ck]$ su &#8211; zimbra -c &#8216;zmcontrol start&#8217;</p>
<p>[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr deploycrt self<br />
[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr deployca</p>
<p>[zimbra@ck]$ su &#8211; zimbra -c &#8216;zmupdateauthkeys&#8217;<br />
[zimbra@ck]$ /opt/zimbra/bin/zmcertmgr viewdeployedcrt</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/zimbra-mail-server-unable-to-determine-enabled-services-from-ldap.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nmap : Target Specification in Detail</title>
		<link>http://www.plugged.in/network/nmap-target-specification-in-detail.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nmap-target-specification-in-detail</link>
		<comments>http://www.plugged.in/network/nmap-target-specification-in-detail.html#comments</comments>
		<pubDate>Wed, 02 May 2012 14:04:52 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scan]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=370</guid>
		<description><![CDATA[Every now and then, we need to scan ports as system administrators, even if the target machine is owned by us or not. To achieve this, nmap is the well known and reliable tool which is available for almost every platform. But to use nmap, we need to understand the background of it a little. [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then, we need to scan ports as system administrators, even if the target machine is owned by us or not. To achieve this, <strong>nmap</strong> is the well known and reliable tool which is available for almost every platform. But to use nmap, we need to understand the background of it a little.</p>
<p>There are several methods to scan ports. One of them is the &#8220;TCP&#8221; scanning method. With this method, nmap will try to establish a TCP connection with each of the port to be scanned on the target.  If we don&#8217;t specify any ports, nmap will scan these. This speeds up the process a lot! Below, you&#8217;ll find an example of TCP scan on every port on the target machine.</p>
<p><strong>$ nmap -sT -p- -PN 10.20.30.40</strong></p>
<p>When we break down the arguments, things will get clearer.</p>
<p><strong>-sT :</strong> The <strong>-s</strong> there indicates what method to use to scan, so the following <strong>T</strong> says its a TCP scan.<br />
<strong>-p- :</strong> With this we tell nmap to scan every port on the target. Normally, nmap has a predefined list of 1000 ports that are widely used. To scan only the default 1000 ports, just don&#8217;t use this flag. Alternately you can tell which specific range of ports to scan. For example to scan the ports 21,23 and 25, we specify it as <strong>-p21,23,25</strong> or to scan every port between 21 and 25, <strong>-p21-25</strong>. If we want to scan everything between 21 and 25 plus the 80&#8242;th port, it goes like this : <strong>-p21-25,80</strong><br />
<strong>-PN :</strong> This options tells nmap to skip the host discovery, which means it&#8217;ll assume that every target we specify are online. Use this if you&#8217;re only sure that the host is online, when we specify a lot of targets, and a lot of ports on these targets, host discovery will come in as a handy time saver.</p>
<p>Target specification in a clever way is very important if you&#8217;re willing to scan multiple targets. Below, we&#8217;ll talk about how detailed we can specify targets on nmap.</p>
<p>The simplest way for telling nmap to scan 2 targets,</p>
<p><strong>$ nmap -sT -p21-25,80,8080 10.20.30.40-60 192.168.16.4 192.168.16.5</strong></p>
<p>The above will do the same thing with the notation below,</p>
<p><strong>$ nmap -sT -p21-25,80,8080 10.20.30.40-60 192.168.16.4,5</strong></p>
<p>Nmap can also understand various notations at the same time when specifying target addresses. For example we can specify a network with it&#8217;s CIDR notation, and use partial definitions on different subnet blocks. Take a look at this example :</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 10.20.30,31.40</strong></p>
<p>Note that you cannot use the comma notation and the CIDR notation at the same time. So target specification such as <strong>192.168.1,2.0/16</strong> is <strong>NOT</strong> allowed.</p>
<p>You can also specify IPv6 using the <strong>-6</strong> options. Below we&#8217;re scanning for the website <a href="http://my-ip6.com" target="_blank">my-ip6.com</a></p>
<p><strong>$ nmap -sT -p21-25,80 -6 2a00:7300:1::4</strong></p>
<p>Also note that with the IPv6 scanning, nmap does <strong>NOT</strong> support CIDR notation.</p>
<p>Needless to, we can also specify the target with its domain name.</p>
<p><strong>$ nmap -sT -p- -PN plugged.in</strong></p>
<p>Nmap can also get the targets from a text file if you can&#8217;t specify them in a sequential order. Just type your targets&#8217; IP addresses line by line on a file and run it like this:</p>
<p><strong>$ nmap -sT -p- -PN -iL my_targets_text_file</strong></p>
<p>When you specify a range of addresses, it sometimes is crutial to NOT SCAN some members of that network. For this, nmap allows you to exclude addresses. This time we specify multiple &#8220;excluded targets&#8221; as comma separated, and as usual, it supports all the syntax supported for target specification. (hostnames, CIDR, netblocks, octet ranges, etc.)</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 &#8211;exclude 192.168.16.30,192.168.1.10-15</strong></p>
<p>Here&#8217;s a problem with this syntax of nmap, since the excluded targets are specified with commas, we can&#8217;t use commas to define subnets within the exclusion. For example we can specify targets such as <strong>192.168.1,2.1</strong> but this is not allowed within the exclusion since nmap will use the comma as a target exclusion delimiter.</p>
<p>The good thing is, just like specifying your targets in a text file, you can also specify you exclusion list too!</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 &#8211;excludefile my_exclusion_text_file</strong></p>
<p>And the last but not least, nmap has an option to scan random addresses. This is built specifically for research (and fun!) yet you should always use this option at your own risk, since some networks might detect you as a possible break-in attempt for scanning their system. It is also a good idea to you exclusion lists with this option.</p>
<p><strong>$ nmap -sT -p80 -PN -iR 5 </strong></p>
<p>The number 5 above means that nmap will be scanning 5 addresses. So it will generate 5 random IP addresses. To generate infinate numbers of addresses, use the <strong>-iR</strong> option with the value <strong>0</strong>.</p>
<p>Let&#8217;s end this post with a quoat from the man page of nmap,</p>
<blockquote><p><em>&#8220;If you find yourself really bored one rainy afternoon, try the command</em> <strong>nmap -sS -PS80 -iR 0 -p 80</strong> <em>to locate random web servers for browsing.&#8221;</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/network/nmap-target-specification-in-detail.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bind Multiple IP Addresses on a Single Network Card IPv4 &amp; IPv6</title>
		<link>http://www.plugged.in/linux/bind-multiple-ip-addresses-on-a-single-network-card.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bind-multiple-ip-addresses-on-a-single-network-card</link>
		<comments>http://www.plugged.in/linux/bind-multiple-ip-addresses-on-a-single-network-card.html#comments</comments>
		<pubDate>Wed, 02 May 2012 10:03:38 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ipv4]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=366</guid>
		<description><![CDATA[The beauty of having multiple IP addresses on a single server is that you can run several services with different addressing. This way you can announce your FTP service on a different address and your HTTP on another. Below I&#8217;ll describe how to achieve this in Debian based and Red Hat based distros seperately. Using [...]]]></description>
			<content:encoded><![CDATA[<p>The beauty of having multiple IP addresses on a single server is that you can run several services with different addressing. This way you can announce your FTP service on a different address and your HTTP on another.</p>
<p>Below I&#8217;ll describe how to achieve this in Debian based and Red Hat based distros seperately.</p>
<p>Using Debian based distros (Ubuntu, Mint etc.), setting multiple IP addresses on a single network interface is simple.</p>
<p>What we will do is to edit the /etc/network/interfaces file.<br />
If you are using DHCP, then your file should look similar to this,</p>
<blockquote><p>auto eth0<br />
iface eth0 inet dhcp</p>
<p>auto eth0:0<br />
iface eth0:0 inet dhcp<br />
iface eth0:0 inet6 dhcp</p></blockquote>
<p>Here, the <strong>eth0:0</strong> is how we get the secondary IP address on the <strong>eth0</strong> device.</p>
<p>If you&#8217;re using a static IP address instead of DHCP, then your interfaces file should be like,</p>
<blockquote><p>auto eth0<br />
iface eth0 inet static<br />
address 10.20.30.40<br />
netmask 255.255.255.0<br />
network 10.20.30.0<br />
broadcast 10.20.30.255<br />
gateway 10.20.30.1<br />
dns-nameservers 8.8.8.8</p>
<p>iface eth0 inet6 static<br />
address 2f00:7300:100::10<br />
netmask 64</p>
<p>auto eth0:0<br />
iface eth0:0 inet static<br />
address 10.20.30.41<br />
netmask 255.255.255.0</p>
<p>iface eth0:0 inet6 static<br />
address 2f00:7300:100::11<br />
netmask 64</p></blockquote>
<p>You can add as many as you want, such as <strong>eth0:1</strong>, <strong>eth0:2</strong> &#8230;</p>
<p>Sometimes when adding multiple IPv6 addresses on Debian systems, it is possible that you get an error. The current workaround for that is to enable and disable the device a couple of times. You can find the solution to that problem <a href="https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/617978" target="_blank">here</a>.</p>
<p>In Red Hat based distros (CentOS, Fedora etc.), the interfaces are edited through the directory <strong>/etc/sysconfig/network-scritps</strong>. Here we have multiple files, each pointing for a device. For instance, to have 2 additional IP&#8217;s on a single ethernet device (totaling 3 addresses) we should have 3 files as follows,</p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-eth0<br />
/etc/sysconfig/network-scripts/ifcfg-eth0:1<br />
/etc/sysconfig/network-scripts/ifcfg-eth0:2</strong></p>
<p>The main device file would be just a standard one, we don&#8217;t have to change anything with it.<br />
On the other hand, the <strong>ifcfg-eth0:1</strong> file should be similar to this,</p>
<blockquote><p>NAME=&#8221;"<br />
BOOTPROTO=static<br />
MACADDR=&#8221;"<br />
IPV6INIT=no<br />
DEVICE=eth0:1<br />
NETMASK=255.255.255.0<br />
MTU=&#8221;"<br />
BROADCAST=10.20.30.255<br />
ONPARENT=yes<br />
IPADDR=10.20.30.41<br />
NETWORK=10.20.30.0<br />
IPV6INIT=yes<br />
IPV6ADDR=2f00:7300:100::11<br />
IPV6_DEFAULTGW=2f00:7300:100::1<br />
ONBOOT=yes</p></blockquote>
<p>This would suffice. Don&#8217;t forget to restart your network services after adding the lines (or files) to with your appropriate settings.</p>
<p>For Debian : <strong>$ /etc/init.d/networking stop &amp;&amp; /etc/init.d/networking start</strong><br />
For Red Hat : <strong>$ service network restart</strong></p>
<p>For additional IPv6 addresses you should need to add IPV6ADDR_SECONDARIES=&#8221;" line to /etc/sysconfig/network-scripts/ifcfg-eth0 file</p>
<blockquote><p>IPV6INIT=yes<br />
IPV6ADDR=2f00:7300:1::2/64<br />
IPV6ADDR_SECONDARIES=&#8221;2f00:7300:1::3/64 2f00:7300:1::4/64 2f00:7300:1::fff4/64 2f00:7300:1::fff5/64&#8243;</p></blockquote>
<p>.</p>
<div class="SPOSTARBUST-Related-Posts"><H3>Related Posts</H3><ul class="entry-meta"><li class="SPOSTARBUST-Related-Post"><a title="Determine folder size with &#8220;du&#8221; including sub folders" href="http://www.plugged.in/linux/linux_help/determine-folder-size-with-du-including-sub-folders.html" rel="bookmark">Determine folder size with &#8220;du&#8221; including sub folders</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Disabling IPv6 in Linux" href="http://www.plugged.in/linux/linux_help/disabling-ipv6-in-linux.html" rel="bookmark">Disabling IPv6 in Linux</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Linux version &#038; Operating System info" href="http://www.plugged.in/linux/linux_help/linux-version-operating-system-info.html" rel="bookmark">Linux version &#038; Operating System info</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Setting time with NTP" href="http://www.plugged.in/linux/linux_help/setting-time-with-ntp.html" rel="bookmark">Setting time with NTP</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Linux Recursive Search inside files" href="http://www.plugged.in/linux/linux_help/linux-recursive-search-inside-files.html" rel="bookmark">Linux Recursive Search inside files</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Disabling recursive queries in Bind" href="http://www.plugged.in/linux/linux_help/disabling-recursive-queries-in-bind.html" rel="bookmark">Disabling recursive queries in Bind</a></li>
</ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/bind-multiple-ip-addresses-on-a-single-network-card.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to grep Compressed Files?</title>
		<link>http://www.plugged.in/linux/how-to-grep-compressed-files-over-ssh.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-grep-compressed-files-over-ssh</link>
		<comments>http://www.plugged.in/linux/how-to-grep-compressed-files-over-ssh.html#comments</comments>
		<pubDate>Mon, 30 Apr 2012 14:04:31 +0000</pubDate>
		<dc:creator>Cevdet Kaymaz</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[grep compressed file]]></category>
		<category><![CDATA[zgrep]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=361</guid>
		<description><![CDATA[Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn&#8217;t work on compressed files. To overcome this, people usually advise to first  uncompress the file(s), and then grep your text, after that finally re-compress your file(s)&#8230; You don&#8217;t need to uncompress them in the first place. You can use [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn&#8217;t work on compressed files. To overcome this, people usually advise to first  uncompress the file(s), and then grep your text, after that finally re-compress your file(s)&#8230;</p>
<p>You don&#8217;t need to uncompress them in the first place. You can use <strong>zgrep</strong> on compressed or gzipped files.</p>
<p><span id="more-361"></span></p>
<p>To search in compressed file, execute the command :<br />
<strong>root@ck [~]#zgrep &#8216;put-your-text-here&#8217; /your-file-path-here/file.gz</strong><br />
Example : I want to grep &#8216;plugged&#8217; in all of my exim_paniclog archived files.<br />
<strong>root@ck [~]# zgrep &#8216;plugged&#8217; /var/log/exim_paniclog.*</strong><br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/how-to-grep-compressed-files-over-ssh.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Export Subscribers from a Cpanel Mailman List ?</title>
		<link>http://www.plugged.in/linux/how-to-export-subscribers-from-cpanel-mailman-list.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-export-subscribers-from-cpanel-mailman-list</link>
		<comments>http://www.plugged.in/linux/how-to-export-subscribers-from-cpanel-mailman-list.html#comments</comments>
		<pubDate>Mon, 30 Apr 2012 12:18:04 +0000</pubDate>
		<dc:creator>Cevdet Kaymaz</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[WHM/Cpanel]]></category>
		<category><![CDATA[mailman export]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=357</guid>
		<description><![CDATA[Cpanel&#8217;s Mailman is an open-source mailing list application. The problem is that there is no easy way to export subscribers from a list. Yet, here&#8217;s the solution. Step 1: Login into account via SSH ( as root ). Step 2: Find mailman directory. ( Default Location : /usr/local/cpanel/3rdparty/mailman/bin ) $ cd /usr/local/cpanel/3rdparty/mailman/bin Step 3: Execute [...]]]></description>
			<content:encoded><![CDATA[<p>Cpanel&#8217;s Mailman is an open-source mailing list application. The problem is that there is no easy way to export subscribers from a list. Yet, here&#8217;s the solution.</p>
<p>Step 1: Login into account via SSH ( as root ).<br />
Step 2: Find mailman directory. ( Default Location : /usr/local/cpanel/3rdparty/mailman/bin )<span id="more-357"></span><br />
<strong>$ cd /usr/local/cpanel/3rdparty/mailman/bin</strong><br />
Step 3: Execute the following command to export subscribers to a text file:<br />
<strong>$ ./list_members yourlistname &gt; ./export_mail_list.txt</strong><br />
Example Mailman List Name : maillist_plugged.in  ( If the subscriber list is maillist@plugged.in, the listname would be maillist_plugged.in )</p>
<p>This command will export my email subscribers into a file ( export_mail_list.txt ).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/how-to-export-subscribers-from-cpanel-mailman-list.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change storage engine to InnoDB in MySQL ?</title>
		<link>http://www.plugged.in/databases/how-to-change-storage-engine-to-innodb-in-mysql.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-change-storage-engine-to-innodb-in-mysql</link>
		<comments>http://www.plugged.in/databases/how-to-change-storage-engine-to-innodb-in-mysql.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 12:22:30 +0000</pubDate>
		<dc:creator>polatahmet</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=345</guid>
		<description><![CDATA[You&#8217;ve designed a database with MyISAM and suddenly realized that you need ACID (atomicity, consistency, isolation, durability) compliant features and transactions. Right, you should use <a title="wikipedia: InnoDB" href="http://en.wikipedia.org/wiki/InnoDB" target="_blank">InnoDB</a>. But how to change storage engine for your previous tables ? As far as i know, changing the storage engine for tables is easy by alter command. But there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve designed a database with MyISAM and suddenly realized that you need ACID (<em>atomicity, consistency, isolation, durability</em>) compliant features and transactions.</p>
<p>Right, you should use <a title="wikipedia: InnoDB" href="http://en.wikipedia.org/wiki/InnoDB" target="_blank">InnoDB</a>. But how to change storage engine for your previous tables ?</p>
<p>As far as i know, changing the storage engine for tables is easy by alter command.</p>
<p>But there&#8217;s one flaw. You should do it one by one.</p>
<p>On the other hand, you could either write complex SQL queries, or you could write a php code for bulk changes.</p>
<p>Today i&#8217;m gonna show you how to change your storage engine with a tiny code.</p>
<p><span style="color: #e01e2a; font-size: small;">Please notice that if you decide to use my code it is your responsibility.</span></p>
<blockquote><p>$db = &#8216;your_database_name_here&#8217;;</p>
<p>$dsn = &#8220;mysql:host=localhost;dbname=$db&#8221;;</p>
<p>$username = &#8220;your_MySQL_username&#8221;;</p>
<p>$password = &#8220;your_password&#8221;;</p>
<p>$current = &#8216;MyISAM&#8217;; // Current storage engine</p>
<p>$target = &#8216;INNODB&#8217;; // Target storage engine</p>
<p>&nbsp;</p>
<p>try {</p>
<p style="padding-left: 30px;">$pdo = new PDO($dsn, $username, $password);</p>
<p>}</p>
<p>catch(PDOException $e) {</p>
<p style="padding-left: 30px;">die(&#8220;Could not connect to the database\n&#8221;);</p>
<p>}</p>
<p>$result = $pdo-&gt;query(&#8220;SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = &#8216;$db&#8217; AND ENGINE = &#8216;$current&#8217;&#8221;);</p>
<p>foreach($result as $row) {</p>
<p style="padding-left: 30px;">$success = $pdo-&gt;exec(&#8220;ALTER TABLE {$row['TABLE_NAME']} ENGINE = $target&#8221;);</p>
<p style="padding-left: 30px;">if($success) {</p>
<p style="padding-left: 60px;">echo &#8220;{$row['TABLE_NAME']} &#8211; success\n&#8221;;</p>
<p style="padding-left: 30px;">} else {</p>
<p style="padding-left: 60px;">$info = $pdo-&gt;errorInfo();</p>
<p style="padding-left: 60px;">echo &#8220;{$row['TABLE_NAME']} &#8211; failed: $info[2]\n&#8221;;</p>
<p style="padding-left: 30px;">}</p>
<p>}</p></blockquote>
<p>That&#8217;s all.</p>
<p><span style="color: #e01e2a;">If you see &#8220;failed&#8221; messages, there&#8217;s probably a permission issue with information_schema table.</span></p>
<p>In that case you should enter MySQL command line, and repeat the procedure there.</p>
<p>To list storage engines for tables, you should execute;</p>
<blockquote><p>SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = &#8216;your_database_name&#8217;;</p></blockquote>
<p>This will show you which tables are using which storage engine.</p>
<p>After that you should execute;</p>
<blockquote><p>USE your_database_name;</p></blockquote>
<p>When you see &#8220;Database changed&#8221; message, you should execute;</p>
<blockquote><p>ALTER TABLE your_table_name ENGINE = INNODB;</p></blockquote>
<p>Have a nice life with your magnificent database storage engine InnoDB !</p>
<p>&nbsp;</p>
<p>Please check out other articles about InnoDB and Transactions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/databases/how-to-change-storage-engine-to-innodb-in-mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to clear contents of a file ?</title>
		<link>http://www.plugged.in/linux/linux_help/how-to-clear-contents-of-a-file.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-clear-contents-of-a-file</link>
		<comments>http://www.plugged.in/linux/linux_help/how-to-clear-contents-of-a-file.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 11:49:50 +0000</pubDate>
		<dc:creator>polatahmet</dc:creator>
				<category><![CDATA[LINUX Help]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=341</guid>
		<description><![CDATA[If you want to clear contents of a file in unix, you could just delete the file and recreate it. But there are much more simple alternatives. You can use echo method. To empty a file just enter the command below. I use my php_error.log file for example. echo -n &#62; /home/base/logs/php_error.log That&#8217;s it. Your [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to clear contents of a file in unix, you could just delete the file and recreate it.</p>
<p>But there are much more simple alternatives.</p>
<p><strong>You can use echo method.</strong></p>
<p>To empty a file just enter the command below. I use my php_error.log file for example.</p>
<blockquote><p>echo -n &gt; /home/base/logs/php_error.log</p></blockquote>
<p>That&#8217;s it. Your file is empty now.</p>
<p><strong>You can use VI Editor.</strong></p>
<p>First, open the file that you want to empty with vi editor. I use my php_error.log file for example.</p>
<blockquote>
<div>vi /home/base/logs/php_error.log</div>
</blockquote>
<p>On the first line, type<strong> &#8220;dG&#8221;</strong> without quotes. It means delete globally on VI Editor.</p>
<p>Then quit with &#8220;:wq&#8221; without quotes of course <img src='http://www.plugged.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/linux_help/how-to-clear-contents-of-a-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple FTP Status Daemon</title>
		<link>http://www.plugged.in/uncategorized/a-simple-ftp-status-daemon.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-simple-ftp-status-daemon</link>
		<comments>http://www.plugged.in/uncategorized/a-simple-ftp-status-daemon.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 07:11:20 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=335</guid>
		<description><![CDATA[Here is a clumsy script to check on an FTP Service on a remote server if running or down. The script is written in Python and is a very draft one, but does the job. The main goal is to check whether we get any response from the FTP server while we try to connect [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a clumsy script to check on an FTP Service on a remote server if running or down. The script is written in Python and is a very draft one, but does the job.</p>
<p>The main goal is to check whether we get any response from the FTP server while we try to connect anonymously. Don&#8217;t forget that this script probably won&#8217;t work if the FTP server allows anonymous connections.</p>
<p>We simply use the ftplib module to establish the FTP connection. After the successful (or failed) connection, we can report the status of the server via email, to achieve this we use the smtplib module.</p>
<p>The first lines seem simple,</p>
<blockquote><p>#!/usr/bin/python</p>
<p>import ftplib, smtplib</p>
<p>server_ip=&#8217;10.20.30.40&#8242;</p>
<p>sender=&#8217;sender@email.com&#8217;<br />
receivers=['john@email.com','doe@email.com']</p></blockquote>
<p>Above, after importing our modules, we&#8217;ve defined the ip address of our FTP server. After that, the sender email address is defined, and then a list containing the receivers.<br />
Now we can define our messages. We&#8217;ll have two messages, one for the UP status, and one for the DOWN.</p>
<blockquote><p>message_up=&#8221;"&#8221;<br />
From: FTP Status DAEMON <sender@email.com><br />
To: John <john@email.com>, Doe <doe@email.com><br />
Subject: FTP Service Running</p>
<p>The FTP Service on %s is running.<br />
&#8220;&#8221;" % server_ip</p>
<p>message_down=&#8221;"&#8221;<br />
From: FTP Status DAEMON <sender@email.com><br />
To: John <john@email.com>, Doe <doe@email.com><br />
Subject: FTP Service DOWN!</p>
<p>The FTP Service on %s is DOWN!!!<br />
&#8220;&#8221;" % server_ip</p></blockquote>
<p>Now we can actually start the checking. The first try clause is checking if we can establish any kind of connection with the server. If the server is somehow down, or if only the FTP service is shut down, this will return some sort of error, which we will catch with the except clause, handle it with our smtp commands, then raise a system exit.</p>
<blockquote><p>try : ftp=ftplib.FTP(server_ip)<br />
except :<br />
        print &#8220;FTP DOWN !!!&#8221;<br />
        smtpObj = smtplib.SMTP(&#8216;localhost&#8217;)<br />
        smtpObj.sendmail(sender,receivers,message_down)<br />
	raise SystemExit</p></blockquote>
<p>And here&#8217;s the second check, if we somehow get to this line, it means that we&#8217;ve passed the system exit above, so our connection attempt with the server worked, but we&#8217;re not sure if the FTP service is actually running without a login attempt. When we try to login, and if anonymous connection isn&#8217;t allowed, we&#8217;ll get a permission error, handling it with an exception we can email the recievers that the server is running.</p>
<blockquote><p>try : ftp.login()<br />
except ftplib.error_perm :<br />
	print &#8220;FTP Up, Permission Denied.&#8221;<br />
	smtpObj = smtplib.SMTP(&#8216;localhost&#8217;)<br />
	smtpObj.sendmail(sender,receivers,message_up)</p></blockquote>
<p>Now simply connect the dots and add the whole script to your crontab, then you&#8217;re good to go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/uncategorized/a-simple-ftp-status-daemon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Hosting Security premier</title>
		<link>http://www.plugged.in/linux/web-hosting-security/web-hosting-security-premier.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=web-hosting-security-premier</link>
		<comments>http://www.plugged.in/linux/web-hosting-security/web-hosting-security-premier.html#comments</comments>
		<pubDate>Mon, 16 Apr 2012 22:20:07 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[Web Hosting Security]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[repoforge]]></category>
		<category><![CDATA[rpmforge]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=323</guid>
		<description><![CDATA[IMPORTANT NOTE: Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions &#8212; read, review, compare, apply as it fits your system., Update your server as necessary As its nature, Linux is a multi-developer operating system and you might see an update on any package everyday, an updater like [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>IMPORTANT NOTE:</strong></span> Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions &#8212; read, review, compare, apply as it fits your system.,</p>
<h3>Update your server as necessary</h3>
<p>As its nature, Linux is a multi-developer operating system and you might see an update on any package everyday, an updater like YUM if you don&#8217;t change it&#8217;s default behavior hosts the most recent stable versions of each package that you install on your server.</p>
<p>Compared to other operating systems, updating Linux is easy as writing a command to terminal, the rest will be automated by YUM. Yum can be extended by independent software repositories like Repoforge. RPMforge is a collaboration of Dag and other packagers. They provide over 5000 packages for CentOS, including wine, vlc, mplayer, xmms-mp3, and other popular media tools. It is not part of Red Hat or CentOS but is designed to work with those distributions.</p>
<p>To install Rpmforge, run;</p>
<blockquote><p> rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.rf.src.rpm</p></blockquote>
<p>If you get an error with the command, check the web site for a recent version. If you are using a control panel like Directadmin you better exclude the packages below from yum as they are maintained by the control panel updater;</p>
<blockquote><p>exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* bind-chroot*</p></blockquote>
<p>and the last thing you should do is to type</p>
<blockquote><p>yum upgrade</p></blockquote>
<p>We suggest you to run the update at least every once a month.</p>
<h3>Disable Telnet</h3>
<hr style="width: 100%;" width="100%" />
<p>Nowadays, Telnet is mostly given its role to SSH; more secure remote shell client, because Telnet is sending the passwords in readable clear text. Also SSH have many abilities that you can use such as private-keys that you can use to log in to the server without writing down a password. Public key is mostly used when you need root access even you don&#8217;t know the root password (root password might be changed by the system administrator or by your client which you install the system for).</p>
<p>Connect to the server and edit<strong> /etc/xinetd.d/telnet</strong> by typing;</p>
<blockquote><p>vi /etc/xinetd.d/telnet</p></blockquote>
<p>if exists <strong>disable = no</strong> change to <strong>disable = yes</strong></p>
<p>save &amp; exit (SHIFT + ZZ)</p>
<h3>Restrict Access to applications that can directly connect to the Internet</h3>
<hr />
<p>Even an attacker leak into your server, it is better to give him no chance to download his applications to the server, don&#8217;t give run permission to following applications except root user by typing;</p>
<blockquote><p>chmod 700 /usr/bin/wget<br />
chmod 700 /usr/bin/telnet<br />
chmod 700 /usr/local/bin/lynx<br />
chmod 700 /usr/bin/links<br />
chmod 700 /usr/bin/bcc<br />
chmod 700 /usr/bin/byacc<br />
chmod 700 /usr/bin/cc<br />
chmod 700 /usr/bin/gcc<br />
chmod 700 /usr/bin/perlcc<br />
chmod 700 /usr/bin/yacc<br />
chmod 0700 /usr/bin/curl<br />
chmod 700 /usr/bin/lwp-*<br />
chmod 700 /usr/bin/*ncftp*</p></blockquote>
<p>Also please note that, if you are taking backups of your domains/dbs to the same server, be aware that a directory created without explicit permission will be readable by all users, to make the directory readable only by root, type;</p>
<blockquote><p>chmod 600 /backups</p></blockquote>
<h3>Restrict OS level function calling to PHP</h3>
<hr />
<p>In a shared hosting environment, even a customer of yours may try to explore your server. If you don&#8217;t have any reason to call the functions below, restrict them;</p>
<p>edit /etc/php.ini (or whereever it is, for directadmin you can check /usr/local/lib/php.ini) and find the line disable_functions and replace with the below line:</p>
<blockquote><p>disable_functions = &#8220;apache_get_modules,apache_get_version,apache_getenv,apache_note, apache_setenv,disk_free_space,diskfreespace,dl, highlight_file,ini_alter,ini_restore,openlog,passthru,phpinfo, proc_nice,shell_exec,show_source,symlink,system, exec,popen,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_ put,fpassthru&#8221;</p></blockquote>
<h3> Block executing commands on the /tmp Partition</h3>
<hr />
<p>Several script languages like PHP, holds temporary files like session,upload and cache on the /tmp partition on Linux systems. İf the attacker has an access to this folder then those scripts can be run from this point so with this way, all system files can be reached or accessed by root. To block running of files which are in the /tmp partition, it must not be given run permission while mounting /tmp partition.</p>
<p>To do this process, you have to choose /tmp partition as seperate partition while installaing the system. Enter this command in the command line to check this setting:</p>
<blockquote><p>df -h # or<br />
mount</p></blockquote>
<p>Enter this command:</p>
<blockquote><p>[root@xxx ~]# df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00 2.9G  820M  1.9G  30% /<br />
<strong>/dev/mapper/VolGroup00-LogVol02 2.9G  288M  2.4G  11% /tmp</strong><br />
/dev/mapper/VolGroup00-LogVol04 7.8G  3.8G  3.7G  51% /var<br />
/dev/mapper/VolGroup00-LogVol05 44G   35G  6.6G  85% /hsphere<br />
/dev/mapper/VolGroup00-LogVol03 4.8G  908M  3.6G  20% /usr<br />
/dev/sda1              99M   36M   58M  39% /boot<br />
tmpfs                 2.0G     0  2.0G   0% /dev/shm</p></blockquote>
<p>If you can not see a seperate  /tmp partition like in the example, create a new 3 GB /tmp partition by applying steps below. If there is a /tmp partition then follow with the step 2:</p>
<p><strong>Step 1:</strong></p>
<blockquote><p>cd /dev/<br />
dd if=/dev/zero of=Tmp bs=1024 count=3000000<br />
mkfs -t ext3 /dev/Tmp<br />
cd /<br />
cp -aR  /tmp  /tmp_backup<br />
mount  -o  loop,noexec,nosuid,rw  /dev/Tmp  /tmp<br />
cp -aR /tmp_backup/* /tmp/<br />
chmod 0777 /tmp<br />
chmod +t  /tmp</p></blockquote>
<p>Add information of the newly created partition into the /etc/fstab in order to make it available after next boot.</p>
<blockquote><p>/dev/Tmp          /tmp          ext3          loop,rw,nosuid,noexec     0 0</p></blockquote>
<p>If you already have  /tmp partition, please apply the below steps.</p>
<p><strong>Step 2:<br />
</strong></p>
<p>change &#8220;defaults&#8221; in the line starting with /tmp in /etc/fstab to restrict running applications such as</p>
<blockquote><p>/dev/VolGroup00/LogVol02 /tmp                    ext3    <strong>defaults </strong>1 2</p></blockquote>
<p>to</p>
<blockquote><p>/dev/VolGroup00/LogVol02 /tmp                    ext3     <strong>rw,nosuid,noexec</strong> 1 2</p></blockquote>
<p>Change defaults region as <strong>rw,nosuid,noexec </strong>then save and exit. Remount /tmp partition in order to make changes available immediately by typing;</p>
<blockquote><p>mount -oremount loop,rw,nosuid,noexec /tmp</p></blockquote>
<p>..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/web-hosting-security/web-hosting-security-premier.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the Largest Files</title>
		<link>http://www.plugged.in/linux/find-the-largest-files.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=find-the-largest-files</link>
		<comments>http://www.plugged.in/linux/find-the-largest-files.html#comments</comments>
		<pubDate>Mon, 16 Apr 2012 07:29:01 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=315</guid>
		<description><![CDATA[The other day I was working on a server and needed the LARGEST files on some directory &#8211; including its subdirectories. As it turns out, it&#8217;s a very simple task limiting the file size you want with the output of the find tool. The -size argument will define the borders of your output. Let&#8217;s say [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was working on a server and needed the LARGEST files on some directory &#8211; including its subdirectories.</p>
<p>As it turns out, it&#8217;s a very simple task limiting the file size you want with the output of the <strong>find</strong> tool.</p>
<p>The <strong>-size</strong> argument will define the borders of your output. Let&#8217;s say you want to find the files smaller than 50 MB on your server,</p>
<blockquote><p>$ find / -type f -size -50M</p></blockquote>
<p>Well, this will print out the full path and the file names, you won&#8217;t know which file is at what size. So to improve this, we can execute an <strong>ls</strong> command on each output,</p>
<blockquote><p>$ find / -type f -size -50M -exec ls -lh {} \;</p></blockquote>
<p>On this command, the <strong>{}</strong> refers to the output of each find command, and the <strong>\;</strong> is mandatory since we need to tell <strong>find</strong> where our <strong>-exec</strong> line ends, hence the escape character. (<strong>\</strong>)</p>
<p>Even though this looks good, we can keep improving by printing out the file size all in the same units. (Let&#8217;s say, megabytes) The problem with that is, the <strong>ls</strong> command can printout with the specified block size limit but it will take that block size <em><a href="http://www.thefreedictionary.com/Quantised" target="_blank">quantised</a></em>, meaning the output will only be the exact multiplicands of that block size. So if our block size is set to 1 MB and a file is 900 KB, <strong>ls</strong> will output it as 1 MB.</p>
<p>Although this is not so accurate, we can always work it around using <strong>awk</strong> to calculate the numeric values for us. Since <strong>ls</strong> normally prints out the file size in <em>bytes</em>, we can divide them to become actual <em>megabytes</em>. The line below will printout <strong>ls</strong> with actual megabytes.</p>
<blockquote><p>$ ls -l | awk &#8216;{print $1 &#8221; &#8221; $2 &#8221; &#8221; $3 &#8221; &#8221; $4 &#8221; &#8221; $5/1048576 &#8221; &#8221; $6 &#8221; &#8221; $7 &#8221; &#8221; $8 &#8221; &#8221; $9}&#8217;</p></blockquote>
<p>Well, we only need the <em>5th</em> column and the <em>9th</em> column which are the <em>size</em> and the <em>path</em> respectively, so the command below will suffice :</p>
<blockquote><p>$ ls -l | awk &#8216;{ print $5/1048576 &#8221; &#8221; $9 }&#8217;</p></blockquote>
<p>As you can see, we had to use a <em>pipe</em> to get things done here. So we need to use this pipe in our <em>exec</em> part of our <strong>find</strong> command, which is another problem. Well, the work around for this is to <strong>-exec</strong> a <em>shell instance</em> and pass the whole <strong>ls</strong> and <strong>awk</strong> line including the pipes so that new shell instance will handle things for us.</p>
<blockquote><p>$ find / -type f -size -50M -size +20M -exec sh -c &#8220;ls -l &#8216;{}&#8217;|awk &#8216;{print \$5/1048576 &#8221; MB: &#8221; \$9}&#8217;&#8221; \;</p></blockquote>
<p>Ok, let&#8217;s have a look at the command above. As you can see we narrowed our limits further, by getting only the files smaller than 50 MB and larger than 20 MB. We also passed our whole command with a shell instance. On this instance, the argument for <strong>ls</strong> was passed with the <strong>{}</strong> method. We apostrophized it (<strong>&#8221;</strong>) due to the possibility of having spaces in the filename, which would have caused a problem. After that, we&#8217;ve piped our output to <strong>awk</strong>, divided the <em>bytes</em>, and added a string &#8221; MB: &#8221; right before printing the <em>9th</em> column which is the file path. Don&#8217;t forget that we should escape the <em>$5</em> and <em>$9</em> using the escape character <strong>\</strong> since we don&#8217;t want the whole <strong>find</strong> line to process it before our <strong>awk</strong> does.</p>
<p>Well, the good thing is we have necessary output, the bad thing is that, it isn&#8217;t in order! So let&#8217;s make things even prettier and <em>sort</em> them, while making the output of each &#8220;<strong>MB:</strong>&#8221; bold to get some eye candy.</p>
<blockquote><p>$ find / -type f -size -50M -size +20M -exec sh -c &#8220;ls -l &#8216;{}&#8217;|awk &#8216;{print \$5/1048576 \&#8221; \033[1mMB:\033[0;0m \&#8221; \$9}&#8217;&#8221; \; | sort -nr -k1</p></blockquote>
<p>As you can see here, we&#8217;ve piped the <strong>find</strong> command to the <strong>sort</strong>, not the <strong>shell</strong> instance that we invoked in the <strong>find</strong> command, that&#8217;s why the pipe is right after our <strong>\;</strong> character.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/find-the-largest-files.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Reset DirectAdmin &#8220;admin&#8221; Password</title>
		<link>http://www.plugged.in/linux/directadmin-linux/how-to-reset-directadmin-admin-password.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-reset-directadmin-admin-password</link>
		<comments>http://www.plugged.in/linux/directadmin-linux/how-to-reset-directadmin-admin-password.html#comments</comments>
		<pubDate>Mon, 16 Apr 2012 00:20:15 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=306</guid>
		<description><![CDATA[DirectAdmin determines the admin password during installation and saves these passwords into the file called setup.txt. If you havent changed this password, you can find it in this file, to see the file contents: less /usr/local/directadmin/scripts/setup.txt adminpass= you can find admin password here, and if you didn&#8217;t change it after installing you should be able [...]]]></description>
			<content:encoded><![CDATA[<p>DirectAdmin determines the admin password during installation and saves these passwords into the file called setup.txt. If you havent changed this password, you can find it in this file, to see the file contents:</p>
<blockquote><p>less /usr/local/<em>directadmin</em>/scripts/setup.txt</p></blockquote>
<p>adminpass= you can find admin password here, and if you didn&#8217;t change it after installing you should be able to log in to your admin interface</p>
<p>to change admin password by ssh or console, write:</p>
<blockquote><p>passwd admin</p></blockquote>
<p>and enter your new password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/directadmin-linux/how-to-reset-directadmin-admin-password.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL root password recovery in DirectAdmin</title>
		<link>http://www.plugged.in/linux/directadmin-linux/mysql-root-password-recovery-in-directadmin.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-root-password-recovery-in-directadmin</link>
		<comments>http://www.plugged.in/linux/directadmin-linux/mysql-root-password-recovery-in-directadmin.html#comments</comments>
		<pubDate>Sun, 15 Apr 2012 23:58:02 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[set]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=291</guid>
		<description><![CDATA[DirectAdmin MySQL root password is set within the installation process and written down to setup.txt. If you didn&#8217;t change this password you can find the default one in the setup.txt, use the command below to see the contents of this file: less /usr/local/directadmin/scripts/setup.txt your password is stored in the line starting with mysql= If you [...]]]></description>
			<content:encoded><![CDATA[<p>DirectAdmin MySQL root password is set within the installation process and written down to setup.txt. If you didn&#8217;t change this password you can find the default one in the setup.txt, use the command below to see the contents of this file:</p>
<blockquote><p>less /usr/local/<em>directadmin</em>/scripts/setup.txt</p></blockquote>
<p>your password is stored in the line starting with mysql=</p>
<p>If you want to access mysql from ssh or console directly without typing password, create a file in /root/ dir called .my.cnf:</p>
<blockquote><p>touch /root/.my.cnf</p></blockquote>
<p>and edit this file with the vi editor:</p>
<blockquote><p>vi /root/.my.cnf</p></blockquote>
<p>Add the lines below:</p>
<blockquote><p>[client]<br />
user=root<br />
password=XXXXXX</p></blockquote>
<p>Fill the password with the pass you got from setup.txt, save the file with SHIFT+ZZ or :wq and exit. After this step just write <strong>mysql </strong>to enter MySQL console directly without password.</p>
<blockquote><p>[root@test ~]# mysql<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 169833<br />
Server version: 5.0.77-log MySQL Community Edition (GPL)</p>
<p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the buffer.</p>
<p>mysql&gt;</p></blockquote>
<p>..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/directadmin-linux/mysql-root-password-recovery-in-directadmin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step III: DirectAdmin post installation tasks</title>
		<link>http://www.plugged.in/linux/directadmin-linux/step-iii-directadmin-post-installation-tasks.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=step-iii-directadmin-post-installation-tasks</link>
		<comments>http://www.plugged.in/linux/directadmin-linux/step-iii-directadmin-post-installation-tasks.html#comments</comments>
		<pubDate>Sun, 15 Apr 2012 23:42:35 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[directadmin]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=279</guid>
		<description><![CDATA[There are some important processes after successfully installation of DirectAdmin and if you miss these steps, the system may not work efficiently. After logged in with the admin user: (default admin password is located at: /usr/local/directadmin/scripts/setup.txt) Add an additional IP for the second DNS Server, to do so, click to the &#8220;IP Management&#8221; link in [...]]]></description>
			<content:encoded><![CDATA[<p>There are some important processes after successfully installation of DirectAdmin and if you miss these steps, the system may not work efficiently. After logged in with the admin user: (default admin password is located at: /usr/local/directadmin/scripts/setup.txt)</p>
<ol>
<li>Add an additional IP for the second DNS Server, to do so, click to the &#8220;IP Management&#8221; link in the &#8220;Admin Level&#8221;. While adding IP address, pay attention to SUBNET value and be sure to assign the same subnet as the IP address or you network may hang, after adding process is complete, choose 2 IP adresses and click to the &#8220;Assign to admin&#8221; button.</li>
<li>In the second step, Click &#8220;user level&#8221; link located at the right-top side of the page. Click &#8220;Domain Setup&#8221; link and click &#8220;add new domain&#8221;. enter the main site name without www.</li>
<li>Switch to reseller level, below the title &#8220;Extra Features&#8221; click &#8220;nameservers&#8221; link. Use the IP addresses just added to create the name servers of the default domain. Select both IP addresses and click &#8220;Create&#8221; button. With this step finished you set-up basic operation of DirectAdmin. Further, you can create your reseller plans and you can edit your main site&#8217;s settings through &#8220;User Level&#8221; menu.</li>
<li>You can update your system any time using &#8220;yum upgrade -y&#8221; via ssh or terminal and your control panel through a terminal using &#8220;custombuild&#8221;</li>
<li>http://www.directadmin.com/forum/ includes various information about your control panel.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/directadmin-linux/step-iii-directadmin-post-installation-tasks.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step II: DirectAdmin Setup</title>
		<link>http://www.plugged.in/linux/directadmin-linux/step-ii-directadmin-setup.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=step-ii-directadmin-setup</link>
		<comments>http://www.plugged.in/linux/directadmin-linux/step-ii-directadmin-setup.html#comments</comments>
		<pubDate>Sun, 15 Apr 2012 22:20:41 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=273</guid>
		<description><![CDATA[If you prepared your server with the directives we mentioned on the previous article, it will be so much easy to install DireactAdmin software. You must download the setup file from DirectAdmin site: Download DirectAdmin setup file &#38; run: mkdir /root/DA cd /root/DA wget http://www.directadmin.com/setup.sh sh setup.sh Steps to follow: DirectAdmin setup will ask you [...]]]></description>
			<content:encoded><![CDATA[<p>If you prepared your server with the directives we mentioned on the previous article, it will be so much easy to install DireactAdmin software.</p>
<p>You must download the setup file from DirectAdmin site:</p>
<h3>Download DirectAdmin setup file &amp; run:</h3>
<blockquote><p>mkdir /root/DA<br />
cd /root/DA<br />
wget http://www.directadmin.com/setup.sh<br />
sh setup.sh</p></blockquote>
<h3>Steps to follow:</h3>
<p>DirectAdmin setup will ask you your account number &amp; your license number, if you mistype accidentally just press CTRL+C to quit and restart setup. You need to wait ten seconds after restarting setup.</p>
<p>After that step the setup will ask you your domain name (hostname) bare in mind that wirte your hostname as subdomain + domain + tld as we offer the subdomain part should better be &#8220;mail&#8221;. Such that your domain name is myserver.com then write your hostname as &#8220;mail.myserver.com&#8221;, this way your mail server inside DirectAdmin should work better.</p>
<p>After that step, follow the directives, (we offer apache 2, php5 installation and &#8220;yes&#8221; to all questions) and finish the installation. Always consider selecting the second option,</p>
<p>You should better restart the server but restarting DirectAdmin is enough with the command:</p>
<blockquote><p>service directadmin restart</p></blockquote>
<p>After the installation you can enter to your admin site by typing http://SERVERIP:2222 to your favorite browser. Don&#8217;t panic if some of the services is not responding after setup, this is because you need to make some DNS configurations and you need to enter your master domain name to the control panel(cp).</p>
<p>DirectAdmin setup creates a log file called setup.txt where all your passwords for your server is present:</p>
<blockquote><p>less /usr/local/directadmin/scripts/setup.txt</p></blockquote>
<p>Go to Step three for making post installation tasks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/directadmin-linux/step-ii-directadmin-setup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things you should know before installing DirectAdmin</title>
		<link>http://www.plugged.in/linux/directadmin-linux/things-you-should-know-before-installing-directadmin.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=things-you-should-know-before-installing-directadmin</link>
		<comments>http://www.plugged.in/linux/directadmin-linux/things-you-should-know-before-installing-directadmin.html#comments</comments>
		<pubDate>Sun, 15 Apr 2012 20:34:01 +0000</pubDate>
		<dc:creator>ckaraca</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[directadmin]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=263</guid>
		<description><![CDATA[DirectAdmin is one of the mostly used Hosting Control Panels around, for single server installations it is easy to setup and start selling hosting busines, some advantages of DirectAdmin are; Easy to install, can be installed on a VPS or VDS also Less overhead, minimal code Easy to maintain &#38; upgrade Easy to modify wtihout [...]]]></description>
			<content:encoded><![CDATA[<p>DirectAdmin is one of the mostly used Hosting Control Panels around, for single server installations it is easy to setup and start selling hosting busines, some advantages of DirectAdmin are;</p>
<ul>
<li>Easy to install, can be installed on a VPS or VDS also</li>
<li>Less overhead, minimal code</li>
<li>Easy to maintain &amp; upgrade</li>
<li>Easy to modify wtihout breking the continuity</li>
<li>Huge fans and great forum that you can find your solutions</li>
</ul>
<h3>Operating System Setup (RedHat Enterprise Linux, CentOS or CloudLinux is recomended)</h3>
<p>In order to make your system more secure to attacks, trojans and backdoors you should make a seprate partition for /tmp and restrict execute rights for all users. size between <strong>4 to 6 GB</strong> is enough for the /tmp partition. Follow our directives on howto make tmp partition more secure in Linux Security Documents and disable execute permissions in /etc/fstab.</p>
<p>For more secure installation do not blindly install default packages or any Desktop environment. You should remove all selected groups and belonging packages from the installation, be aware that CentOS could be installed with the first CD, if the setup asks for additional CDs, you most probably forgot to uncheck some packages. <strong>With this method you should only need the first CD of CentOS distro.</strong></p>
<p>We recommend using YUM as an updater/package installer for Linux.</p>
<h3>Close firewall with CHKCONFIG</h3>
<p>You might enable it after installing DirectAdmin or you should better install csf</p>
<blockquote><p>chkconfig  iptables off<br />
chkconfig ip6tables off</p>
<p>service iptables stop<br />
service ip6tables stop</p></blockquote>
<h3>Disable SELINUX</h3>
<p>SELINUX is enabled default in LINUX and if you don&#8217;t disable or modify you cannot access some of the services from the outside such as httpd (apache). Open the config file with the following command:</p>
<blockquote><p>sed -i &#8216;s/SELINUX=.*/SELINUX=disabled/&#8217; /etc/sysconfig/selinux<br />
/usr/sbin/setenforce 0</p></blockquote>
<h3> Install Prerequisities &amp; Updates:</h3>
<p>DirectAdmin requires some additional packages before entering the setup. Use YUM to upgrade your system:</p>
<blockquote><p>yum upgrade -y</p></blockquote>
<p>Install additional packages required by DirectAdmin:</p>
<blockquote><p>CentOS 5.x #yum install gcc gcc-c++ make vixie-cron flex wget quota perl gd<br />
CentOS 6.x #yum install gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-dev which bc wget gd</p></blockquote>
<p>If you get a conflict error with perl, perl was already installed before, please remove it from the above code and re-try.</p>
<p>Set hostname to &#8220;mail.yourservername.tld&#8221; before starting setup, using mail. saves you from confusions &amp; mail transmission problems:</p>
<blockquote><p>hostname mail.yourserver.tld</p></blockquote>
<p>Go to step two: DirectAdmin Setup</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/directadmin-linux/things-you-should-know-before-installing-directadmin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Job to Crontab Using BASH</title>
		<link>http://www.plugged.in/linux/adding-job-to-crontab-using-bash.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-job-to-crontab-using-bash</link>
		<comments>http://www.plugged.in/linux/adding-job-to-crontab-using-bash.html#comments</comments>
		<pubDate>Mon, 09 Apr 2012 06:51:41 +0000</pubDate>
		<dc:creator>M. Emre Aydin</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.plugged.in/?p=253</guid>
		<description><![CDATA[Adding a task into crontab is relatively easy. You just enter the crontab with &#8220;$ crontab -e&#8221; and add the necessary job, save and exit. But adding a job in your bash script is not that simple, because what you have to do is, to get the entire list of the jobs, append your new [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a task into crontab is relatively easy. You just enter the crontab with &#8220;$ crontab -e&#8221; and add the necessary job, save and exit.</p>
<p>But adding a job in your bash script is not that simple, because what you have to do is, to get the entire list of the jobs, append your new job and save them as a whole.</p>
<p>Here&#8217;s a snippet of how to do that. Here, we assume that we want to run a script called &#8220;myscript.sh&#8221; every 5 minutes and the full path of the script is &#8220;$my_path/myscript.sh&#8221;. Don&#8217;t forget that in everycase, adding a job to crontab you have to specify the full path!</p>
<p>So basically, add these lines to your script.</p>
<p><code>command="$my_path/myscript.sh" > /dev/null 2>&#038;1"<br />
job="* /5 * * * * $command"<br />
cat <(grep -i -v "$command" <(crontab -l)) <(echo "$job") | crontab -<br />
</code></p>
<p>Note that this is for <strong>BASH</strong>, not <strong>SH</strong>, since the syntax with the brackets is only available in BASH.</p>
<p>As you can see, the last line is the critical one. In the first brackets using the grep tool, we catch everything currently in the crontab "except our command", so this will prevent from adding the $command even if it is already in crontab. After that, we echo our job to the end of the current jobs, and redirect it to cat as a standart input. Since the standart output of cat will be the whole crontab list "with our new job", we can use crontab with its "-" option to get the arguments from the stadart output.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plugged.in/linux/adding-job-to-crontab-using-bash.html/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/

Page Caching using apc
Database Caching 21/182 queries in 0.068 seconds using apc
Object Caching 2354/2516 objects using apc

Served from: www.plugged.in @ 2012-05-20 13:49:47 -->
