tag:blogger.com,1999:blog-22105495672961820332024-03-13T20:11:14.942-07:00Catatan ProgrammingBiar gak lupa... Dicatat aja...benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-2210549567296182033.post-11686977345414863172016-02-16T21:30:00.000-08:002016-02-16T21:32:32.004-08:00Load Fonts From Cross-DomainFor maximum performance, we all know we must put our assets on CDN (another domain). Along with those assets are custom web fonts. Unfortunately custom web fonts via CDN (or any cross-domain font request) don't work in Firefox or Internet Explorer (correctly so, by spec) though they do work (incorrectly so) in Webkit-based browsers. They actually require custom CORS configurations to display properly. Here's the code you'll need to make that happen.<br />
<h2>
If your server use apache</h2>
Add this code to your .htaccess of your cdn in top-level (root)<br />
<code style="background-color: white; border: 1px solid; display: block; padding: 5px;"><span style="color: #333333; font-family: "verdana";"><span style="font-size: 14px; line-height: 17px;"><FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"></span><br /><span style="font-size: 14px; line-height: 17px;"> <IfModule mod_headers.c></span><br /><span style="font-size: 14px; line-height: 17px;"> Header set Access-Control-Allow-Origin "*"</span><br /><span style="font-size: 14px; line-height: 17px;"> </IfModule></span><br /><span style="font-size: 14px; line-height: 17px;"></FilesMatch></span></span></code><br />
Then enable mod header On your apache:<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: "verdana";"><span style="font-size: 14px; line-height: 17px;">sudo a2enmod headers</span><br /><span style="font-size: 14px; line-height: 17px;">sudo service apache2 restart</span></span></code><br />
<b>Setup Finish</b><br />
<br />
To ensure the header is set properly, you can check using the curl utility:<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: "verdana";"><span style="font-size: 14px; line-height: 17px;">curl -I http://cdn.dev/fonts/font.eot</span></span></code><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-Leb7dWAHZt0/VsQFA4FTU8I/AAAAAAAAAvU/hzUS5GpucZI/s1600/Selection_047.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="104" src="https://1.bp.blogspot.com/-Leb7dWAHZt0/VsQFA4FTU8I/AAAAAAAAAvU/hzUS5GpucZI/s320/Selection_047.png" width="320" /></a></div>
If you see <span style="background-color: #cccccc;">Access-Control-Allow-Origin: *</span> in the response, you're exelent!<br />
<br />
Good Luck !!!benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com1tag:blogger.com,1999:blog-2210549567296182033.post-92181643335227408252016-01-28T12:38:00.003-08:002016-01-28T12:38:53.607-08:00Running WhatsApp With PHPNow you can integrated whatsApp with your website/ script. Here the tutorial:<br />
<ul>
<li>Download Scripts From https://github.com/mgp25/Chat-API</li>
<li>Install Requirement 1: https://github.com/allegro/php-protobuf</li>
<li>Install Requirement 2: https://github.com/mgp25/curve25519-php</li>
<li>Install Requirement 3: sudo apt-get install sqlite php5-sqlite</li>
</ul>
<br />
After you download Requirement 1 and 2, here the installation of both:<br />
<code style="background-color: white; border: 1px solid; display: block; padding: 5px;"><span style="color: #333333; font-family: verdana;"><span style="font-size: 14px; line-height: 17px;">cd to each directory, then chmod -R 777 on that directory</span><br /><span style="font-size: 14px; line-height: 17px;">phpize</span><br /><span style="font-size: 14px; line-height: 17px;">./configure</span><br /><span style="font-size: 14px; line-height: 17px;">make</span>sudo make install</span></code><br />
<br />
Then Add Both Extention to Apache/Cli On PHP<br />
<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: verdana;"><span style="font-size: 14px; line-height: 17px;">echo -e "; configuration for php curve25519 module\nextension=curve25519.so"| sudo tee -a /etc/php5/apache2/conf.d/curve25519.ini</span></span><br /><br /><span style="color: #333333; font-family: verdana;"><span style="font-size: 14px; line-height: 17px;">echo -e "; configuration for php curve25519 module\nextension=curve25519.so"| sudo tee -a /etc/php5/cli/conf.d/curve25519.ini</span><br /><br /><span style="font-size: 14px; line-height: 17px;">echo -e "; configuration for php protobuf module\nextension=protobuf.so"| sudo tee -a /etc/php5/apache2/conf.d/protobuf.ini</span><br /><br /><span style="font-size: 14px; line-height: 17px;">echo -e "; configuration for php protobuf module\nextension=protobuf.so"| sudo tee -a /etc/php5/cli/conf.d/protobuf.ini<br /><br />sudo service restart apache2</span></span></code><br />
<br />
Now You can run scripts WhatsApp From PHP<br />
<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: verdana;"><span style="font-size: 14px; line-height: 17px;">To Register New Number, Use: /Chat-API-master/examples/registerTool.php</span></span><br /><br /><span style="color: #333333; font-family: verdana; font-size: 14px; line-height: 17px;">To Try All Of Feature, Use: /Chat-API-master/examples/</span><span style="color: #333333; font-family: verdana;"><span style="font-size: 14px; line-height: 17px;">WA CLI Client/</span></span><span style="background-color: transparent; font-size: 14px; line-height: 17px;"><span style="color: #333333; font-family: verdana;">client.php</span></span></code><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-sGrxQjazlow/Vqp8QW9huqI/AAAAAAAAAu4/X6bYid-MEIM/s1600/Selection_037.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="134" src="http://4.bp.blogspot.com/-sGrxQjazlow/Vqp8QW9huqI/AAAAAAAAAu4/X6bYid-MEIM/s320/Selection_037.png" width="320" /></a></div>
<br />
<br />
Good Luck !!!benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com4tag:blogger.com,1999:blog-2210549567296182033.post-60840641883728488972015-09-15T20:13:00.000-07:002015-09-15T20:13:05.135-07:00 Install Caps Lock Indicator in Ubuntu 14.04For a laptop without LED indicators, it’s good to have an indicator
applet on system tray area that displays your lock keys status.
indicator-keylock is the simple tool to do that.<br />
<br />
<b>indicator-keylock</b> indicates you lock keys status with applet icons and notification bubbles, see the picture:<br />
<br />
Install Indicator-keylock:<br />
<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;">sudo add-apt-repository ppa:tsbarnes/indicator-keylock</span></span><br /><span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;">sudo apt-get update</span><br /><span style="font-size: 14px; line-height: 17px;">sudo apt-get install indicator-keylock</span></span></code><br />
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-x96Rsnenf8c/VfjeLPDzfMI/AAAAAAAAApw/RC9irbBrqKI/s1600/indicator-keylock.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="115" src="http://4.bp.blogspot.com/-x96Rsnenf8c/VfjeLPDzfMI/AAAAAAAAApw/RC9irbBrqKI/s320/indicator-keylock.jpg" width="320" /></a></div>
<div>
<br /></div>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com1tag:blogger.com,1999:blog-2210549567296182033.post-57615499861039047882015-08-08T07:04:00.003-07:002015-08-08T09:26:34.967-07:00Install Telegram Purple plugin for PidginTelegram Purple is a Pidgin (and other Libpurple-based messengers) plugin which adds support for Telegram. Add Telegram repo to your list:<br />
<br />
<code style="background-color: white; border: 1px solid; display: block; padding: 5px;"><span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;">sudo add-apt-repository ppa:nilarimogard/webupd8</span></span></code><br />
<br />
Update package:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo apt-get update</code><br />
<br />
Install Telegram pluggin:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo apt-get install telegram-purple</code><br />
<br />
Your pidgin should have Telegram Plugin in list.<br />
<br />
<br />
<span style="font-size: large;">Using Telegram Purple with Pidgin</span><br />
<span style="font-size: large;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-zZ83U19hOkk/VcYtgwnX5cI/AAAAAAAAAoI/XEvttFuOSD8/s1600/pidgin-telegram-add-account.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://3.bp.blogspot.com/-zZ83U19hOkk/VcYtgwnX5cI/AAAAAAAAAoI/XEvttFuOSD8/s320/pidgin-telegram-add-account.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-K48W1kD55RA/VcYthWUt2yI/AAAAAAAAAoM/zRnY_o0ZiJI/s1600/pidgin-telegram-code.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="151" src="http://1.bp.blogspot.com/-K48W1kD55RA/VcYthWUt2yI/AAAAAAAAAoM/zRnY_o0ZiJI/s320/pidgin-telegram-code.png" width="320" /></a></div>
<span style="font-size: large;"><br /></span>
<br />
<br />
Good Luck !!!benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com2tag:blogger.com,1999:blog-2210549567296182033.post-57604256620664678462015-05-09T04:19:00.000-07:002015-08-12T04:25:25.063-07:00Touchpad Not Working On Ubuntu 12.04 <ol style="background-color: white; border: 0px; color: #111111; font-family: Ubuntu, Arial, 'libra sans', sans-serif; font-size: 15px; line-height: 19.5px; margin: 0px 0px 1em 30px; padding: 0px; widows: auto;">
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; margin-bottom: 1em; padding: 0px;">
Install <a href="https://apps.ubuntu.com/cat/applications/dconf-tools" rel="nofollow" style="border: 0px; color: #962d0c; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">dconf-tools </a>:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">sudo apt-get update && sudo apt-get install dconf-tools
</code></pre>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; margin-bottom: 1em; padding: 0px;">
Open dconf Editor by pressing <kbd style="-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; background-color: #f7f7f7; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; color: #333333; display: inline-block; font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 1.4; margin: 0px 0.1em; padding: 0.1em 0.6em; text-shadow: rgb(255, 255, 255) 0px 1px 0px; white-space: nowrap;">Alt</kbd>+<kbd style="-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; background-color: #f7f7f7; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; color: #333333; display: inline-block; font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 1.4; margin: 0px 0.1em; padding: 0.1em 0.6em; text-shadow: rgb(255, 255, 255) 0px 1px 0px; white-space: nowrap;">F2</kbd> and running <code style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;">dconf-editor</code> (Or run it in a terminal.) or search for it in the Unity Dash.</div>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; margin-bottom: 1em; padding: 0px;">
Go to:</div>
<blockquote style="background-color: #f4f4f4; border-bottom-width: 0px; border-left-style: none; border-right-width: 0px; border-top-width: 0px; margin: 0px 0px 10px; padding: 10px; quotes: none;">
<div style="border: 0px; clear: both; padding: 0px;">
setting → org → gnome-settings-daemon → peripherals → touchpad</div>
</blockquote>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; margin-bottom: 1em; padding: 0px;">
Set the key <code style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;">touchpad-enabled</code> to <code style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;">true</code>.</div>
</li>
</ol>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-CBU_8KCXAJk/VcstF17GVGI/AAAAAAAAAo4/lsV718QCIH0/s1600/Selection_032.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-CBU_8KCXAJk/VcstF17GVGI/AAAAAAAAAo4/lsV718QCIH0/s320/Selection_032.jpeg" width="320" /></a></div>
<div>
<br /></div>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com1tag:blogger.com,1999:blog-2210549567296182033.post-40057369252167265562015-01-10T10:21:00.001-08:002015-05-09T04:20:50.536-07:00Using WhatsApp Throught Pidgin (New)Add WhatsApp repo to your list<br />
<br />
<code style="background-color: white; border: 1px solid; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">deb http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main<br />deb-src http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main</code><br />
<br />
Update package:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo apt-get update</code><br />
<br />
Install WhatApp pluggin:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo apt-get install pidgin-whatsapp</code><br />
<br />
Your pidgin should have WhatsApp Plugin<br />
<br />
Next, We use third party to get WhatApp username and password<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;"># sudo apt-get install python python-dev python-protobuf python-dateutil python-argparse python-setuptools python-pip<br /># sudo pip install python-axolotl<br /># sudo pip install --upgrade protobuf<br /><br /># wget https://github.com/tgalal/yowsup/archive/master.zip<br /># unzip master.zip<br /># cd yowsup-master<br /># sudo chmod +x yowsup-cli</code><br />
<br />
Request code:<br />
'cc' = Your country code without (+), 'phone' = your phone number with country code. 'mcc' and 'mnc' can found at <a href="https://en.wikipedia.org/wiki/Mobile_country_code">https://en.wikipedia.org/wiki/Mobile_country_code</a>, find your prefered provider<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;"># ./yowsup-cli registration --mcc 510 --mnc 01 --phone 6281555666777 --cc 62 --requestcode sms<br /><br />status: sent<br />retry_after: 3605<br />length: 6<br />method: sms</code><br />
<br />
After you receive an code on your phone, Then confirm your code. Example the code is 123-456<br />
<br />
<code style="background-color: white; border: 1px dashed; display: block; padding: 5px;"><span style="color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;"># </span><span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;">./yowsup-cli registration --mcc 510 --mnc 01 --phone </span></span><span style="color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;">6281555666777</span><span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;"> --cc 62 --register 123-456</span></span><br /><br />status: ok<br />kind: free<br />pw: GXGL6Xyf52JUOEvLEz3LvkOqNog=<br />price: Rp9500<br />price_expiration: 1423868871<br />currency: IDR<br />cost: 9500.00<br />expiration: 1452446921<br />login: 6281567770768<br />type: new</code><br />
<br />
"login:" is your username. "pw:" is your password.<br />
try to login via pidgin.<br />
<br />
<br />
If you found error message "Server closed the connection" while trying to login, You must update your 'yowsup' to last update package, and then request password again.<br />
<br />
<b><span style="font-size: large;">Note:</span></b><br />
<b><span style="font-size: large;">To avoid crashes on the client side, <u>make your status to "away" do not use "available"</u>. </span></b><span style="font-size: large;"><b>crashes occur usually on android device.</b></span><br />
<span style="font-size: large;"><b><br /></b></span>
Here detail provider from Indonesia:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-dicMurx6zyU/VRB5FAxRloI/AAAAAAAAAj0/Uw_wgQxpqCA/s1600/Selection_001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="http://4.bp.blogspot.com/-dicMurx6zyU/VRB5FAxRloI/AAAAAAAAAj0/Uw_wgQxpqCA/s1600/Selection_001.png" width="640" /></a></div>
<br />benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-43154253123616542022013-12-27T08:57:00.003-08:002013-12-27T08:57:54.522-08:00How To Flush (Clear) DNS Cache Under Ubuntu 12.04<span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">To be able to flush (clear) DNS cache under Ubuntu 12.04/11.10, try one or more of these methods:</span><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Method 1</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Install first the nscd daemon with this command from the terminal:</span><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: #ffd966; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">sudo apt-get install nscd</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Then clear your DNS data with this command:</span><br />
<a name='more'></a><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: #ffd966; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">sudo /etc/init.d/nscd restart</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Method 2</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">You can also try to flush DNS cache with this command:</span><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: #ffd966; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">sudo /etc/init.d/networking restart</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Method 3</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Try also this command:</span><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><b style="background-color: #ffd966; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">sudo /etc/init.d/dns-clean start</b><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><br style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;" /><span style="background-color: white; color: #333333; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 24px;">Good luck!</span>benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-43284787365748272822013-12-17T05:28:00.000-08:002013-12-17T05:28:01.489-08:00Different include and require Statements<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
In PHP, you can insert the content of one PHP file into another PHP file before the server executes it.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
The include and require statements are used to insert useful codes written in other files, in the flow of execution.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<b>Include and require are identical, except upon failure:</b></div>
<ul style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<li>require will produce a fatal error (E_COMPILE_ERROR) and stop the script</li>
<li>include will only produce a warning (E_WARNING) and the script will continue</li>
</ul>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
So, if you want the execution to go on and show users the output, even if the include file is missing, use include. Otherwise, in case of FrameWork, CMS or a complex PHP application coding, always use require to include a key file to the flow of execution. This will help avoid compromising your application's security and integrity, just in-case one key file is accidentally missing.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
Including files saves a lot of work. This means that you can create a standard header, footer, or menu file for all your web pages. Then, when the header needs to be updated, you can only update the header include file.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<br /></div>
<h2 style="background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 22px; font-weight: normal; margin-bottom: 10px; margin-top: 10px;">
Syntax</h2>
<div class="code notranslate" style="background-color: #f6f4f0; border: 1px solid rgb(212, 212, 212); color: #444444; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; margin: 0px; padding: 5px; width: auto;">
<div style="font-family: 'courier new';">
include '<i>filename</i>';<br /><br />or<br /><br />require '<i>filename</i>';</div>
</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<br style="line-height: normal;" /></div>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-13026118758113977192013-11-15T07:37:00.002-08:002015-01-10T09:58:18.688-08:00Using WhatApp Throught Pidgin (Expired)Add WhatApp repo to your list<br />
<br />
<code style="background-color: white; border: 1px solid; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
deb http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main<br />
deb-src http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main
</code><br />
<br />
Update package:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
sudo apt-get update
</code><br />
<br />
Install WhatApp pluggin:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
sudo apt-get install pidgin-whatsapp</code><br />
<br />
Or you can download manually the WhatsApp Plugin here:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
http://web.davidgf.net/nightly/whatsapp-purple/<br />
For 32bit choose 386 folder<br />
For 64bit choose X64 folder
</code><br />
<br />
Copy files with extension .so to folder:<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
~/.purple/plugins/
</code><br />
<br />
Your pidgin should have been WhatsApp<br />
<br />
Next, We use third party to get WhatApp username and password<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
# apt-get install python python-dateutil python-argparse<br />
# wget https://github.com/tgalal/yowsup/archive/master.zip<br />
# unzip master.zip<br />
# cd yowsup-master/src<br />
# cp config.example yowsup-cli.config<br />
</code><br />
<br />
Edit yowsup-cli.config, cc = Your country code without (+), phone = your phone number with country code, id and password leave blank.<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
# vim yowsup-cli.config<br />
cc=62<br />
phone=628578945612<br />
id=<br />
password=<br />
</code><br />
<br />
Change permission<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
# sudo chmod +x yowsup-cli
</code><br />
<br />
Request code<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
# ./yowsup-cli --requestcode sms --config yowsup-cli.config<br />
status: sent<br />
retry_after: 3605<br />
length: 6<br />
method: sms<br />
</code><br />
<br />
Or you can request code via website<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
http://whitesoft.dyndns.org:2222/whatsapp_sms
</code><br />
<br />
After you receive an code, Then confirm your code. 123-456 is an code<br />
<br />
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
# ./yowsup-cli --register 123-456 --config yowsup-cli.config<br />
status: ok<br />
kind: free<br />
pw: S1nBGCvZhb6TBQrbm2sQCfSLkXM=<br />
price: 0,89<br />
price_expiration: 1362803446<br />
currency: EUR<br />
cost: 0.89<br />
expiration: 1391344106<br />
login: 628578945612<br />
type: new<br />
</code><br />
<br />
"login:" is your username. "pw:" is your password.<br />
try to login via pidgin.
<br />
<br />
<b><span style="font-size: large;">Note:</span></b><br />
<b><span style="font-size: large;">To avoid crashes on the client side, <u>make your status to "away" do not use "available"</u>. </span></b><span style="font-size: large;"><b>crashes occur usually on android device.</b></span>benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-70772639982755873762013-11-15T06:55:00.002-08:002013-11-15T06:55:30.417-08:00Adding extra Repositories on Ubuntu<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo vim /etc/apt/sources.list</code><br />
<span style="background-color: white; color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;">add your repo to new line</span><br />
<span style="background-color: white; color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;"><br /></span>
<span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;">Example of repo:</span></span><br />
<span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;"><br /></span></span>
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">
deb http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main <br />
deb-src http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main
</code><br />
<span style="color: #333333; font-family: Verdana;"><span style="font-size: 14px; line-height: 17px;"><br /></span></span>
<span style="background-color: white; color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;">Once you are done adding the repositories, you’ll need to run this command:</span><br />
<span style="background-color: white; color: #333333; font-family: Verdana; font-size: 14px; line-height: 17px;"><br /></span>
<code style="background-color: white; border: 1px dashed; color: #333333; display: block; font-family: Verdana; font-size: 14px; line-height: 17px; padding: 5px;">sudo apt-get update</code>benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-90896755293126137662013-11-14T09:23:00.002-08:002013-11-14T09:23:29.082-08:00Running DBus in Crontab<span style="font-family: Arial, Helvetica, sans-serif;">Just create an sh file to execute your script. example </span><i><span style="font-family: Courier New, Courier, monospace;">chat.sh</span></i><span style="font-family: Arial, Helvetica, sans-serif;">. See below:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">
#!/bin/bash<br />
xhost +<br />
export DBUS_SESSION_BUS_ADDRESS=$(cat /home/iben/.dbus/session-bus/f49d2a1187871a80e2a3bb640000000a-0|grep unix|cut -d= -f2-4)<br /><br />
ps -ef | grep -v grep | grep chat.php<br />
# if not found - equals to 1, start it<br />
if [ $? -eq 1 ]<br />
then<br />
/usr/bin/php /home/iben/www/tes/dbus/chat.php&<br />
else<br />
echo "eq 0 - chat.php found - do nothing"<br />
fi<br />
</code>Note:<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><i>xhost + </i>is required</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br />export DBUS_SESSION_BUS_ADDRESS=$(cat /home/iben/.dbus/session-bus/f49d2a1187871a80e2a3bb640000000a-0|grep unix|cut -d= -f2-4) <b>==></b> is required to inform cron of session location.</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">f49d2a1187871a80e2a3bb640000000a-0 <b>==></b> is a long name that is different with your. Usually have pattern like *a-0, a file in directory /home/username/dbus/sessiom-bus/*a-0. Find your.</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">Sintax after it is your own script. Here I use script to check existing process. if not exist then run the php script. Else don't do anything.</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><b>chat.php</b> is a script that use DBus class.</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">Simply add to cron like this:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">* * * * * sh /home/iben/www/tes/dbus/chat.sh > /home/iben/www/tes/dbus/chat.log</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">It will check process every minute. It better than use 'php flock'.</span>benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-73491715545992703512013-11-13T07:51:00.002-08:002013-11-13T07:51:17.173-08:00How To :: Install PECL on Ubuntu<h3 class="post-title entry-title" itemprop="name" style="color: white; font-family: Arial; margin: 20px 0px 0px; position: relative;">
Hw To :: Install PECL on Ubuntu</h3>
<div class="post-header" style="line-height: 1.6; margin: 0px 0px 1em;">
<div class="post-header-line-1">
</div>
</div>
<div class="post-body entry-content" id="post-body-7289664117601769538" itemprop="description articleBody" style="line-height: 1.4; position: relative; width: 650px;">
<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 13px; font-style: italic; margin: 15px; padding: 5px;">sudo apt-get php-pear php5-dev <br />sudo pear install PEAR</code></div>
<div class="post-footer" style="line-height: 1.6; margin: 0.5em 0px;">
</div>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-85644308969354450662013-11-13T07:50:00.000-08:002014-05-12T12:55:45.593-07:00How To :: Install DBus for PHP on Ubuntu<div class="post-body entry-content" id="post-body-5361212233263664261" itemprop="description articleBody" style="line-height: 1.4; position: relative; width: 650px;">
First you need to install <i>pkg-config</i> package.<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">sudo apt-get install pkg-config</code>Now you need to install DBus package. This will manage all background actions needed by the PHP extension.<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">sudo apt-get install dbus libdbus-1-dev libxml2-dev</code>Now we can install the PECL DBus extension<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">sudo pecl install DBus</code>* if you do not have PECL installed <a href="http://www.dekiben.com/2013/11/how-to-install-pecl-on-ubuntu.html">click here</a> <b>* if you get an error like <i>"Failed to download pecl/Dbus within preferred state stable, latest release is version 0.1.1, stability 'beta', use ..... install failed"</i></b> you need to install the version it says it's the last. For example :<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">sudo pecl install DBus-0.1.1</code>add the extension to PHP<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">echo -e "; configuration for php DBus module\nextension=dbus.so"| sudo tee -a /etc/php5/conf.d/dbus.ini</code></div>
Note:<br />
If you update your PHP VERSION or find error like this :<br />
<i>PHP Warning: PHP Startup: dbus: Unable to initialize module</i><br />
<i>Module compiled with module API=20090626</i><br />
<i>PHP compiled with module API=20100525</i><br />
<i><br /></i>
Or you find error like this :<br />
<i>Can not load dinamic library... blablablabla</i><br />
<i><br /></i>
You can resolve with this:<br />
<code style="background-color: #666666; border: 1px dashed rgb(255, 255, 255); color: white; display: block; font-family: Arial; font-size: 12px; font-style: italic; margin: 15px; padding: 5px; width: 90%;">sudo pecl install -f DBus</code>
<br />
<div class="post-footer" style="line-height: 1.6; margin: 0.5em 0px;">
</div>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-24413249329857102442013-10-25T20:38:00.001-07:002013-10-25T20:38:12.477-07:00Make VIM as default editor in terminal<ul>
<li><span style="font-family: Courier New, Courier, monospace;">cd</span> (cd to your home directory)</li>
<li><span style="font-family: Courier New, Courier, monospace;">vim .bashrc</span> (Edit bashrc file)</li>
<li>add this <span style="font-family: Courier New, Courier, monospace;">export EDITOR=vim</span> to bottom of lines</li>
<li>This will affected to new terminal</li>
</ul>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-75337049015690012802013-09-02T00:50:00.001-07:002013-09-02T00:50:25.216-07:00Backup and Restore Tomboy Notes<b>Backup</b><br />
Copy tomboy file at here: <span style="background-color: #ebece4; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; font-size: 13px; line-height: 15px;">/.local/share/tomboy</span> to your backup directory<br />
<br />
<b>Restore</b><br />
Just Copy the backup file to directory : <span style="background-color: #ebece4; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; font-size: 13px; line-height: 15px;">/.local/share/tomboy</span> . Then chmod your file into 775.benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-11859602036377377282013-07-26T03:02:00.004-07:002013-09-21T02:29:26.861-07:00Import and Export Database via terminal<b>IMPORT</b><br />
<br />
<ul>
<li><i>mysql -u root -pasdf dbname < db.sql</i> (import .sql ke database bisa berupa per-table atau)</li>
<li><i>gunzip < db.sql.gz | mysql -u root -pasdf dbname</i> (import .gz file ke database. ukuran lebih kecil)</li>
</ul>
<br />
<b>EXPORT</b><br />
<br />
<ul>
<li><i>mysqldump -u root -pasdf --extended-insert --add-drop-table dbname > dbname.sql </i>(export ke .sql)</li>
<li><i>mysqldump -u root -pasdf --extended-insert --add-drop-table dbname | gzip > dbname.sql.gz </i>(export ke .gz)</li>
<li><i>mysqldump -u root -pasdf --extended-insert --add-drop-table dbname tablename | gzip > tablename.sql.gz </i>(export tabel ke .gz)</li>
</ul>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-64998209466506353222013-07-26T02:44:00.000-07:002013-07-26T02:44:29.492-07:00Install Nginx ubuntuNginx sebagai pengganti Apache2 dengan keamanan lebih tinggi.<br />
<ul>
<li>sudo apt-get install python-software-properties</li>
<li>sudo add-apt-repository ppa:nginx/stable</li>
<li>sudo apt-get update</li>
<li>sudo apt-get install nginx</li>
</ul>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-16799649585228965412013-07-26T02:27:00.001-07:002015-03-22T20:54:47.287-07:00Install PHP 5.4 dan Plugin untuk NGinxAgar NGinx bisa berjalan dengan normal pada symfony maka harus diinstall php5 beserta pluginnya:<br />
<br />
<ul>
<li>sudo add-apt-repository ppa:ondrej/php5-oldstable</li>
<li>sudo apt-get update</li>
<li>sudo apt-cache showpkg php5</li>
<li>sudo apt-get install php5 php5-common php5-cgi php5-cli php5-curl php-pear php5-fpm php5-gd php5-mysql php-apc php5-</li>
</ul>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-38857248496479946112013-07-24T21:28:00.003-07:002013-07-24T21:28:31.724-07:00Sublime Text 2 Installation Guide: <h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative; text-rendering: optimizelegibility;">
1. Install Sublime Text 2</h2>
<div style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 15px; margin-top: 15px;">
Open terminal</div>
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;">sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
</pre>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative; text-rendering: optimizelegibility;">
<a class="anchor" href="https://gist.github.com/meSingh/5524758#2-install-sublime-package-control" name="2-install-sublime-package-control" style="bottom: 0px; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; position: absolute; text-decoration: none; top: 0px;"><span class="mini-icon mini-icon-link"></span></a><a name='more'></a>2. Install Sublime Package Control</h2>
<ul style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li>Open Sublime Text Console</li>
<li>ctrl + `</li>
<li>paste the following</li>
</ul>
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;">import urllib2,os; 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())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'</pre>
<ul style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li>restart sublime</li>
</ul>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative; text-rendering: optimizelegibility;">
<a class="anchor" href="https://gist.github.com/meSingh/5524758#3-install-packages" name="3-install-packages" style="bottom: 0px; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; position: absolute; text-decoration: none; top: 0px;"><span class="mini-icon mini-icon-link"></span></a>3. Install Packages</h2>
<div style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 15px; margin-top: 15px;">
Preferences -> Package Control -> Install Package</div>
<ul style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li>Alignment</li>
<li>SFTP</li>
<li>Terminal (set to pantheon-terminal for Elementary OS )</li>
<li>Git (Sublime-text-2-git)</li>
<li>SideBarEnchancements</li>
<li>BracketHighlighter</li>
<li>Sublime Linter</li>
</ul>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-89325594259571304292013-07-24T21:26:00.003-07:002013-07-24T21:26:57.042-07:00[Resolve] Partition Not Detected While Ubuntu InstallationThis is a simple method to solve your problem about your problem (Partition Not Detected While Ubuntu Installation):<br />
<br />
<ol>
<li>Run ubuntu with live usb</li>
<li>Open terminal</li>
<li>Be sure your PC is connected to internet.</li>
<li>Install gdisk: <i>sudo apt-get install gdisk</i></li>
<li>After it installed use this command : <i>fixparts /dev/sda </i>(replace sda with ur harddrive letter)</li>
<li>Then press "<i>p"</i> (to print the partition)</li>
<li>Then press "<i>s</i>" ( to sort the partition table)</li>
<li>Then press "<i>p</i>" again (to make sure nothing bad happended)</li>
<li>Then press "<i>w</i>" (to write changes)</li>
<li>Then press "<i>y</i>" (to accept. Don't worry this is just change partition table, your data is not affected)</li>
<li>Then reboot your PC</li>
<li>Finish. Try again to install your ubuntu.</li>
</ol>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-76035069406758838192013-07-09T06:24:00.005-07:002013-07-09T06:24:37.269-07:0012.04 google-chrome-stable error updateError say "The action would require the installation of packages from not authenticated sources.".<br />
<br />
Try run this:<br />wget -q -O - <a href="https://dl-ssl.google.com/linux/linux_signing_key.pub" style="color: #3465a4;">https://dl-ssl.google.com/linux/linux_signing_key.pub</a> | sudo apt-key add -<br /><br />sudo apt-get updatebenhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-16048389870434870182013-06-19T22:54:00.000-07:002013-07-09T06:33:51.863-07:00Make "facebook Like Box" Widget<br />
<ol>
<li>Open : <a href="http://developers.facebook.com/docs/reference/plugins/like-box/">http://developers.facebook.com/docs/reference/plugins/like-box/</a></li>
<li>Setting your preference</li>
<li>Get Code</li>
<li>Click IFRAME And then copy</li>
<li>Paste to your blog or website</li>
</ol>
<br />
<br />benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-41404497596342568132013-06-13T22:50:00.000-07:002013-06-13T22:50:05.320-07:00Find duplicate entries in a tableTry this:<br />
<code class="sql" style="background-color: #e5e5e5; border-bottom-width: 0px; border-top-width: 0px; display: block; margin-bottom: 0px; margin-top: 0px; max-height: 10em; overflow: auto; padding: 1em;"><span class="syntax" style="font-family: Verdan, Arial, Tahoma; font-size: 14px;"><a href="http://pma.dev/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fselect.html&token=cfa5e6d0c71714117b82543a42fad33b" style="border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; outline: none; text-decoration: none;" target="mysql_doc"><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">SELECT</span></a><span style="color: #444444;"> </span><span class="syntax_punct" style="color: magenta;">*</span><span style="color: #444444;"> <span class="syntax_white syntax_white_newline"></span></span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">FROM</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_identifier" style="color: black;">table_name</span><span style="color: #444444;"><span class="syntax_white syntax_white_newline"></span></span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">GROUP</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">BY</span><span style="color: #444444;"> target_field</span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">HAVING</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_functionName" style="color: red; text-transform: uppercase;">COUNT</span><span class="syntax_punct syntax_punct_bracket_open_round" style="color: magenta;">(</span><span style="color: #444444;"> </span><span style="color: #444444;">target_field</span><span style="color: #444444;"> </span><span class="syntax_punct syntax_punct_bracket_close_round" style="color: magenta;">)</span><span style="color: #444444;"> </span><span class="syntax_punct" style="color: magenta;">></span><span class="syntax_digit syntax_digit_integer" style="color: teal;">1</span></span></code>benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-52306815494748292392013-03-02T07:18:00.001-08:002013-03-02T07:18:10.506-08:00Repair ubuntu grub loader with live usb/cd<pre style="background-color: #f3f3f3; border: 1px dashed rgb(193, 180, 150); color: #333333; font-family: UbuntuMono, courier, monospace; font-size: 13px; line-height: 16px; margin-bottom: 8px; padding: 4pt; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;"><ol>
<li>sudo fdisk -l
NB: Looking for linux partition
</li>
<li>sudo mount /dev/sdXY /mnt
NB: Write the disk of linux. example: sudo mount /dev/sda8 /mnt
</li>
<li>sudo grub-install --root-directory=/mnt/ /dev/sdX
Example: sudo grub-install --root-directory=/mnt/ /dev/sda
</li>
<li>Reboot Your PC
</li>
<li>Boom !!!</li>
</ol>
</pre>
benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0tag:blogger.com,1999:blog-2210549567296182033.post-12912316381351451822013-02-21T08:07:00.000-08:002013-02-21T08:52:07.122-08:00Shutter: A snipping tool for Ubuntu<br />
<div style="background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;">
The standard PrintScreen key get the image of the entire Desktop. If you want just the active window, on Ubuntu, you can use Alt + PrintScreen. However, sometimes you may need only to snip only a specific part of the active window. The intuitive option is to take a PrintScreen and cut it on a image tool such GIMP. By the way, if you need to do it many times you can think on better alternatives, such as <a href="http://shutter-project.org/" style="color: #008dcf; text-decoration: initial;">Shutter</a>, a useful tool that can be configure to replace the standard PrintScreen key and handle this issue. You can install using apt-get:</div>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(230, 230, 230); color: #555555; font-size: 12px; line-height: 20px; margin-bottom: 15px; overflow: auto; padding: 10px 20px 0px 15px; width: 593px;">sudo apt-get install shutter
</pre>
<div style="background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;">
The installation does NOT configure it as the default PrintScreen mechanism. To do it, open Shutter tool, click on Edit > Preferences, go to [Behavior] tab and mark [Capture] and [Capture with selection] options. After it, you may need to restart the GDM.</div>
<div style="background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;">
</div>
<div style="padding: 0px 0px 15px;">
Check out some previews offered on <a href="http://shutter-project.org/" style="color: #008dcf; text-decoration: initial;">Shutter Blog</a>:</div>
<div style="padding: 0px 0px 15px;">
<a href="http://shutter-project.org/wp-content/uploads/key_feature_041.png" style="color: #008dcf; text-decoration: initial;"><img alt="" class="alignnone" height="150" src="http://shutter-project.org/wp-content/uploads/key_feature_041-150x150.png" style="border: none; display: inline; margin: 0px 0px 10px; max-width: 100%; padding: 0px;" title="Shutter rectangle" width="150" /></a> <a href="http://shutter-project.org/wp-content/uploads/key_feature_032.png" style="color: #008dcf; text-decoration: initial;"><img alt="" class="alignnone" height="150" src="http://shutter-project.org/wp-content/uploads/key_feature_032-150x150.png" style="border: none; display: inline; margin: 0px 0px 10px; max-width: 100%; padding: 0px;" title="Edit image" width="150" /></a> <a href="http://shutter-project.org/wp-content/uploads/key_feature_037.png" style="color: #008dcf; text-decoration: initial;"><img alt="" class="alignnone" height="150" src="http://shutter-project.org/wp-content/uploads/key_feature_037-150x150.png" style="border: none; display: inline; margin: 0px 0px 10px; max-width: 100%; padding: 0px;" title="Web snip" width="150" /></a></div>
<div style="padding: 0px 0px 15px;">
See ya</div>
<br />benhttp://www.blogger.com/profile/09617760552739736781noreply@blogger.com0