Tuesday, February 16, 2016

Load Fonts From Cross-Domain

For 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.

If your server use apache

Add this code to your .htaccess of your cdn in top-level (root)
<FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
     <IfModule mod_headers.c>
          Header set Access-Control-Allow-Origin "*"
     </IfModule>
</FilesMatch>

Then enable mod header On your apache:
sudo a2enmod headers
sudo service apache2 restart

Setup Finish

To ensure the header is set properly, you can check using the curl utility:
curl -I http://cdn.dev/fonts/font.eot
If you see Access-Control-Allow-Origin: * in the response, you're exelent!

Good Luck !!!

Thursday, January 28, 2016

Running WhatsApp With PHP

Now you can integrated whatsApp with your website/ script. Here the tutorial:
  • Download Scripts From https://github.com/mgp25/Chat-API
  • Install Requirement 1: https://github.com/allegro/php-protobuf
  • Install Requirement 2: https://github.com/mgp25/curve25519-php
  • Install Requirement 3: sudo apt-get install sqlite php5-sqlite

After you download Requirement 1 and 2, here the installation of both:
cd to each directory, then chmod -R 777 on that directory
phpize
./configure
makesudo make install


Then Add Both Extention to Apache/Cli On PHP

echo -e "; configuration for php curve25519 module\nextension=curve25519.so"| sudo tee -a /etc/php5/apache2/conf.d/curve25519.ini

echo -e "; configuration for php curve25519 module\nextension=curve25519.so"| sudo tee -a /etc/php5/cli/conf.d/curve25519.ini

echo -e "; configuration for php protobuf module\nextension=protobuf.so"| sudo tee -a /etc/php5/apache2/conf.d/protobuf.ini

echo -e "; configuration for php protobuf module\nextension=protobuf.so"| sudo tee -a /etc/php5/cli/conf.d/protobuf.ini

sudo service restart apache2


Now You can run scripts WhatsApp From PHP

To Register New Number, Use: /Chat-API-master/examples/registerTool.php

To Try All Of Feature, Use: /Chat-API-master/examples/WA CLI Client/client.php




Good Luck !!!

Tuesday, September 15, 2015

Install Caps Lock Indicator in Ubuntu 14.04

For 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.

indicator-keylock indicates you lock keys status with applet icons and notification bubbles, see the picture:

Install Indicator-keylock:

sudo add-apt-repository ppa:tsbarnes/indicator-keylock
sudo apt-get update
sudo apt-get install indicator-keylock




Saturday, August 8, 2015

Install Telegram Purple plugin for Pidgin

Telegram Purple is a Pidgin (and other Libpurple-based messengers) plugin which adds support for Telegram. Add Telegram repo to your list:

sudo add-apt-repository ppa:nilarimogard/webupd8

Update package:

sudo apt-get update

Install Telegram pluggin:

sudo apt-get install telegram-purple

Your pidgin should have Telegram Plugin in list.


Using Telegram Purple with Pidgin





Good Luck !!!

Saturday, May 9, 2015

Touchpad Not Working On Ubuntu 12.04

  1. Install dconf-tools :
    sudo apt-get update && sudo apt-get install dconf-tools
    
  2. Open dconf Editor by pressing Alt+F2 and running dconf-editor (Or run it in a terminal.) or search for it in the Unity Dash.
  3. Go to:
    setting → org → gnome-settings-daemon → peripherals → touchpad
  4. Set the key touchpad-enabled to true.


Saturday, January 10, 2015

Using WhatsApp Throught Pidgin (New)

Add WhatsApp repo to your list

deb http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main
deb-src http://ppa.launchpad.net/whatsapp-purple/ppa/ubuntu quantal main


Update package:

sudo apt-get update

Install WhatApp pluggin:

sudo apt-get install pidgin-whatsapp

Your pidgin should have WhatsApp Plugin

Next, We use third party to get WhatApp username and password

# sudo apt-get install python python-dev python-protobuf python-dateutil python-argparse python-setuptools python-pip
# sudo pip install python-axolotl
# sudo pip install --upgrade protobuf

# wget https://github.com/tgalal/yowsup/archive/master.zip
# unzip master.zip
# cd yowsup-master
# sudo chmod +x yowsup-cli


Request code:
'cc' = Your country code without (+),  'phone' = your phone number with country code. 'mcc' and 'mnc' can found at https://en.wikipedia.org/wiki/Mobile_country_code, find your prefered provider

# ./yowsup-cli registration --mcc 510 --mnc 01  --phone 6281555666777 --cc 62 --requestcode sms

status: sent
retry_after: 3605
length: 6
method: sms


After you receive an code on your phone, Then confirm your code. Example the code is 123-456

./yowsup-cli registration --mcc 510 --mnc 01  --phone 6281555666777 --cc 62 --register 123-456

status: ok
kind: free
pw: GXGL6Xyf52JUOEvLEz3LvkOqNog=
price: Rp9500
price_expiration: 1423868871
currency: IDR
cost: 9500.00
expiration: 1452446921
login: 6281567770768
type: new


"login:" is your username. "pw:" is your password.
try to login via pidgin.


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.

Note:
To avoid crashes on the client side, make your status to "away" do not use "available"crashes occur usually on android device.

Here detail provider from Indonesia:

Friday, December 27, 2013

How To Flush (Clear) DNS Cache Under Ubuntu 12.04

To be able to flush (clear) DNS cache under Ubuntu 12.04/11.10, try one or more of these methods:

Method 1

Install first the nscd daemon with this command from the terminal:

sudo apt-get install nscd

Then clear your DNS data with this command: