Facebook Javascript API - Post to wall - FB JS SDK

Unknown Reply 5:32 AM
Working with the Facebook JS SDK I was having problems using the FB.ui to log the user is, and post a message to their wall. Main error was 'Permission denied to access property 'Arbiter'.'. I tried many different things such as developing this on a website that could be accessed from external sources, but the problem wouldn't go away.


So I wrote some code that used FB.login and FB.api, though after login/permission acceptance it would leave the XD Proxy window open on a blank page. Below is my code which will handle the XD Proxy window, login, permission acceptance and post to their wall, even on your local environment without external sources being able to access your site.


First we install the FB API



<script>
 window.fbAsyncInit = function() {
   FB.init({
     appId      : facebookAppId,
     channelUrl : 'http://'+ window.location.host +'/channel.html',
     status     : true,
     cookie     : true,
     xfbml      : true,
     oauth      : true
   });
 };

 (function(d){
    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
  }(document));
</script>


Next we want to setup the function to handle the login/permissions.


function FBShare(title, link, picture, msg, caption) {
   FB.login(function(data) {
     postFBMsg(title, link, picture, msg, caption);
   }, {scope: 'publish_stream'});
 }


Here I call FB.login, setting scope to publish_stream which once the user is logged in will ask for permission to allow my app to publish to their wall.
Once login is complete and they have accepted my permissions, we call postFBMsg.


function postSocialMsg(title, link, picture, msg, caption) {
   var body={
     message: msg,
     picture: picture,
     link: 'http://'+ window.location.host +'/'+ link,
     name: title,
     caption: caption
   }

   FB.api('/me/feed', 'post', body, function(response) {
     if (!response || response.error) {
       // Error
     } else {
       // Successful
     }
   });
 }


Here I set the body var to contain our Facebook Wall Post details, we have the title(Don't Worry Be Happy) which will be linked to link, we have picture(Guy Sebastian pic), msg(Wall Post Message) which will appear under the Username(John Smith), title and caption(Guy Sebastian) which will appear under our Message to the right of the picture. If no Caption is sent it displays the link URL instead.


The final piece to our puzzle is to handle the closing of the XD Proxy window after login. It posts back to the calling window after actions are performed, I setup an event to capture these messages and close the window once it receives one. If you already are using postMessage between windows, you'll need to setup a conditional statement to only close the window if it's a Facebook message.


 $(window).bind('message', function(e) {
   e.originalEvent.source.window.close();
 });


So once we get a message via postMessage we close the window of the message sender.


This is how I'm doing it in my local development environment, inaccessible to the outside world, if you spot and flaws, or know of a better way of doing things please leave a comment.

Source : http://www.sacah.net/2012/02/facebook-javascript-api-post-to-wall-fb.html

InstaFX & OmniGallery 2 Plugin WordPress Buatan @ColorLabs

Unknown Reply 5:31 AM

InstaFX

Plugin InstaFX adalah Plugin yang memungkinkan kita untuk menambahkan efek filter foto yang beragam seperti layaknya sebuah filter di Instagram, Plugin ini akan menambahkan pilihan efek waktu kita upload sebuah foto disebuah post/page.
InstaFX Colorlabs & Company Tampilan efek InstaFX Plugin Untuk lebih jelasnya cara menggunakan Plugin ini silahkan simak Video berikut ini :
Download InstaFX WordPress Plugin

OmniGallery

Plugin ini memungkinkan kita untuk membuat sebuah galeri foto dari sosial media yang Anda punya seperti Pinterest, Instagram, Picasa, Flickr dan Facebook. Cara penggunaannya pun tidak ribet, kita hanya harus menghubungkan akun social media kita.
OmniGallery WordPress Plugin OmniGallery WordPress Plugin Untuk cara Install dan penggunaannya silahkan simak Video berikut :
Download OmniGallery WordPress Plugin

Source : http://belajarwebdesign.com/wordpress/instafx-omnigallery-2-plugin-wordpress-buatan-colorlabs/

Automatic JavaScript, CSS versioning to refresh browser cache

Unknown Reply 5:01 AM
When you update JavaScript or CSS files that are already cached in users’ browsers, most likely many users won’t get that for some time because of the caching at the browser or intermediate proxy(s). You need some way to force browser and proxy(s) to download the latest files. There’s no way to do that effectively across all browsers and proxies from the webserver by manipulating cache headers unless you change the file name or you change the URL of the files by introducing some unique query string so that browsers/proxies interpret them as new files. Most web developers use the query string approach and use a version suffix to send the new file to the browser. For example:
<script src="someJs.js?v=1001" ></script>
<link href="someCss.css?v=2001"></link>
In order to do this, developers have to go to all the html, aspx, ascx, master pages, find all references to static files that are changed, and then increase the version number. If you forget to do this on some page, that page may break because browser uses old cached script. So, it requires a lot of regression test effort to find out whether changing some CSS or JS breaks something anywhere in the entire website.
Another approach is to run some build script that scans all files and updates the reference to the JavaScript and CSS files in each and every page in the website. But this approach does not work on dynamic pages where the JavaScript and CSS references are added at run-time, say using ScriptManager.
If you have no way to know what JavaScript and CSS will get added to the page at run-time, the only option is to analyze the page output at runtime and then change the JavaScript, CSS references on the fly.
Here’s an HttpFilter that can do that for you. This filter intercepts any ASPX hit and then it automatically appends the last modification date time of JavaScript and CSS files inside the emitted HTML. It does so without storing the whole generated HTML in memory nor doing any string operation because that will cause high memory and CPU consumption on webserver under high load. The code works with character buffers and response streams directly so that it’s as fast as possible. I have done enough load test to ensure even if you hit an aspx page million times per hour, it won’t add more than 50ms delay over each page response time.
First, you add set the filter called StaticContentFilter in the Global.asax file’s Application_BeginRequest event handler:
Response.Filter = new Dropthings.Web.Util.StaticContentFilter(
    Response,
    relativePath =>
      {
        if (Context.Cache[physicalPath] == null)
        {
          var physicalPath = Server.MapPath(relativePath);
          var version = "?v=" +
            new System.IO.FileInfo(physicalPath).LastWriteTime
            .ToString("yyyyMMddhhmmss");
          Context.Cache.Add(physicalPath, version, null,
            DateTime.Now.AddMinutes(1), TimeSpan.Zero,
            CacheItemPriority.Normal, null);
          Context.Cache[physicalPath] = version;
          return version;
        }
        else
        {
          return Context.Cache[physicalPath] as string;
        }
      },
    "http://images.mydomain.com/",
    "http://scripts.mydomain.com/",
    "http://styles.mydomain.com/",
    baseUrl,
    applicationPath,
    folderPath);
}
The only tricky part here is the delegate that is fired whenever the filter detects a script or CSS link and it asks you to return the version for the file. Whatever you return gets appended right after the original URL of the script or CSS. So, here the delegate is producing the version as “?v=yyyyMMddhhmmss” using the file’s last modified date time. It’s also caching the version for the file to make sure it does not make a File I/O request on each and every page view in order to get the file’s last modified date time.
For example, the following scripts and CSS in the HTML snippet:
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js" ></script>
<script type="text/javascript" src="scripts/TestScript.js" ></script>
<link href="Styles/Stylesheet.css" rel="stylesheet" type="text/css" />
It will get emitted as:
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js?v=20100319021342" >
</script>
<script type="text/javascript" src="scripts/TestScript.js?v=20110522074353" ></script>
<link href="Styles/Stylesheet.css?v=20110522074829" rel="stylesheet" type="text/css" />
As you see, there’s a query string generated with each of the file’s last modified date time. Good thing is you don’t have to worry about generating a sequential version number after changing a file. It will take the last modified date, which will change only when a file is changed.
The HttpFilter I will show you here can not only append version suffix, it can also prepend anything you want to add on image, CSS and link URLs. You can use this feature to load images from a different domain, or load scripts from a different domain and benefit from the parallel loading feature of browsers and increase the page load performance. For example, the following tags can have any URL prepended to them:
<script src="some.js" ></script>
<link href="some.css" />
<img src="some.png" />
They can be emitted as:
<script src="http://javascripts.mydomain.com/some.js" ></script>
<link href="http://styles.mydomain.com/some.css" />
<img src="http://images.mydomain.com/some.png" />
Loading JavaScripts, CSS and images from different domain can significantly improve your page load time since browsers can load only two files from a domain at a time. If you load JavaScripts, CSS and images from different subdomains and the page itself on www subdomain, you can load 8 files in parallel instead of only 2 files in parallel.
Read here to learn how this works:
Source : http://www.codeproject.com/Articles/203620/Automatic-JavaScript-CSS-versioning-to-refresh-bro

Solution Error While Installing SQL Server 2008

Unknown Reply 4:51 AM

Error while installing SQL 2008 R2

Solution: You can fix this problem by deleting \users\(your profile)\Local Settings\Application Data\Microsoft_Corporation\ folder. If you have older operating system, use “documents and settings” instead of “user”.
Installation Error:
You may receive the following error while installing SQL 2008 R2 edition on your system/server:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings: Could not load file or assembly ‘System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ or one of its dependencies. The system cannot find the file specified. (C:\Users\Administrator\AppData\Local\Microsoft_Corporation\LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx\10.0.0.0\user.config line 5) —> System.IO.FileNotFoundException: Could not load file or assembly ‘System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ or one of its dependencies. The system cannot find the file specified.
File name: ‘System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′
at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
— End of inner exception stack trace —
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
at System.Configuration.SettingsBase.SetPropertyValueByName(String propertyName, Object propertyValue)
at System.Configuration.SettingsBase.set_Item(String propertyName, Object value)
at System.Configuration.ApplicationSettingsBase.set_Item(String propertyName, Object value)
at Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings.set_WindowPlacement(WINDOWPLACEMENT value)
at Microsoft.SqlServer.Configuration.LandingPage.LandingPageForm.OnClosing(CancelEventArgs e)
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
—————————————-
LandingPage
Assembly Version: 10.0.0.0
Win32 Version: 10.50.1600.1 ((KJ_RTM).100402-1540 )
CodeBase: file:///h:/9a123339f116b0007807ea/x86/LandingPage.exe
—————————————-
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
—————————————-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
—————————————-
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
—————————————-
Microsoft.SqlServer.Configuration.Sco
Assembly Version: 10.0.0.0
Win32 Version: 10.50.1600.1 ((KJ_RTM).100402-1540 )
CodeBase: file:///h:/9a123339f116b0007807ea/x86/Microsoft.SqlServer.Configuration.Sco.DLL
—————————————-
Microsoft.SqlServer.Chainer.Infrastructure
Assembly Version: 10.0.0.0
Win32 Version: 10.50.1600.1 ((KJ_RTM).100402-1540 )
CodeBase: file:///h:/9a123339f116b0007807ea/x86/Microsoft.SqlServer.Chainer.Infrastructure.DLL
—————————————-
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
—————————————-
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
—————————————-
Microsoft.SqlServer.Management.Controls
Assembly Version: 10.0.0.0
Win32 Version: 10.50.1600.1 ((KJ_RTM).100402-1540 )
CodeBase: file:///h:/9a123339f116b0007807ea/x86/Microsoft.SqlServer.Management.Controls.DLL
—————————————-
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
—————————————-
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.
For example:
When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

GCD, Prime, Exponentiation, Factoring Javascript

Unknown Reply 9:19 PM

Contents

  1. General
  2. Basic Operations
  3. GCD
  4. Exponentiation - PowMod
  5. Factoring - Pollard p-1
  6. Factoring - Pollard Rho
  7. Multiple Precision

General

JavaScript is an interpreted language which was originally designed by Netscape for use in web documents. JavaScript programs can be run by any modern web browser (and a number of other programs). The JavaScript language is now standardized as ECMAScript.
While JavaScript was never written with number theory (or any other mathematics) in mind, it has the necessary operators and structure for this sort of programming. Modern JavaScript/ECMAScript implementations supports the use of integers up to 53 bits in length, which gives a maximum integer size of slightly larger than 9,000,000,000,000,000. As the algorithms implemented here usually multiply or square before modular reduction, the largest practical modulus is 26 bits, or about 67,000,000. (The JavaScript/ECMAScript Number type is implemented using the double precision type as specified in IEEE-754.)
For each algorithm there is a form where you can type in values and try it out and there is a listing of the program. The copy of the program which is actually executed is in the file NumbThy.js. If you want to modify a program you will need to download both that program file and this page, edit the program file, then load the local copy of this page in your browser.

Basic Operations

The basic arithmetic operations, +, -, /, are available from the keyboard. Note that the division operator normally returns a floating point number (eg 7/2 returns 3.5) so the answer should be truncated with the Math.floor function (eg Math.floor(7/2) returns 3). The modular reduction operator is represented by %.
Examples:
  • (8 + 7) % 13
    (returns an answer of 2)
  • (5 * 4) % 13
    (returns an answer of 7)
  • Math.floor(7 / 2)
    (returns an answer of 3)
The following two subroutines demonstrate both simple programming in JavaScript and how you can use an HTML form to run a JavaScript program.
      function addMod(a,b,n)
      {
      sum = (a + b) % n;
      if (sum < 0) {sum += n;};
      return sum;
      }

      function multMod(a,b,n)
      {
      prod = (a * b) % n;
      if (prod < 0) {prod += n;};
      return prod;
      }
+ (mod ) =
* (mod ) =

GCD

The Euclidean Algorithm to compute an integer gcd can be implemented with the following program:
      function gcd(a,b)
      {
      var temp;
      if(a < 0) {a = -a;};
      if(b < 0) {b = -b;};
      if(b > a) {temp = a; a = b; b = temp;};
      while (true) {
         a %= b;
         if(a == 0) {return b;};
         b %= a;
         if(b == 0) {return a;};
      };
      return b;
      }
gcd(, ) =
The following program implements the extended Euclidean algorithm:
      function xgcd(a,b)
      {
      var quot, a1=1, b1=0, a2=0, b2=1, aneg=1, bneg=1, result=new Array;
      if(a < 0) {a = -a; aneg=-1;};
      if(b < 0) {b = -b; bneg=-1;};
      if(b > a) {temp = a; a = b; b = temp;};
      while (true) {
      	 quot = -Math.floor(a / b);
         a %= b;
         a1 += quot*a2; b1 += quot*b2;
         if(a == 0) {result[0]=b*bneg; result[1]=a2; result[2]=b2; return result;};
         quot = -Math.floor(b / a);
         b %= a;
         a2 += quot*a1; b2 += quot*b1;
        if(b == 0) {result[0]=a*aneg; result[1]=a1; result[2]=b1; return result;};
      };
      return result;
      }
gcd(, ) = (, , )

Exponentiation - PowMod

The following program implements the Russian Peasant algorithm for computing modular exponentiation:
      function powmod(base,exp,modulus)
      {
      var accum=1, i=0, basepow2=base;
      while ((exp>>i)>0) {
      	 if(((exp>>i) & 1) == 1){accum = (accum*basepow2) % modulus;};
      	 basepow2 = (basepow2*basepow2) % modulus;
         i++;
      };
      return accum;
      }
^ (mod ) =

Factoring - Pollard p-1

The following program implements the Pollard's p-1 algorithm for integer factorization:
      function factor_pm1(numb)
      {
      var bound=Math.floor(Math.exp(Math.log(numb)/3)), i=2, thegcd, base=2;
      for (i=2; i<bound; i++) {
      	 base = powmod(base,i,numb);
         if((thegcd=gcd(base-1,numb)) != 1) {return thegcd;};
      };
      return 1;
      }
Factor ... to get a factor of

Factoring - Pollard Rho

The following program implements Pollard's Rho algorithm for integer factorization:
      function factor_rho(numb)
      {
      var numsteps=2*Math.floor(Math.sqrt(Math.sqrt(numb))), slow=2, fast=slow, i;
      for (i=1; i<numsteps; i++){
         slow = (slow*slow + 1) % numb;
         fast = (fast*fast + 1) % numb;
         fast = (fast*fast + 1) % numb;
         if((thegcd=gcd(fast-slow,numb)) != 1) {return thegcd;};
      };
      return 1;
      }
Factor ... to get a factor of

Multiple Precision

JavaScript does not have any built-in multiple precision capabilities but there are several small mp libraries for it.
Source : http://userpages.umbc.edu/~rcampbel/NumbThy/Class/Programming/JavaScript/#Basic

Hosting a Git Repository in Windows

Unknown Reply 6:41 AM
If you’re working in a Windows-only environment and you’d like to host a git repository, this article will walk you through three different approaches: Shared File System Hosting, Git Protocol Hosting, and SSH Hosting.

Setting Up Your Repository

Before choosing which hosting strategy you’d like to use, you’ll first need a git repository to share.  The following steps will walk you through setting up an empty git repository.
Step 1 – Install Git
The most popular way to install git on Windows is by installing msysGit.  The msysGit distribution of git includes a minimalist set of GNU utilities along with the git binaries.  Download the msysGit installer and execute it.  When prompted to select components on the forth dialog, enable the Windows Explorer Integration components: ‘Git Bash Here’ and ‘Git GUI Here’.  When prompted to configure the line-ending conversions, select ‘checkout as-is, commit as-is’ if your team will only ever be working on projects from a Windows machine.
For reference, here are the dialogs presented by the wizard:
msysgit-install-1-3
msysgit-install-4-6
msysgit-install-7-9

Step 2 – Create a Bare Repository
With this step, we’ll be creating an empty repository for a sample project named ‘sample’.  Since we’ll only be using this repository remotely, we’ll be initializing a folder as a ‘bare’ repository, which means that git will place all the files git needs to manage the repository directly within the initialized folder rather than in a ‘.git’ sub-folder.  To create the repository, follow these steps:
  • Using Windows Explorer, create a folder somewhere on the server where you plan to store all of your repositories (e.g. C:\git\).
  • Within the chosen repositories parent folder, create a sub-folder named ‘example.git’.
  • From the folder pane of Windows Explorer, right click on the ‘example’ folder and select ‘Git Bash Here’.  This will open up a bash shell.
  • At the command prompt, issue the following command:
$> git init --bare
Note
The ‘example’ repository can be created using your own credentials, but if you’d like to use the ‘Single User’ strategy presented in the SSH Hosting section, I’d recommend creating a ‘git’ Windows account and creating the repository with that user.

You now have a git repository for the ‘example’ project and are ready to select a strategy for sharing this repository with your team.

Shared File System Hosting

Hosting a git repository via a shared file system is by far the easiest way to get started sharing a git repository.  Simply share the main git folder where you created the ‘example.git’ repository and grant full control of the contents.  Once you’ve set up the desired level of access, users can clone the shared repository using the following command:
$> git clone \\[repository server name]\[share name]\example.git

Git Protocol Hosting

Git supplies its own ‘git’ protocol for simple hosting purposes.  To host an existing repository using the git protocol, you can simply issue the following command from the hosting server:
$> git daemon --base-path=C:/git --export-all
This will host all repositories located in the folder C:/git as read-only.  To allow push access, add –enable=receive-pack:
$> git daemon --base-path=C:/git --export-all --enable=receive-pack
This is fine for situations where you want to temporarily share a repository with a co-worker (e.g. when working on a feature branch together), but if you want to permanently share remote repositories then you’ll need to start the git daemon as a Windows service.
Unfortunately, it doesn’t seem Microsoft makes installing an arbitrary command as a service very easy.  Windows does provide the Service Control utility (e.g. sc.exe), but this only allows you to work with Windows service applications.  To resolve this problem, a simple .Net Windows Service application can be created which performs a Process.Start() on a supplied service argument. 
For the purposes of this guide, I’ve created just such a service which you can obtain from https://github.com/derekgreer/serviceRunner.  Once you have the service compiled, create a batch file named ‘gitd.bat’ with the following contents:
"C:\Program Files (x86)\Git\bin\git.exe" daemon --reuseaddr --base-path=C:\git --export-all --verbose --enable=receive-pack
You can then register the gitd.bat file as a service using the Service Control utility by issuing the following command (from an elevated prompt):
sc.exe create "Git Daemon" binpath= "C:\Utils\ServiceRunner.exe C:\Utils\git-daemon.bat" start= auto
To start the service, issue the following command:
sc.exe start "Git Daemon"
After successfully starting the Git Daemon service, you should be able to issue the following command:
git clone git://localhost/example.git

Registering Git Daemon With Cygwin

As an alternative to using the Service Control utility, you can also install any application as a service using Cygwin’s cygrunsrv command.  If you already have Cygwin installed or you’re planning on using Cygwin to host git via SSH then this is the option I’d recommend.  After installing Cygwin with the cygrunsrv package, follow these steps to register the git daemon command as a service:
Step 1: Open a bash shell
Step 2: In a directory where you want to store your daemon scripts (e.g. /cygdrive/c/Cygwin/usr/bin/), create a file named “gitd” with the following content:
#!/bin/bash

c:/Program \Files/Git/git daemon --reuseaddr                 \
                                 --base-path=/cygdrive/c/git \
                                 --export-all                \
                                 --verbose                   \
                                 --enable=receive-pack
Step 3: Run the following cygrunsrv command to install the script as a service (Note: assumes Cygwin is installed at C:\Cygwin):
cygrunsrv   --install gitd                          \
            --path c:/cygwin/bin/bash.exe           \
            --args c:/cygwin/usr/bin/gitd           \
            --desc "Git Daemon"                     \
            --neverexits                            \
            --shutdown
Step 4: Run the following command to start the service:
cygrunsrv --start gitd

SSH Hosting

Our final approach to be discussed is the hosting of git repositories via SSH.  SSH (which stands for Secure Shell) is a protocol commonly used by Unix-like systems for transporting information securely between networked systems.  To host git repositories via SSH, you’ll need to run an SSH server process on the machine hosting your git repositories.  To start, install Cygwin with the openssh package selected. 
Once you have Cygwin installed, follow these steps:
Step 1 – Open a bash shell
Step 2 – Run the following command to configure ssh:
ssh-host-config -y
For later versions of Windows, this script may require that a privileged user be created in order to run with elevated privileges.  By default, this user will be named cyg_server.  When prompted, enter a password for the cyg_server user which meets the password policies for your server.
Step 3 – Run the following command to start the sshd service:
net start sshd
You should see the following output:
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.
The sshd service should now be up and running on your server.  The next step is to choose a strategy for allowing users to connect via SSH.

User Management Strategy

There are two primary strategies for managing how users connect to the SSH server.  The first is to configure each user individually.  The second is to use a single user for your entire team.  Let’s look at each.

Individual User Management

SSH allows users configured in the /etc/passwd file to connect via SSH.  Cygwin automatically creates this file when it first installs.  To add additional users (e.g. the user ‘bob’), you can append new records to the passwd file by issuing the following command from a bash shell:
mkpasswd -l | grep ‘^bob >> /etc/passwd
This command adds an entry for a user ‘bob’ by doing the following:
  • run the mkpasswd command for all local users
  • select only entries starting with the string ‘bob’
  • append the entry to the /etc/passwd file
To see the new entry, you can ‘cat’ the contents of the file to the screen by issuing the following command:
cat /etc/passwd
This should show entries that look like the following:
SYSTEM:*:18:544:,S-1-5-18::
LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
Administrators:*:544:544:,S-1-5-32-544::
Administrator:unused:500:513:DevMachine\Administrator,S-1-5-21-2747539007-3005349326-118100678-500:/home/Administrator:/bin/bashGuest:unused:501:513:DevMachine\Guest,S-1-5-21-2747539007-3005349326-118100678-501:/home/Guest:/bin/bash
bob:unused:1026:513:git,DevMachine\bob,S-1-5-21-2747539007-3005349326-118100678-1026:/home/git:/bin/bash
By adding the new entry to the /etc/password file, the user ‘bob’ will now have access to access git repositories via SSH.  To clone a repository, Bob would simply need to issue the following command:
git clone ssh://DevMachine/git/example.git
At this point, Bob would have to enter his password as it is set on the server.  I’ll show you how to avoid typing the password a little later.
One downside of this setup, however, is that the user ‘bob’ will also have access to shell into the machine by entering the following command:
ssh DevMachine
If the user bob already has an account on the machine, this probably isn’t an issue.  However, not all users in the /etc/password file are necessarily accounts on the local server.  You can also add network users by issuing the following command:
mkpasswd -d [domain name] -u [user name] >> /etc/passwd
In this case, you may want to restrict what the user ‘bob’ can do to just issuing git commands.  You can do this by changing bob’s default shell entry in the /etc/passwd file from /bin/bash to /usr/bin/git-shell.  The git-shell is a special shell which restricts access to just a few git commands.  Trying to ssh into a server where the shell is set to git-shell will print an error message.

Single User

Another strategy that is a bit easier to manage is to use a single user for all team members.  At first, this might seem like you’re just throwing up your hands and opening up access to everyone, but this isn’t actually the case as we’ll see shortly.
To use this strategy, follow these steps:
Step 1 – Global User Creation
First create a new user to be used for git access.  I’ll call the user ‘git’ for our example. 
Step 2 – Configure SSH Access
Now, configure the ‘git’ user to have access to shell into the server:
mkpasswd -l | grep ‘^git >> /etc/passwd
Step 3 – Change Shell
Optional, but it’s a good idea to set the git user’s shell to the git-shell.
You should now be able to use the git user to access any git repositories on the server.  If you test that out at this point, you’ll be prompted for the ‘git’ user’s password.
What we want to do at this point is configure users to have access to ssh as the ‘git’ account without having to use the password.  To do this, we’ll need to set up an ssh public/private key pair for each user.  Let’s use bob as our example.  I’ll be using Cygwin’s openssh as our example, but the concepts are the same if using Putty as your SSH client.
To setup bob’s ssh keys, he’ll need to run the following command:
ssh-keygen
This will prompt the user bob for the location to store the ssh keys.  Hitting enter will accept the defaults. The command will further prompt him for a passphrase.  A passphrase is recommended because it keeps anyone who has access to bob’s machine from getting his private key and impersonating him, but for now let’s just have him hit enter when prompted.  Entering an empty passphrase will cause ssh to bypass asking for anything.  I’ll talk about ways of using a passphrase without having to enter it every time in a bit.
Here’s the kind of output you’ll see:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bob/.ssh/id_rsa):
Created directory '/home/bob/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/bob/.ssh/id_rsa.
Your public key has been saved in /home/bob/.ssh/id_rsa.pub.
The key fingerprint is:
53:6c:19:ec:c7:96:c5:ee:1d:b0:93:84:b6:8c:a5:2d bob@bobsMachineThe key's randomart image is:
+--[ RSA 2048]----+
|         .. ..   |
|         ..* oo  |
|         .%.o++  |
|         E.+=+.. |
|        S .o ....|
|         .    . .|
|                 |
|                 |
|                 |
+-----------------+
From here, Bob will have a newly created .ssh directory in his home directory:
.ssh $> ls

id_rsa  id_rsa.pub
What we as the admin of the git server need from Bob is the contents of his id_rsa.pub file.  That should look something like the following:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRVsZqNvQNc9YBcLCrm2pZotUiFsyZsQtdhWdtVF3u3PHR1ZNcGvWqSSI+hrb7HP/mTFBzyciO1nWRfbERXjexLd5uBf+ou5ZHDs51JIGQs61Lb+Kq/Q8P2/77bqGIIF5cZPfewZM/wQYHiR/JhIWHCRRmVOwPgPkfI7cqKOpbFRqyRYuV0pglsQEYrjm4FCM2MJ4iWnLKdgqj6vCJbNT6ydx4LqqNH9fCcbOphueoETgiBeUQ9U64OsEhlek9trKAQ0pBSNkJzbslbqzLgcJIitX4OYTxau3l74W/kamWeLe5+6M2CUUO826R9j4XuGQ2qqo5A5GrdVSZffuqRtX1 bob@bobMachine
Next, we want to add this key to a special file named authorized_users in the remote ‘git’ user’s .ssh folder.
[DevMachine]: .ssh > $ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC36qnox4nlTInc1fyOlaUC3hJhEdVM4/qKeEKPBJ520sOzJG+cRvRGNSdbtLNKD9xZs0dpiql9Vtgy9Yc2XI+lWjBGUmPbqWUuP8IZdFGx3QwPSIx9YzakuUBqYE5+9JKcBuHIhIlilqCCzDtXop6Bi1lN0ffV5r6PyqyFIv0L7MJb8jDsHX7GRl4IGu8ScxfY4G0PS3ZrMGfQBr2fm8KFzg7XWVaP/HTT4XKcf5Jp6oHvLz8FvEfdZdajyFUXRzrE0Kt9KAbeIBJV8+usiTAVpsmMY1yfrsuBUdOlhpvL/pU2o5B6K8VlJeXSF4IYEgS+v6JBAlyaWQkXupQr+lIL bob@BobMachine
That’s it.  The user ‘bob’ will now be able to ssh without providing a password.

SSH Without Passphrases

Remember, it’s recommended that everyone use a passphrase.  This prevents someone who’s gained access to your machine from tricking out the remote server to letting them have access as you.  To use a passphrase, repeat the above steps with a a passphrase set.  To keep us from having to always type in the passphrase, we can use ssh-agent (or the Pageant process for Putty users).  The basic premise is that you type your passphrase once per session and the ssh-agent will keep track of the passphrase for you. 
To use the ssh-agent to track your passphrase, add the following to your ~/.bash_profile:
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
        eval `$SSHAGENT $SSHAGENTARGS`
        trap "kill $SSH_AGENT_PID" 0
fi
Close your bash shell and reopen it.  You should see an agent pid output when you open your shell again.
Agent pid 1480
[DevMachine]: >
Now, issue the following command:
ssh-add ~/.ssh/id_rsa
Type your passphrase when prompted.  Thereafter, you will be able to ssh without providing a passphrase.
That concludes the guide.  Enjoy!

Cara Membuat Google Custom Search

Unknown Reply 6:39 AM
Cara Membuat Google Custom Search Engine Sendiri ~ Google memberikan keleluasaan kepada para penggunanya untuk melakukan berbagai modifikasi script dengan manfaat dan sarana yang ada dengan gratis. di antara sarana yang cukup bagus adalah Google custom search engine. sarana ini disiapkan untuk mereka yang membuat mesin pencarian sendiri yang sesuai dengan keinginan penggunanya. kita dapat membuat mesin pencari layaknya Google search untuk meng-index artikel atau info dari website atau blog yang dapat kita tentukan sendiri. untuk para blogger, banyak pula yang memakai Google custom search engine ini menjadi mesin pencari situs (blog) sendiri yang khusus meng-index artikel pada situs (blog) yang dikelolanya. Untuk itu kita akan membahas bagaimana caranya untuk membuat mesin pencarian Google di blog atau website kita sendiri.

langkah untuk membuat search engine sendiri adalah sbb:

1. Membuat Akun Google Custom Search Engine
untuk membuat akun Google search engine anda harus memiliki akun Google atau Gmail, kemudian login ke Google dan silahkan kemari
2. Setelah itu klik buat mesin telusur khusus


Cara Membuat Google Custom Search Engine Sendiri

3. Isi form sesuai data blog anda

Cara Membuat Google Custom Search Engine Sendiri

4. Kemudian lanjut dan dapatkan kode Nomor unik mesin telusur anda

Cara Membuat Google Custom Search Engine Sendiri

5. Buat sebuah halaman yang nantinya digunakan untuk menampilkan hasil penelusuran

Cara Membuat Google Custom Search Engine Sendiri

6. Pilih mode HTML dan pasang kode di bawah ini pada halaman yang Anda buat tadi
<div id="cse" style="width: 100%;">
Sedang mencari...</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">//<![CDATA[
google.load("search", "1", {
 language: "id",
 style : google.loader.themes.V2_DEFAULT
});
google.setOnLoadCallback(function () {
    var c = new google.search.CustomSearchControl("008511831770315150469:p8n2wap_lmu", {});
    c.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var a = new google.search.DrawOptions;
    a.enableSearchResultsOnly();
    c.draw("cse", a);
    for (var a = {}, e = window.location.search.substr(1).split("&"), d = 0; d < e.length; d++) {
        var b = e[d].split("="),
            f = decodeURIComponent(b[0]);
        a[f] = b[1] ? decodeURIComponent(b[1].replace(/\+/g, " ")) : b[1]
    }
    a.q && c.execute(a.q, null, {
        oq: a.oq,
        aq: a.aq,
        aqi: a.aqi,
        aql: a.aql,
        gs_sm: a.gs_sm,
        gs_upl: a.gs_upl
    })
}, !0);
//]]></script>
7. Ganti kode 008511831770315150469:p8n2wap_lmu dengan Nomor unik mesin telusur anda
8. Klik Publikasikan dan catat url halaman tsb (misal: http://www.mainbom.com/p/search.html)
9. Pasang script kotak pencarian berikut ini pada tempat yang anda inginkan untuk menampilkan kotak pencariannya (jika sudah ada, tinggal di edit saja)
<form action="http://www.mainbom.com/p/search.html" id="searchform">
<input id="searchq" name="q" placeholder="Cari..." type="search" />
<input class="searchbutton" name="sa" type="submit" value="Go" />
</form>
Keterangan:
  • Ganti http://www.mainbom.com/p/search.html dengan url halaman yg anda buat tadi
  • Jika sebelumnya blog anda sudah memiliki kotak pencarian, maka kode yg harus diganti adalah name="q" dan type="submit" untuk kode yg lain biarkan saja seperti sebelumnya.
Source : http://www.mainbom.com/2012/08/cara-membuat-google-custom-search.html

Cara Buat Tulisan Di Banyak Foto Sekaligus

Unknown Reply 6:16 AM



Sebelum itu baca juga Download Wallpaper Cool disini.
Langkah-langkahnya :

1. Download software yang dibutuhkan, yaitu Light Image Resizer yang dapat anda download disini Software ini free gan, walaupun ada versi pro.nya yang disuruh membayar, namun tidak usah registrasi pun tidak apa-apa karena fasilitasnya tetap sama..
2. Setelah berhasil didownload dan terinstal di pc anda, lalu buka software light image resizer
3. Pilih icon Folder disana
4. Lalu pilih folder dimana anda meletakkan beberapa gambar yang akan dibuat watermark. Setelah itu seluruh gambar dalam folder tersebut akan muncul di file list. Lalu klik Next.
                                     
5. Lalu pilih tab effect, kemudian centang integrate watermark terus klik watermark, seperti gambar dibawah.


6. Nah setelah itu pilih, ingin memasukan watermark tersebut dalam bentuk gambar atau dalam bentuk tulisan, kalau mau dalam bentuk gambar pilih tab image, jika ingin watermark dalam bentuk tulisan pilih tab text.
7. Masih di menu tersebut, lalu atur Opacity.nya. Opacity ini untuk membuat tulisan tersebut samar-samar. Untuk membuat tulisan samar-samar atur opacity kurang dari 90%.



8. Langkah terakhir, klik OK lalu klik Process dan tunggu hasilnya! gampang sekali..

What Features of Light Image Resizer 
  • Resize Photos, resize pictures and resize images – compress, convert, and create copies of your pictures
  • A fast batch image resizer
  • High quality results with ultra fast multi-core, picture resize technology
  • High quality image resize filters – cubic and lanczos for quality, and linear for speed,
  • Create and e-mail friendly images or use them for web publishing
  • Rename, sort or add a watermark to protect your pictures.
  • Protect all your photos by adding a watermark ( logo or text )
  • Use the profiles library – ipad, iphone, forum, HQ
  • New – create custom pdf pages !
  • Convert Jpeg to pdf

35 Best Websites For Download Free Css Template

Unknown Reply 6:18 PM
Whether you are pro web designer or someone with little HTML and CSS knowledge pre-made CSS Templates can come in really handy. They can save you a lot of coding time. In this post we have collected 35 best websites  where you can download free CSS templates. All you have to is add the content and you’ve got template ready for you website.
Some of the templates also includes FREE PSD, which could be really useful. Hard to believe that these are free.  Most of the CSS Templates/Layouts in these sites are Creative Common Licenses. Do not Forget to add in the comment if you know a free CSS Template Site.

1. Soulcija

 Free CSS Template

2. TemplateFusion

 Free CSS Template

3. Styleshout

 Free CSS Template

4. Templatemo

 Free CSS Template

5. Open Source Template

 Free CSS Template

6. Get CSS Templates

 Free CSS Template

7. Free- CSS- Templates

 Free CSS Template

8. CSSTEMPLATESFORFREE

 Free CSS Template

9. CSSTemps

 Free CSS Template

10. freeCSStemplates

 Free CSS Template

11. My Free CSS Templates

 Free CSS Template

12. Six Shooter Media

 Free CSS Template

13. Mitch Bryson’s Free CSS Template

 Free CSS Template

14. Web Templates

 Free CSS Template

15. ZeroWeb

 Free CSS Template

16. CSSTemplates

 Free CSS Template

17. My Celly

 Free CSS Template

18. FreeCssTemplate

 Free CSS Template

19. CSS Creme CSS Templates

 Free CSS Template

20. Open Web Design

 Free CSS Template

21. Best Free Templates

 Free CSS Template

22. Templateworld

 Free CSS Template

23. RamblingSoul

 Free CSS Template

24. Spyka Webmaster

 Free CSS Template

25. FreeTemplates4u

 Free CSS Template

26. CSS Design Center

 Free CSS Template

27. CssTemplateHeaven

 Free CSS Template

28. FreeCssXhtmlTemplates

 Free CSS Template

29. Inf Design

 Free CSS Template

30. Templates Rain

 Free CSS Template

31. Templateyes

 Free CSS Template

32. ATemplate Free

 Free CSS Template

33. Free CSS Layouts

 Free CSS Template

34. CSS4Free

 Free CSS Template

35. CssTemplatesFree

 Free CSS Template

Search

Ikuti Channel Youtube Aku Yaa.. Jangan Lupa di subscribe. Terima kasih.

Popular Posts

Translate