The Linux Page

database

SugarCRM Community Edition for Ubuntu 16.04 with PHP 7

As I wanted to use SugarCRM on my new server, I looked into the Community Edition and apparently the company is not willing to convert their code so it works under PHP 7.

So that would not work on a newer system because the code uses quite a few forbidden mechanism (wrong class definitions, old defunct functions...) and that prevents to even instal the system on your machine.

Now, I have looked closer into it and I am getting a version that works pretty darn well already. I still have some issues here and there, but I think you can already make use of that version. Except for one thing which ...

Boot into the command line console in Ubuntu 16.04

As I just upgraded my 14.04 installation to 16.04, it booted right up to lightdm.

I had it properly setup to boot in a console before, but somehow it changed the behavior on me.

This is because the computer is now using systemd to boot.

I already had the GRUB variables setup as expected:

GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX="text"
GRUB_TERMINAL=console

But this is not enough if you want to start in the console when running systemd (which is running since 15.04).

systemd has a list of variables you can tweak using the systemctl command. To boot in ...

Repair a Cassandra Cluster

I use the Cassandra database cluster system to manage a new set of websites and once in a while I start getting many errors and the website stops working altogether.

When that happens, it is likely that Cassandra broke something in the temporary tables that it holds. The only way to go past that problem is to clear those tables. Until then, it will fail over and over again (they really would need some euristic to auto-clean up even if it means that you're losing some data.)

The command to repair the database, really quick, is as follow:

nodetool scrub snap_websites files

Note that ...

Bad move for PHP unpack()! So unpack() stopped working?

Today I noticed many errors on one of my websites. Looking closer into it, I noticed that the code for the mo_references Drupal module stopped working.

It took me some time, especially because the code seemed to work just fine as all the files could easily be displayed.

Actually, that was not the case. The unpack() character 'a', which I used, was transformed from a simple string that gets trimmed, to all the characters, including the NULL characters. Ouch! Now we have to use the 'Z' character instead.

I use it to unpack() a tar file by loading 512 bytes of data in a ...

My JavaScript code does not get the correct widget size, why?

As I am developing a set of pages for a customer, I ran in an intersting problem: my JavaScript function could not properly define the sizes of a box.

That box is heavily tweaked with the CSS assigned to it, as well as all of its neighbors. So I thought that may have something to do with it.

What I hadn't realized so far is that the ready() function of jQuery() is called once the script that includes it is ready (as in loaded) and not once the document as a whole is ready (done loading, i.e. onload event.)

With that knowledge it was easy to understand that I was actually finding myself ...

tripwire while updating the policy settings: Error: Policy Update Changed Object.

As I was trying to remove some annoying entries in my Tripwire policy, I started getting errors. The first time I did not pay close attention, but the next day the policy had not changed! So I looked at it closer and noticed that if a file changed since the last update, then tripwire refuses to update the policy. That is, if the secure mode is set to high.

So to update my tripwire policy I was running:

sudo tripwire -m p -p /etc/tripwire/tw.pol --secure-mode low /etc/tripwire/twpol.txt

which now (at least since 13.04, maybe in 12.10?) means the secure mode is left alone and is marked as ...

Copying a PostgreSQL database from one computer to another

When moving a database from one computer to another, you've got to copy all the data.

For PostgreSQL, there is a pair of functions named pg_dump and pg_restore.

In most cases that works great, however, some systems may create things such as additional functions that will NOT make it across. I do not know how to get that to work (and maybe it works in newer version of PostgreSQL?)

In any event, in most cases the following commands are enough (I used them with Drupal websites and since they stopped using some of the definitions they have in the system.install file used on initialization, ...

tripwire --init not saving the database

I ran in a problem with tripwire, it did not want to generate the <hostname>.twd file under /var/lib/tripwire

I could see that because it reports, once a day, whether tripwire ran sucessfully or not. It was not and the main error was: the tripwire database does exist which is actually shown as:

### Error: File could not be opened.
### Filename: /var/lib/tripwire/<hostname>.twd
### No such file or directory
### Exiting...

That, in itself, looks easy to fix. So I ran tripwire --init and voià!

sudo tripwire --init

As usual, it print a few errors and ignored them.

WordPress user "nicename" and spaces

Today I noticed that I had quite a few 404 errors on one of my websites. That one uses Wordpress that I got from someone else. Because I wanted to include a blog, I had to change the login name and Wordpress does not allow you to do that by default.

So to change the login and password, I directly edited the database makeing user 1 me, essentially.

I replaced the user_login and user_nicename with my own name. This worked just fine. At least at first it looked like everything was working right. Then I noticed that the author link had my name in it. The one with the space. Something like ...

Check the presence of a table in a MS-Access database

Today I wanted to check whether a table existed in a MS-Access database from a macro define in a MS-Access module.

The test opens the specified database (databaseName) and from that object checks wether a table definition exists (name). I wonder whether there would be a better way to go through the list of items and just know whether an item with that name exists or not instead of generating an error (because the underlaying system will anyway search that list of items for the name, although it may be faster this way in visual basic.)

There is the function I wrote (sample usage: if ...

Syndicate content Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

Terms of Site Index

Find the page/content you are looking for with our index.

  • FIFO
    First In, First Out--This is another way to speak of a pipe or ring buffer. On one side, there is a generator that pushes data in and on the other side you have another program that reads the data sent by the generator. The data comes out in the same order it was pushed in. Usually the data are bytes, but it should be a short, long or even a complete event or object.
  • Windows
  • character
  • create
  • search