When I ran `borg list`, and other `borg` commands, I got the error: Failed to create/acquire the lock
I found this, which referred me to how to remove the lock (I was quite sure it was not in use).
When I ran `borg list`, and other `borg` commands, I got the error: Failed to create/acquire the lock
I found this, which referred me to how to remove the lock (I was quite sure it was not in use).
So I found this article which said:
$ sudo -u postgres psql
postgres=> alter user postgres password 'apassword'; postgres=> create user your-user createdb createuser password 'passwd'; postgres=> create database your-db-name owner your-user; postgres=> \q
Note: to enable password logins for the ‘postgres’ admin account, edit: /etc/postgresql/9.4/main/pg_hba.conf and after this line:
local all postgres peer
Add this line:
local all postgres md5
I had a problem creating files/directories in /home on my Mac.
To fix the problem I edited /etc/auto_master and commented out the /home line.
Then I rebooted and was able to use /home.
I heard on the grape vine that Time Machine doesn’t backup /home, which is no problem for me…
I started a new project today to load the contacts from my personal database into my iPhone.
cd ~/Documents/pcrepo/aman-importer phonegap create phonegap-test cd phonegap-test phonegap platform add ios phonegap plugin add org.apache.cordova.contacts
There is documentation for the Contacts API.
The trouble I got into was iteratively creating contacts.
Code like this doesn’t work:
for ( var i in contact_data_list ) { var contact_data = contact_data_list[ i ]; var contact = navigator.contacts.create(); var name = new ContactName(); name.givenName = contact_data.first_name; name.familyName = contact_data.last_name; contact.name = name; contact.save( function() { alert( 'saved!' ); }, function() { alert( 'failed!' ); } ); }
The behavior is that contact.save fails and neither of the success or failure callbacks are invoked.
The way to iterate over the input data is like this:
var index = 0; var saver = function() { if ( index === contact_data_list.length ) { // we're finished enumerating the array, we can report and exit: navigator.contacts.find( ['*'], report_contacts ); return; } var contact_data = contact_data_list[ index++ ]; var contact = navigator.contacts.create(); var name = new ContactName(); name.givenName = contact_data.first_name; name.familyName = contact_data.last_name; contact.name = name; contact.save( saver, function() { alert( 'failed!' ); } ); }; saver();
You can see it for real over here…
To create a database and user account for use on PostgreSQL:
root@devotion:~# su - postgres postgres@devotion:~$ psql psql (8.4.21) Type "help" for help. postgres=# create user "www-data" superuser; CREATE ROLE postgres=# create database mydb with owner "www-data"; CREATE DATABASE postgres=# \c mydb psql (8.4.21) You are now connected to database "mydb". ^ mydb=# alter user "www-data" with password 'secret'; ALTER ROLE
Today I was looking up the syntax to create a MySQL database from the command-line and found instructions on Snipplr. I haven’t seen snipplr before. I guess I’ll have to spend some time one day browsing the popular snippets.