I'm st grub command line...
grub> _
type the following:
ls
your will get a list of drives / partitions
(hd0) (hd0,gpt8) (hd0,gpt7) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)
you need to probe each one to find which os is on each
e.g.
grub> ls (hd0,7)
(hd0,7):Filesystem is ext2.
grub> _
and you can also check that vmlinuz is present by typing
ls (hd0,7)/
this will give you list of files
now we set the root for boot
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
boot
then when ubuntu starts run the boot repair program
Retire early - let the internet work for you - create automated sales systems and more.
Friday, 24 July 2015
Friday, 3 July 2015
laravel - introducing a favicon (favicon.ico) to the app website [answered]
Here's a quick and easy on how to add favicon.ico to a page using laravel.
1. Put your favicon.ico somewhere tidy
e.g. public/assets/img/
if your laravel app site is
/var/www/mywebsite/
put the favicon favincon.ico in the
/var/www/mywebsite/public/assets/img/
2. add the link code to your web page
Assuming you want the icon on every page
Link Code:
<link rel="shortcut icon" href="{{ asset('assets/img/favicon.ico') }}">
link code goes in the head section
edit resources/views/layout.blade.php
to access the head section
here's an example
<!doctype html>
<html lang="en">
@section('html-head')
<head>
<meta charset="UTF-8">
<title>{{ $pageName or 'MyWebsite' }}</title>
<link rel="shortcut icon" href="{{ asset('assets/img/favicon.ico') }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
@section('html-head-includes')
@if (App::environment() == 'local')
{!! HTML::style('/assets/lib/bootstrap/dist/css/bootstrap.css') !!}
{!! HTML::style('/assets/css/bootstrap-theme.css') !!}
@else
{!! HTML::style('/assets/lib/bootstrap/dist/css/bootstrap.min.css') !!}
{!! HTML::style('/assets/css/bootstrap-theme.css') !!}
@endif
{!! HTML::style('/assets/lib/font-awesome/css/font-awesome.min.css') !!}
{!! HTML::style('/assets/css/cityadmin.css') !!}
@show
</head>
@show
@section('html-body')
<body>
@yield("content")
</body>
@show
</html>
3. Test your websiteI find a new incognito window useful for testing new icon changes as nothing is previously cached.
Hope that you find this useful.
HOSTING A COMPLETE VIRTUAL SERVER FOR $5 A MONTH
Here's $10 credit to start your development server.
Claim 2 months free (value $10) now with virtual server host, digital ocean
If you found this post useful, consider supporting my music.
https://app.projektordigital.com/player/index.php?playlist=39&uid=7
1. Put your favicon.ico somewhere tidy
e.g. public/assets/img/
if your laravel app site is
/var/www/mywebsite/
put the favicon favincon.ico in the
/var/www/mywebsite/public/assets/img/
2. add the link code to your web page
Assuming you want the icon on every page
Link Code:
<link rel="shortcut icon" href="{{ asset('assets/img/favicon.ico') }}">
link code goes in the head section
edit resources/views/layout.blade.php
to access the head section
here's an example
<!doctype html>
<html lang="en">
@section('html-head')
<head>
<meta charset="UTF-8">
<title>{{ $pageName or 'MyWebsite' }}</title>
<link rel="shortcut icon" href="{{ asset('assets/img/favicon.ico') }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
@section('html-head-includes')
@if (App::environment() == 'local')
{!! HTML::style('/assets/lib/bootstrap/dist/css/bootstrap.css') !!}
{!! HTML::style('/assets/css/bootstrap-theme.css') !!}
@else
{!! HTML::style('/assets/lib/bootstrap/dist/css/bootstrap.min.css') !!}
{!! HTML::style('/assets/css/bootstrap-theme.css') !!}
@endif
{!! HTML::style('/assets/lib/font-awesome/css/font-awesome.min.css') !!}
{!! HTML::style('/assets/css/cityadmin.css') !!}
@show
</head>
@show
@section('html-body')
<body>
@yield("content")
</body>
@show
</html>
3. Test your websiteI find a new incognito window useful for testing new icon changes as nothing is previously cached.
Hope that you find this useful.
HOSTING A COMPLETE VIRTUAL SERVER FOR $5 A MONTH
Here's $10 credit to start your development server.
Claim 2 months free (value $10) now with virtual server host, digital ocean
If you found this post useful, consider supporting my music.
https://app.projektordigital.com/player/index.php?playlist=39&uid=7
Monday, 23 February 2015
Windows Vista - how to reduce size of Datastore.edb
ANSWER: defrag the database using esentutl.exe
Here's what I did
C:\Windows\system32>esentutl /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Extensible Storage Engine Utilities for Microsoft(R) Windows(R)
Version 6.0
Copyright (C) Microsoft Corporation. All Rights Reserved.
Initiating DEFRAGMENTATION mode...
Database: C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Temp. Database: TEMPDFRG4872.EDB
Defragmentation Status (% complete)
0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................
Moving 'TEMPDFRG4872.EDB' to 'C:\Windows\SoftwareDistribution\DataStore\DataStore.edb'..
Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.
Operation completed successfully in 27.875 seconds.
Now i have an extra 400MB free - makes the difference on vista!
Here's what I did
C:\Windows\system32>esentutl /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Extensible Storage Engine Utilities for Microsoft(R) Windows(R)
Version 6.0
Copyright (C) Microsoft Corporation. All Rights Reserved.
Initiating DEFRAGMENTATION mode...
Database: C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Temp. Database: TEMPDFRG4872.EDB
Defragmentation Status (% complete)
0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................
Moving 'TEMPDFRG4872.EDB' to 'C:\Windows\SoftwareDistribution\DataStore\DataStore.edb'..
Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.
Operation completed successfully in 27.875 seconds.
Now i have an extra 400MB free - makes the difference on vista!
Thursday, 15 January 2015
sugar crm rest api example
REST api Example
source: http://urdhva-tech.blogspot.co.uk/2013/02/rest-api-example.html
Create a new record in Lead module
As we have session id, we are logged-in!, we will use that session id to create a new record.
Here we used set_entry method for that we need three parameters
1) session : pass current session id
2) module : module name to create a record
3) name_value_list : name value list combination
Let's see that in below code snippets
Read detail of top 5 leads having work phone, as an example.
Update a lead status "New" to "Assigned" for lead which we have just created. We can use set_entry method with specified record id to update a value.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId), //Record id to update
array('name' => 'status', 'value' => 'Assigned'),
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Updated, Updated id ".$recordId;
Delete a record via web-service. It is as simple as we update record with id. Here we need to provide id and deleted equal 1.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId),
array('name' => 'deleted', 'value' => '1') //Deleted flag
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Deleted!, Deleted record id is ".$recordId;
At times developers find it so difficult to find simple and running example of REST API to perform CRUD operations on SugarCRM.. There are plenty of tutorials, blogs, developer guides explaining same thing. Still for an ease for ourselves and to the hunters of same, writing the same thing all over again.
REST Example
This blog post explains how to login to SugarCRM instance with admin user.
<?php
// specify the REST web service to interact with
$url = '<SITE_URL_OF_SUGAR>/service/v2/rest.php';
// Open a curl session for making the call
$curl = curl_init($url);
// Tell curl to use HTTP POST
curl_setopt($curl, CURLOPT_POST, true);
// Tell curl not to return headers, but do return the response
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST arguments to pass to the Sugar server
$parameters = array(
'user_auth' => array(
'user_name' => 'admin',
'password' => md5('<ADMIN_PASSWORD>'),
),
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'login',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
die("Error handling result.\n");
}
if ( !isset($result->id) ) {
die("Error: {$result->name} - {$result->description}\n.");
}
// Echo out the session id
echo $result->id."<br />";
$session = $result->id;
$session = $result->id;
Create a new record in Lead module
As we have session id, we are logged-in!, we will use that session id to create a new record.
Here we used set_entry method for that we need three parameters
1) session : pass current session id
2) module : module name to create a record
3) name_value_list : name value list combination
Let's see that in below code snippets
$parameters = array(
'session' => $session, //Session ID
'module' => 'Leads', //Module name
'name_value_list' => array (
array('name' => 'first_name', 'value' => 'David'),
array('name' => 'last_name', 'value' => 'Boris'),
array('name' => 'status', 'value' => 'New'),
array('name' => 'lead_source', 'value' => 'Web Site')
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "New Record Created with ID ".$recordId;
'session' => $session, //Session ID
'module' => 'Leads', //Module name
'name_value_list' => array (
array('name' => 'first_name', 'value' => 'David'),
array('name' => 'last_name', 'value' => 'Boris'),
array('name' => 'status', 'value' => 'New'),
array('name' => 'lead_source', 'value' => 'Web Site')
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "New Record Created with ID ".$recordId;
Read detail of top 5 leads having work phone, as an example.
// Let us fetch detail of a Lead
$fields_array = array('first_name','last_name','phone_work');
$parameters = array(
'session' => $session, //Session ID
'module_name' => 'Leads', //Module name
'query' => " leads.phone_work IS NOT NULL ", //Where condition without "where" keyword
'order_by' => " leads.last_name ", //$order_by
'offset' => 0, //offset
'select_fields' => $fields_array, //select_fields
'link_name_to_fields_array' => array(array()),//optional
'max_results' => 5, //max results
'deleted' => 'false', //deleted
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'get_entry_list',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
print "<pre>";
print_r($result);
die;
$fields_array = array('first_name','last_name','phone_work');
$parameters = array(
'session' => $session, //Session ID
'module_name' => 'Leads', //Module name
'query' => " leads.phone_work IS NOT NULL ", //Where condition without "where" keyword
'order_by' => " leads.last_name ", //$order_by
'offset' => 0, //offset
'select_fields' => $fields_array, //select_fields
'link_name_to_fields_array' => array(array()),//optional
'max_results' => 5, //max results
'deleted' => 'false', //deleted
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'get_entry_list',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
print "<pre>";
print_r($result);
die;
Update a lead status "New" to "Assigned" for lead which we have just created. We can use set_entry method with specified record id to update a value.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId), //Record id to update
array('name' => 'status', 'value' => 'Assigned'),
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Updated, Updated id ".$recordId;
Delete a record via web-service. It is as simple as we update record with id. Here we need to provide id and deleted equal 1.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId),
array('name' => 'deleted', 'value' => '1') //Deleted flag
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Deleted!, Deleted record id is ".$recordId;
Friday, 12 December 2014
how to show errors in php - answers in an instant
error_reporting(E_ALL);
ini_set('display_errors', 1);
source: http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display
Saturday, 7 December 2013
3 reasons people may be put off calling you about your business opportunity
Is an 08 number putting off potential customers daily? |
Do you want more people calling you about your business opportunity?
We've discovered that having a UK local landline number can improve your chances of getting people to call you about your business opportunity. Here's why..
1. Most people have minutes included to land lines in their home or mobile package
2. Freephone (0800 or 0808) numbers are not free for mobiles
3. More people have mobiles than land lines
Get an 0113 Leeds number now – free trial for 1 week followed by £4.99 a month.
More effective than a 0800 and now includes free voicemail service which emails you the voicemail message.
Your exclusive offer
code is
http://goo.gl/RHPWWq
http://goo.gl/RHPWWq
Order your free trial
now.
Other UK codes are available. Please contact mark@hopgood.eu for more details
Never miss a call - get a mobile friendly dedicated number with voicemail for £4.99 a month
Here's a way to get a dedicated local number for your business with voicemail for just £4.99 a month.
First week free - you can try it for a month with no further charges if you cancel in week 1.
As a comparison, BT's standard line rental is £15.45/mth (£15.99/mth from Jan 2014)
Choose from the following UK number prefixes.
First week free - you can try it for a month with no further charges if you cancel in week 1.
As a comparison, BT's standard line rental is £15.45/mth (£15.99/mth from Jan 2014)
Choose from the following UK number prefixes.
0113 Leeds
0114 Sheffield
0115 Nottingham
0116 Leicester
0117 Bristol
0118 Reading
Subscribe to:
Posts (Atom)