<?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>Open Source | /var/logs/paulooi.log</title>
	<atom:link href="https://logs.paulooi.com/category/open-source/feed" rel="self" type="application/rss+xml" />
	<link>https://logs.paulooi.com</link>
	<description>Systems Admin, Web Development and etc</description>
	<lastBuildDate>Tue, 21 Jul 2015 04:33:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>How to Rsync from Remote Server to Synology</title>
		<link>https://logs.paulooi.com/how-to-rsync-from-remote-server-to-synology.php</link>
					<comments>https://logs.paulooi.com/how-to-rsync-from-remote-server-to-synology.php#comments</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Tue, 21 Jul 2015 04:33:33 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[synology]]></category>
		<category><![CDATA[sysadmin]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1757</guid>

					<description><![CDATA[<p>I hava a synology at home, mainly use to store important files, and realize beside have a backup of my server files on dropbox, may be it can have another copy in Synology as well. I explored the possibility of...</p>
The post <a href="https://logs.paulooi.com/how-to-rsync-from-remote-server-to-synology.php">How to Rsync from Remote Server to Synology</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>I hava a synology at home, mainly use to store important files, and realize beside have a backup of my server files on dropbox, may be it can have another copy in Synology as well. I explored the possibility of rsync the backup either on dropbox or server into synology, and&#8230; it works!</p>
<p>Here is what you need to prepare before proceed with the backup. </p>
<p>1. Create a directory for backup. i.e folder name of ServerBackup. Go to &#8220;Control Panel&#8221; -> &#8220;Shared Folder&#8221;. </p>
<p>2. Enable SSH on Synology. Go to &#8220;Control Panel&#8221; -> &#8220;Terminal &#038; SNMP&#8221; -> &#8220;Enable SSH Service&#8221;. If you option to change the SSH port or not <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-enablessh.png"><img decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-enablessh-300x140.png" alt="synology-backup-enablessh" width="300" height="140" class="aligncenter size-medium wp-image-1758" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-enablessh-300x140.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-enablessh.png 594w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>3. Try to ssh into Synology with username &#8220;root&#8221;. The root password is the same with &#8220;admin&#8221;. </p>
<p>If are you done, let&#8217;s do it. </p>
<p><strong>Generate SSH Key</strong></p>
<p>You wouldn&#8217;t want to key in password whenever want to access to the server to grab the file. Generate a &#8220;custom&#8221; ssh key which will be used for synology. Remember, please do not set the password. Give you ssh file a &#8220;special name&#8221;, DO NOT use the default. I.e we used synobackup, there are 2 files will be generate </p>
<p>1. synobackup &#8211; This is the private key files<br />
2. synobackup.pub &#8211; This is the public key which will be placed on the remote server. </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-sshkey.png"><img fetchpriority="high" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-sshkey-300x231.png" alt="synology-backup-sshkey" width="300" height="231" class="aligncenter size-medium wp-image-1759" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-sshkey-300x231.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-sshkey.png 537w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Next, we will copy this 2 files into Synology folder ServerBackup. We create a folder name &#8220;scripts&#8221;, and the file will be placed in synology</p>
<p>1. /Volume/ServerBackup/scripts/synobackup<br />
2. /Volume/ServerBackup/scripts/synobackup.pub</p>
<p>We will copy the key on synobackup.pub into remote server&#8217;s ssh directory &#8220;.ssh/authorized_keys&#8221; for the user&#8217;s home directory where you will login with the username later. i.e &#8220;/home/takizo/.ssh/authorized_keys&#8221;</p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-homeauthorizedkey.png"><img decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-homeauthorizedkey-300x101.png" alt="synology-backup-homeauthorizedkey" width="300" height="101" class="aligncenter size-medium wp-image-1760" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-homeauthorizedkey-300x101.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/synology-backup-homeauthorizedkey.png 453w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Ok.. we are done with ssh thingy. Let&#8217;s write some script. </p>
<p><strong>Simple Scripting</strong></p>
<p>Next, we will do some scripting as below. </p>
<pre>
#!/bin/ash

#This is the private key
PRIVKEY="/volume/ServerBackup/scripts/snology"

#This is the folder you would like to backup from
HOSTFOLDER=/backup/*

#This is the folder you would like to backup to Synology
DESTFOLDER="/volume/ServerBackup/database/server-godzilla/"

#We will be using rsync in synology, this will do the rync! 
/usr/syno/bin/rsync -avz -e "ssh -p7777 -i $PRIVKEY" takizo@godzilla.takizo.com:$HOSTFOLDER $DESTFOLDER
</pre>
<p>Save the script above into your Synology backup folder which created earlier &#8220;/volume/ServerBackup/scripts/database.backup.sh&#8221; </p>
<p>Please take note that the remote folder is define by yourself. We are done with the script, it&#8217;s time to Execute it! </p>
<p><strong>Configure the Backup Script</strong></p>
<p>Due to it&#8217;s the first time access to the remote server, you need to manually run the script in shell to accept the SSH session. We are almost there. </p>
<p>SSH to Synology server </p>
<pre>
ssh -p2222 root@your_synology_ip
mydisk> cd /volume/ServerBackup/scripts
mydisk> ./database.backup.sh
The authenticity of host '[godzilla.takizo.com]:2222 ([123.456.123.111]:2222)' can't be established.
ECDSA key fingerprint is f7:9b:d6:92:7b:33.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[godzilla.takizo.com]:2222,[123.456.123.111]:2222' (ECDSA) to the list of known hosts.
receiving incremental file list
20150721122502.dbbackup.tar.gz

sent 42 bytes  received 18901016 bytes  1021678.81 bytes/sec
total size is 18997573  speedup is 1.01
</pre>
<p>The important part for this action is this line</p>
<pre>
Warning: Permanently added '[godzilla.takizo.com]:2222,[123.456.123.111]:2222' (ECDSA) to the list of known hosts.
</pre>
<p>This will add the host into /root/.ssh/known_hosts, when the script is run next time, it will not prompt the message again.</p>
<p><strong>Setup the Task on Synology</strong></p>
<p>Since the script is working perfectly fine. The last step is add it into Synology&#8217;s Task Schedule. </p>
<p>1. Go to &#8220;Control Panel&#8221; -> &#8220;Task Schedule&#8221;<br />
2. Create &#8220;User defined-script&#8221;<br />
3. Give a meaningful name for your &#8220;Task&#8221;<br />
4. User choose &#8220;root&#8221; or any user you prefer<br />
5. User-defined script: The script you created earlier inside Synology folder, &#8220;/volume/ServerBackup/scripts/database.backup.sh&#8221;<br />
6. Put up a schedule for this, how often it should run and at what time. </p>
<p>After the schedule has been created, try run it again and check is the files transfer into your Synology folder (if you don&#8217;t have new copy of file in the server, delete the files earlier being rsync into synology).</p>
<p>Yep, basically you have another copy of backup on synology! Enjoy backup more stuff from remote server <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>The post <a href="https://logs.paulooi.com/how-to-rsync-from-remote-server-to-synology.php">How to Rsync from Remote Server to Synology</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-rsync-from-remote-server-to-synology.php/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Sublime Text Editor &#8211; Package Control</title>
		<link>https://logs.paulooi.com/sublime-text-editor-package-control.php</link>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Thu, 16 Jul 2015 13:56:20 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[sublime text]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1745</guid>

					<description><![CDATA[<p>Today I found an interesting package to install on Sublime Text, may be I did not pay much attention on the sublime text tutorial online, but this seems to be one of the &#8220;must install&#8221; package on Sublime Text; which...</p>
The post <a href="https://logs.paulooi.com/sublime-text-editor-package-control.php">Sublime Text Editor – Package Control</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Today I found an interesting package to install on Sublime Text, may be I did not pay much attention on the sublime text tutorial online, but this seems to be one of the &#8220;must install&#8221; package on Sublime Text; which is &#8220;<a href="https://packagecontrol.io/installation" target="_blank">Package Control</a>&#8221;</p>
<p>I am still using Sublime Text 2, Sublime Text 3 still in Beta version. To install Package Control;</p>
<p>1. Go to Sublime Text&#8217;s console. View -&gt; Show Console</p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-show-console.png"><img loading="lazy" decoding="async" class="aligncenter size-medium wp-image-1746" src="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-show-console-300x237.png" alt="sublime-text-show-console" width="300" height="237" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-show-console-300x237.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-show-console-1024x808.png 1024w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-show-console.png 1240w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>2. Paste the line into the console as shown on &#8220;<a href="https://packagecontrol.io/installation" target="_blank">Package Control</a>&#8221; website. in my case it pasting this;</p>
<pre>
import urllib2,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation') 
</pre>
<p>It will looks like below and hit enter. </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-300x31.png" alt="sublime-text-package-control" width="300" height="31" class="aligncenter size-medium wp-image-1747" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-300x31.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-1024x105.png 1024w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>After the installation has been done, try to install a package name BeautifyRuby.</p>
<p>1. Launch Package Control: Install Package by &#8220;AppleCommand + Shift + P&#8221; or in Windows &#8220;Ctrl + Shift + p&#8221;</p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-install.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-install-300x166.png" alt="sublime-text-package-control-install" width="300" height="166" class="aligncenter size-medium wp-image-1749" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-install-300x166.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-install-1024x566.png 1024w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-install.png 1046w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>2. Search for BeautifyRuby and hit enter to install </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-beautify-ruby.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-beautify-ruby-300x157.png" alt="sublime-text-package-control-beautify-ruby" width="300" height="157" class="aligncenter size-medium wp-image-1748" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-beautify-ruby-300x157.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-beautify-ruby-1024x536.png 1024w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-beautify-ruby.png 1032w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>3. You may notice the status bar showing the installation status on the package. </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-installation.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-installation-300x91.png" alt="sublime-text-package-control-installation" width="300" height="91" class="aligncenter size-medium wp-image-1750" srcset="https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-installation-300x91.png 300w, https://logs.paulooi.com/wp-content/uploads/2015/07/sublime-text-package-control-installation.png 672w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>I am going to explore packages offer by Package Control in Sublime Text <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>The post <a href="https://logs.paulooi.com/sublime-text-editor-package-control.php">Sublime Text Editor – Package Control</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Disallow or Rate Limit Web Server Mail in Exim</title>
		<link>https://logs.paulooi.com/how-to-disallow-or-rate-limit-web-server-mail-in-exim.php</link>
					<comments>https://logs.paulooi.com/how-to-disallow-or-rate-limit-web-server-mail-in-exim.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Tue, 25 Mar 2014 01:49:58 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[Exim]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1666</guid>

					<description><![CDATA[<p>Recently one of the apache webserver&#8217;s vhost was compromise and allow spammer to use the script to perform massive outgoing email spam. As usual, due to un-patch WordPress&#8217;s engine from a user on the web server. Ended up the &#8220;hacker&#8221;...</p>
The post <a href="https://logs.paulooi.com/how-to-disallow-or-rate-limit-web-server-mail-in-exim.php">How to Disallow or Rate Limit Web Server Mail in Exim</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Recently one of the apache webserver&#8217;s vhost was compromise and allow spammer to use the script to perform massive outgoing email spam. As usual, due to un-patch WordPress&#8217;s engine from a user on the web server. Ended up the &#8220;hacker&#8221; been using the PHP&#8217;s mail() function sending a massive 100k++ outgoing email to email provider such as yahoo mail and gmail. <span id="more-1666"></span></p>
<p>There were a lot email queue in Exim&#8217;s queue, due to the blockage from recipient server. Unfortunately WordPress doesn&#8217;t have SMTP setting for outgoing email notification, it has to rely on third party plugins. </p>
<p>Here is what we implement on SMTP MTA to deny/rate limit outgoing from PHP&#8217;s mail() function. </p>
<p>On Exim config file, before hitting ACL configuration, place this config for non-smtp setting</p>
<pre>
<code>
acl_not_smtp = acl_check_not_smtp
</code>
</pre>
<p>After &#8220;begin acl&#8221; section, place this config </p>
<pre>
<code>
acl_check_not_smtp:

  deny
        senders = www@domain.com
        message = sorry server is offline

  deny
        ratelimit = 20 / 1h / strict / $sender_address_domain
        senders = *@domain.com
        message = sorry server is offline

  accept
</code>
</pre>
<p>The first rule is totally deny anything from apache&#8217;s vhost. It means non of the apache&#8217;s vhost can send outgoing email with PHP mail() function. If you are not comfortable with this. Can try on the second rules, which is rate limit the outgoing email, which can help to eliminate the massive outgoing email happened on apache web server UID. </p>
<p>Have fun controlling and fight with the spam <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>The post <a href="https://logs.paulooi.com/how-to-disallow-or-rate-limit-web-server-mail-in-exim.php">How to Disallow or Rate Limit Web Server Mail in Exim</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-disallow-or-rate-limit-web-server-mail-in-exim.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Android ADB in Mac OSX</title>
		<link>https://logs.paulooi.com/how-to-install-android-adb-in-mac-osx.php</link>
					<comments>https://logs.paulooi.com/how-to-install-android-adb-in-mac-osx.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Tue, 31 Dec 2013 08:53:43 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[cwm]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[twrp]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1648</guid>

					<description><![CDATA[<p>Wanted to root your Android phone and flash it with custom ROM? Before flashing your Android phone with custom ROM, you need custom Recovery ROM such as ClockworkMod Recovery (CWM) Team Win Recovery Project (TWRP) The default &#8220;Recovery ROM&#8217; comes...</p>
The post <a href="https://logs.paulooi.com/how-to-install-android-adb-in-mac-osx.php">How to Install Android ADB in Mac OSX</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Wanted to root your Android phone and flash it with custom ROM? </p>
<p>Before flashing your Android phone with custom ROM, you need custom Recovery ROM such as </p>
<ul>
<li>ClockworkMod Recovery (CWM)</li>
<li>Team Win Recovery Project (TWRP)</li>
</ul>
<p>The default &#8220;Recovery ROM&#8217; comes with your phone does not allow to flash/install custom ROM. Hence, before flashing your phone with custom ROM, custom &#8220;Recovery&#8221; is needed. Before flashing custom &#8220;recovery ROM&#8221;, you need tools to do that. </p>
<p>adb &#038; fastboot are the tools which will use to flash Android&#8217;s &#8220;recovery&#8221; ROM. Let&#8217;s see how to install ADB &#038; FASTBOOT in Mac OSX. </p>
<p><span id="more-1648"></span></p>
<h1>1. Download Android SDK</h2>
<p>Android SDK can be downloaded at Android Developer website. Click the <a href="https://developer.android.com/sdk/index.html" title="Android SDK Website">link here to visit the website</a>. Choose &#8220;Download the SDK. ADT bundle for Mac&#8221;</p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2013/12/Screen-Shot-2013-12-31-at-4.38.30-PM.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2013/12/Screen-Shot-2013-12-31-at-4.38.30-PM-300x147.png" alt="Android SDK ADT Bundle for Mac" width="300" height="147" class="aligncenter size-medium wp-image-1649" srcset="https://logs.paulooi.com/wp-content/uploads/2013/12/Screen-Shot-2013-12-31-at-4.38.30-PM-300x147.png 300w, https://logs.paulooi.com/wp-content/uploads/2013/12/Screen-Shot-2013-12-31-at-4.38.30-PM.png 724w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<h1>2. Install and Configure</h2>
<p>After ADT bundle has been downloaded, extract the file into download folder. </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2013/12/AndroidADT.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2013/12/AndroidADT-300x29.png" alt="AndroidADT" width="300" height="29" class="aligncenter size-medium wp-image-1650" srcset="https://logs.paulooi.com/wp-content/uploads/2013/12/AndroidADT-300x29.png 300w, https://logs.paulooi.com/wp-content/uploads/2013/12/AndroidADT.png 665w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>I have Android SDK store in my &#8220;Work&#8221; directory and renamed it from adt-bundle-mac-x86_64-20131030 to AndroidDevel &#8220;~/Document/Work/AndroidDevel&#8221; </p>
<p>adb and fastboot command tool can be found at &#8220;sdk/platform-tools&#8221; folder. You will need to run this 2 command tools in order to flash your phone. </p>
<h1>3. Configure with Terminal</h2>
<p>Open up your &#8220;Terminal&#8221; and open <em>.profile</em> shell profile. </p>
<pre>
<code>
# vi .profile 
</code>
</pre>
<p>Look for the &#8220;export PATH&#8221; and expand further by adding in platform-tools folder </p>
<pre>
<code>
export PATH=/usr/local/bin:~/Document/Work/AndroidDevel/sdk/platform-tools 
</code>
</pre>
<p>Depend on where do you store the tools. It may not me same with my configuration. Please do not miss the &#8220;:&#8221; semicolon, it means to expand and include other folder. Save your file and refresh your bash environment with command below </p>
<pre>
<code>
# source ~/.profile 
</code>
</pre>
<h1>4. Complete and Look For Your Device</h2>
<p>Plugin your device with USB cable and prompt for your device with command below </p>
<pre>
<code>
# adb devices 
</code>
</pre>
<p>You should be able to see the list of device as below </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2013/12/AdbDevices.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2013/12/AdbDevices.png" alt="Android SDK adb &amp; fastbook" width="239" height="62" class="aligncenter size-full wp-image-1651" /></a></p>
<p>Congrats, adb &#038; fastboot are installed on your Mac OSX <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Next post I will show how to flash recovery ROM on a HTC ONE M7 device. </p>The post <a href="https://logs.paulooi.com/how-to-install-android-adb-in-mac-osx.php">How to Install Android ADB in Mac OSX</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-install-android-adb-in-mac-osx.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Enable Subject Header Logging in Exim&#8217;s main_log</title>
		<link>https://logs.paulooi.com/how-to-enable-subject-header-logging-in-exims-main_log.php</link>
					<comments>https://logs.paulooi.com/how-to-enable-subject-header-logging-in-exims-main_log.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Wed, 20 Nov 2013 14:14:05 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Exim]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[mailserver]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1411</guid>

					<description><![CDATA[<p>Yes, I have stopped writing since 2011 😉 All the latest posts are interesting article I read and wish to share with you. I&#8217;ve been maintaining a customer mailserver since 2003, growing from 30 users to 200+ users today, it...</p>
The post <a href="https://logs.paulooi.com/how-to-enable-subject-header-logging-in-exims-main_log.php">How to Enable Subject Header Logging in Exim’s main_log</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Yes, I have stopped writing since 2011 <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> All the latest posts are interesting article I read and wish to share with you. </p>
<p>I&#8217;ve been maintaining a customer mailserver since 2003, growing from 30 users to 200+ users today, it seems how big and fast the company grown, good thing they still engaged me on maintaining their mail/web server. </p>
<p><strong>Turn On Subject Header on Exim Logging</strong></p>
<p>Turning on Subject Header on Exim logging make your life easier for troubleshooting purpose. By default, exim&#8217;s logging on mainlog does not provide Subject Header, to turn on follow the steps below;</p>
<ul>
<li>1. Edit Exim&#8217;s main config file, using /usr/local/exim/configure </li>
<li>2. On the main/global config, usually before ACL section, add the line below</li>
<pre>
<code>
log_selector = +subject +delivery_size +size_reject
</code>
</pre>
<li>Above log_selector include logging the delivery size of the email, and size_reject. If the email is rejected by the server, you can find out what was the rejected size.</li>
</ul>
<p>That&#8217;s it. Will try to pen down stuff more often <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>The post <a href="https://logs.paulooi.com/how-to-enable-subject-header-logging-in-exims-main_log.php">How to Enable Subject Header Logging in Exim’s main_log</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-enable-subject-header-logging-in-exims-main_log.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OS X Lion Macports</title>
		<link>https://logs.paulooi.com/os-x-lion-macports-1.php</link>
					<comments>https://logs.paulooi.com/os-x-lion-macports-1.php#comments</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Fri, 22 Jul 2011 06:54:05 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[snow leopard]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1493</guid>

					<description><![CDATA[<p>OS X Lion Macports, Can I upgrade from Snow Leopard? With the new release of Apple Mac OS X Lion, there are a lot of changes on the kernel and backends. Therefore I don&#8217;t think it&#8217;s possible to do port...</p>
The post <a href="https://logs.paulooi.com/os-x-lion-macports-1.php">OS X Lion Macports</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<h1>OS X Lion Macports, Can I upgrade from Snow Leopard?</h1>
<p>With the new release of Apple Mac OS X  Lion, there are a lot of changes on the kernel and backends. Therefore I don&#8217;t think it&#8217;s possible to do port upgrade on Macports in order to upgrade your existing or installed ports in OS X Snow Leopard. <span id="more-1493"></span></p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports.png" alt="OS X Lion Macports" title="OS X Lion Macports" width="183" height="70" class="aligncenter size-full wp-image-1494" /></a></p>
<p>I have tried several times to upgrade ports previously installed in Snow Leopard, unfortunately no luck to getting it works in OS X Lion Macports, some library couldn&#8217;t load and some library cannot be found. Failed miserably with tons of error messages. </p>
<p>I have decided to re-install, or rather clean install Macports on my newly installed Mac OS X Lion. </p>
<h2>OS X Lion Macports with XCode 4.1</h2>
<p>Before installing <strong>OS X Lion Macports</strong>, you need to download and install latest Xcode 4.1 which designs for Mac OS X Lion. Xcode 4.1 can be downloaded at App Store, the file size is around 2.96GB, it might take some time for user who has slow internet access. </p>
<p>The existing Xcode on your Snow Leopard will not support latest version of Macports. </p>
<p><a href="https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports-xcode.png"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports-xcode-300x259.png" alt="OS X Lion Macports" title="OS X Lion Macports" width="300" height="259" class="aligncenter size-medium wp-image-1495" srcset="https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports-xcode-300x259.png 300w, https://logs.paulooi.com/wp-content/uploads/2011/07/os-x-lion-macports-xcode.png 620w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<h2>OS X Lion Macports, Before Clean Install</h2>
<p>Before proceed with <em>OS X Lion Macports</em> clean install, I suggest you do a few things as I listed below. </p>
<p>1. Dump current installed packages database. Run &#8220;port installed > installed.ports.log&#8221; to keep a list of packages currently install on your Macports. Which later you will need to re-install all the packages. Below is the sample of my current installed packages. </p>
<pre>
<code>
  apache2 @2.2.19_0+preforkmpm (active)
  apr @1.4.5_1 (active)
  apr-util @1.3.12_0 (active)
  atk @1.32.0_0 (active)
  autoconf @2.68_2 (active)
  autoconf213 @2.13_1 (active)
  automake @1.11.1_0 (active)
  axel @2.4_0 (active)
  bison @2.5_0 (active)
  bzip2 @1.0.6_0 (active)
  c-ares @1.7.4_0 (active)
  cacti @0.8.7g_1 (active)
  cairo @1.10.2_3 (active)
  ctags @5.8_0 (active)
  curl @7.21.7_0+ssl (active)
  curl-ca-bundle @7.21.7_0 (active)
  cyrus-sasl2 @2.1.23_3+kerberos (active)
  db46 @4.6.21_6 (active)
  dbus @1.4.12_0 (active)
  dia @0.97.1_2 (active)
  docbook-xml @5.0_0 (active)
</code>
</pre>
<p>2. Dump or backup your database data such as PostgreSQL and MySQL. </p>
<p>3. Backup your old directory, which is &#8220;/opt/local&#8221;, rename it to &#8220;/opt/local-snowleopard&#8221;, this is to keep all your data in order to migrate over to newly installed Macports later on. </p>
<h2>OS X Lion Macports Clean Install</h2>
<p>Macports team has not release latest Macports package/installer for OS X Lion (as when I written this post). If the official download is not available for OS X Lion, you need to install it from latest subversion built.</p>
<p>Create a new directory to check out latest subversion built for <u><a href="http://guide.macports.org/#installing.macports.subversion" title="OS X Lion Macports">OS X Lion Macports</a></u></p>
<pre>
<code>
# mkdir /opt/lion-macports 
# cd /opt/lion-macports
# svn co http://svn.macports.org/repository/macports/trunk
</code>
</pre>
<p>This will download the latest build of subversion, next we will proceed with OS X Lion Macports installation </p>
<pre>
<code>
# cd /opt/lion-macports/trunk/base
# ./configure --enable-readline
# make
# sudo make install
# make distclean 
</code>
</pre>
<p>After installation, make sure OS X Lion Macports binary is exported into your environment path, existing user should not have this problem, for new user, edit your environment path as show below; Search for export path line</p>
<pre>
<code>
#sudo vi ~/.bash_profile
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
</code>
</pre>
<p>Add /opt/local/bin and /opt/local/sbin into export PATH. </p>
<p>After environment path has been configured, get the latest update port tree and your are done </p>
<pre>
<code>
# sudo port -d selfupdate 
</code>
</pre>
<h2>OS X Lion Macports. Install package</h2>
<p>You are basically you done Macports installation on Mac OS X Lion. Refer to your dump file I mentioned earlier &#8220;installed.ports.log&#8221;, re-install all the packages or the packages you need in newly installed OS X Lion Macports</p>
<p>I know it&#8217;s a little PITA (Pain In the Ass), but so far this is the only solution which can fix my problem by migrating into OS X Lion Macports. </p>
<h3>OS X Lion Macports. Re-install MySQL</h3>
<p>This is an example how I reinstall and load MySQL database which previously installed on Snow Leopard Macports into OS X Lion Macports. </p>
<p>1. Firstly, clean install MySQL5.1 database</p>
<pre>
<code>
# sudo port -v install mysql5-server 
</code>
</pre>
<p>You might see error with plist conflict</p>
<pre>
<code>
</code>
Error: Target org.macports.activate returned: Image error: /Library/LaunchDaemons/org.macports.mysql5.plist already exists and does not belong to a registered port.  Unable to activate port mysql5-server. Use 'port -f activate mysql5-server' to force the activation.
Warning: the following items did not execute (for mysql5-server): org.macports.activate
Log for mysql5-server is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mysql5-server/mysql5-server/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
</pre>
<p>To fix it, force plist replacement. </p>
<pre>
<code>
# sudo port -f activate mysql5-server
--->  Computing dependencies for mysql5-server
--->  Activating mysql5-server @5.1.57_0
Warning: File /Library/LaunchDaemons/org.macports.mysql5.plist already exists.  Moving to: /Library/LaunchDaemons/org.macports.mysql5.plist.mp_1311315120.
--->  Cleaning mysql5-server
</code>
</pre>
<p>2. Move database into data directory, it required root privileges </p>
<pre>
<code>
# sudo su 
# cp -RPa /opt/local-snowleopard/var/db/mysql5 /opt/local/var/db/
</code>
</pre>
<p>3. Start MySQL Server</p>
<pre>
<code>
# sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start
</code>
</pre>
<p>Please also share how you migrate existing Macports into OS X Lion Macports. </p>The post <a href="https://logs.paulooi.com/os-x-lion-macports-1.php">OS X Lion Macports</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/os-x-lion-macports-1.php/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>How to Change MySQL Data Directory in Linux Centos</title>
		<link>https://logs.paulooi.com/how-to-change-mysql-data-directory-in-linux-centos.php</link>
					<comments>https://logs.paulooi.com/how-to-change-mysql-data-directory-in-linux-centos.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Sat, 02 Jul 2011 06:04:37 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[datadir]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mycnf]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1413</guid>

					<description><![CDATA[<p>By default Linux CentOS or other Linux Distro installation, MySQL data directory is stored in /var/db/mysql, how can I change it to other directory in example /db/mysql? It is always better to have MySQL Data Directory store in a specific...</p>
The post <a href="https://logs.paulooi.com/how-to-change-mysql-data-directory-in-linux-centos.php">How to Change MySQL Data Directory in Linux Centos</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p><strong>By default Linux CentOS or other Linux Distro installation, MySQL data directory is stored in /var/db/mysql, how can I change it to other directory in example /db/mysql? </strong></p>
<p>It is always better to have MySQL Data Directory store in a specific partition/drive. It will help on performance and better management and scalability. You change change the data store directory in Linux by editing /etc/my.cnf file.</p>
<p>Edit /etc/my.cnf file</p>
<pre>
<code>
# vi /etc/my.cnf
</code>
</pre>
<p>Change the data directory structure</p>
<pre>
<code>
datadir=/db/mysql
socket=/db/mysql/mysql.sock
</code>
</pre>
<p>After the file has been updated, restart MySQL service.</p>The post <a href="https://logs.paulooi.com/how-to-change-mysql-data-directory-in-linux-centos.php">How to Change MySQL Data Directory in Linux Centos</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-change-mysql-data-directory-in-linux-centos.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Find Your Closest Anycast DNS Server with Dig</title>
		<link>https://logs.paulooi.com/how-to-find-your-closest-anycast-dns-server-with-dig.php</link>
					<comments>https://logs.paulooi.com/how-to-find-your-closest-anycast-dns-server-with-dig.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Wed, 23 Feb 2011 00:53:02 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[anycast dns]]></category>
		<category><![CDATA[dig]]></category>
		<category><![CDATA[dns query]]></category>
		<category><![CDATA[dns server]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1391</guid>

					<description><![CDATA[<p>Most ISP deploys Anycast DNS server on their network and bring the closest DNS server to their user for DNS resolver. You may see a DNS server with a single IP Address but there are multiple DNS Servers running on...</p>
The post <a href="https://logs.paulooi.com/how-to-find-your-closest-anycast-dns-server-with-dig.php">How to Find Your Closest Anycast DNS Server with Dig</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Most ISP deploys Anycast DNS server on their network and bring the closest DNS server to their user for DNS resolver. You may see a DNS server with a single IP Address but there are multiple DNS Servers running on different geographical location. </p>
<p>So which DNS server do you resolve it from? For example we run a query on DNS F Root Server</p>
<pre>
<code>
$ dig @f.root-servers.net hostname.bind  txt ch +short
"lga1a.f.root-servers.org"
</code>
</pre>
<p>On the result, it shows that I am using lga1a.f.root-servers.org as resolver. Some DNS server does reply &#8220;chaos&#8221; (ch) request but some refuse; for example Google DNS and Open DNS Server. So if your ISP is running Anycast DNS, you can try to lookup where is the DNS server locate. </p>
<p>There is another command perform checking via &#8220;id.server&#8221; query, it only helpful when the DNS has server-id configured. </p>
<pre>
<code>
dig @k.root-servers.net id.server txt ch +short
"k2.tokyo.k.ripe.net"
</code>
</pre>The post <a href="https://logs.paulooi.com/how-to-find-your-closest-anycast-dns-server-with-dig.php">How to Find Your Closest Anycast DNS Server with Dig</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/how-to-find-your-closest-anycast-dns-server-with-dig.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Exim: Restrict Authenticated Outgoing Email with Sender Domain</title>
		<link>https://logs.paulooi.com/exim-restrict-authenticated-outgoing-email-with-sender-domain.php</link>
					<comments>https://logs.paulooi.com/exim-restrict-authenticated-outgoing-email-with-sender-domain.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Thu, 27 Jan 2011 01:13:00 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[outgoing email]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[systems]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1382</guid>

					<description><![CDATA[<p>Most of the outgoing SMTP server allowed the user to set different sender email address once it is authenticated. But we might be in risk for allowing the user to send outgoing bulk/spam email via authenticated SMTP with different sender...</p>
The post <a href="https://logs.paulooi.com/exim-restrict-authenticated-outgoing-email-with-sender-domain.php">Exim: Restrict Authenticated Outgoing Email with Sender Domain</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Most of the outgoing SMTP server allowed the user to set different sender email address once it is authenticated. But we might be in risk for allowing the user to send outgoing bulk/spam email via authenticated SMTP with different sender email address. </p>
<p>In Exim mail MTA, it can restricts at the SMTP authenticated transport.</p>
<pre>
<code>
accept  authenticated = *
          sender_domains = < the_domain_name_1 > : < the_domain_name_2 >  
          control       = submission
          control       = dkim_disable_verify
</code>
</pre>
<p>Usually local_domains is the list of the domain hosted on Exim mail server, it can be configured as below too. </p>
<pre>
<code>
accept  authenticated = *
          sender_domains = +local_domains
          control       = submission
          control       = dkim_disable_verify
</code>
</pre>The post <a href="https://logs.paulooi.com/exim-restrict-authenticated-outgoing-email-with-sender-domain.php">Exim: Restrict Authenticated Outgoing Email with Sender Domain</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/exim-restrict-authenticated-outgoing-email-with-sender-domain.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Detect DDoS Source &#038; Destination IP Address with OURMON</title>
		<link>https://logs.paulooi.com/detect-ddos-source-destination-ip-address-with-ourmon.php</link>
					<comments>https://logs.paulooi.com/detect-ddos-source-destination-ip-address-with-ourmon.php#respond</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Thu, 26 Jun 2008 09:00:32 +0000</pubDate>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Systems]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=265</guid>

					<description><![CDATA[<p>We have OURMON running on one of network segment for quite some time, it is very helpful and resourceful when DDoS attack happened, especially to help our customer to find out which destination is targeted on the attack and from...</p>
The post <a href="https://logs.paulooi.com/detect-ddos-source-destination-ip-address-with-ourmon.php">Detect DDoS Source & Destination IP Address with OURMON</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>We have OURMON running on one of network segment for quite some time, it is very helpful and resourceful when DDoS attack happened, especially to help our customer to find out which destination is targeted on the attack and from which sources. Below is the graph that we previously captured while running OURMON version 2.70. </p>
<p><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/photos/08/june/_ourmon-ddos-01.jpg" width="520" height="226" alt="" title="" /></p>
<p><a href="https://logs.paulooi.com/wp-content/photos/08/june/ourmon-ddos-03.jpg"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/photos/08/june/_ourmon-ddos-03.jpg" width="520" height="225" alt="" title=""  /></a></p>
<p><strong>OURMON Version 2.81</strong></p>
<p>On the recent released of OURMON, the topn graphs didn&#8217;t show the traffic by Mbit/s instead of bit/s. The long no. is confusing when the NOC engineer is doing the monitoring(minimal 7 digits will show up). I have made some changes on omupdate.pl, one of OURMON script that generate html static page, to show extra value &#8211; Mbit/s. Our current OURMON graph looks something like below;</p>
<p><a href="https://logs.paulooi.com/wp-content/photos/08/june/ourmon-281.jpg"><img loading="lazy" decoding="async" src="https://logs.paulooi.com/wp-content/photos/08/june/_ourmon-281.jpg" width="520" height="220" alt="" title=""  /></a></p>
<p>Below will show you how to add extra Mbit/s value on your OURMON Topn section;</p>
<p>edit <em>omupdate.pl</em> file</p>
<p><em>vi /usr/local/mrourmon/bin/omupdate.pl</em></p>
<p>On line 3137, add the code looks like below;</p>
<pre>
<code>
my $uappf = $items[$i+2];       # old hw app flags
my $uappl = $items[$i+3];       # app lower case
my $uapph = $items[$i+4];       # app upper case
my $bps = int(($items[$i+1] * 8)/30);
my $mbps = sprintf("%.2f", ($bps/1024)/1024); # convert bits to mbits
my $uaf = get_appflag($uappf, $uappl, $uapph);
</code>
</pre>
<p>this line of code <em>my $mbps = sprintf(&#8220;%.2f&#8221;, ($bps/1024)/1024);</em> is to declare the new variable <em>$mbps</em> and convert the bit/s value to Mbit/s by dividing 1024*1024.</p>
<p>Next is to display the value on the page, do something on line of code 3146;</p>
<pre>
<code>
"<b>bits/sec:</b> $bps, <b>Mbits/sec:</b> $mbps, "
</code>
</pre>
<p>Done, wait for a few second for the web page to refresh with extra Mbit/s value. Btw, you can remove bit/s if you want to, to save some extra space <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>The post <a href="https://logs.paulooi.com/detect-ddos-source-destination-ip-address-with-ourmon.php">Detect DDoS Source & Destination IP Address with OURMON</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/detect-ddos-source-destination-ip-address-with-ourmon.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
