Search found 197 matches

by chris
Thu Nov 01, 2018 12:31 pm
Forum: SQL
Topic: how to Select string starting with lower
Replies: 1
Views: 37826

Re: how to Select string starting with lower

In mysql I like to use :

Code: Select all

SELECT name FROM table WHERE BINARY(name) REGEXP '^[a-z]';
It work really well for me.
by chris
Sun Sep 16, 2018 7:45 pm
Forum: HTML
Topic: css set to div block next too each other
Replies: 1
Views: 40451

Re: css set to div block next too each other

there are probably multiple solution. One I find easy is this one: <div id="parent"> <div id="part1">(200px)</div> <div id="filling">(rest of width)</div> </div> CSS #parent { display: flex; } #part1 { width: 200px; background: lightblue; } #filling { flex: 1; /* Grow t...
by chris
Sat Sep 08, 2018 11:22 am
Forum: PHP
Topic: Fatal error: Allowed memory size exhausted
Replies: 1
Views: 37168

Re: Fatal error: Allowed memory size exhausted

In the php.ini file (/etc/php/cli-php7.0/php.ini)
you can set the Allowed memory :

Code: Select all

memory_limit=128M
You can increase it to 512M or even more.
But you might want to check why your script uses that much memory.
by chris
Thu Sep 06, 2018 6:40 pm
Forum: MySQL
Topic: SOLVED: mysql table is marked as crashed and should be repaired
Replies: 4
Views: 36660

Re: mysql table is marked as crashed and should be repaired

Default MySQL repair uses /tmp as temporary dir.
In many system /tmp is now mounted as tmpfs in ram memory,
and is limited in size.

You can change it /etc/mysql/my.cnf
change the tmpdir variable to another dir:

Code: Select all

tmpdir=/var/tmp
and restart MySQL:

Code: Select all

/etc/init.d/mysql restart
by chris
Sun Sep 02, 2018 7:31 pm
Forum: Shell
Topic: Bash last char of a string
Replies: 2
Views: 33325

Re: Bash last char of a string

Found a resolution:

This gives the last character:

Code: Select all

echo "${FILENAME:$((${#str}-1)):1}"
by chris
Sun Sep 02, 2018 7:11 pm
Forum: Shell
Topic: Bash last char of a string
Replies: 2
Views: 33325

Bash last char of a string

Hi,

does anyone know how to get the last characters of a string?
in bash.

Thanks
by chris
Tue Aug 14, 2018 8:23 pm
Forum: Postfix
Topic: postfix forward mail to multiple recipients
Replies: 2
Views: 44749

Re: postfix forward mail to multiple recipients

Yes it possible.
Separate the emails with comas.

Edit the file /etc/postfix/vmail_aliases

Code: Select all

group@domain.com bob@domain.com,alice@domain.com
by chris
Mon May 07, 2018 6:17 pm
Forum: PHP
Topic: SOLVED: PHP file_put_contents not writing to /tmp
Replies: 1
Views: 17640

Re: PHP file_put_contents not writing to /tmp

Found the solution:

Apache/php now create a directory in /imp which hold the /tmp/file.tmp

Code: Select all

/tmp/systemd-private-9b5e7c68bxxx45faa1a812b5df02f1ab-apache2.service-5ExxRI/tmp/
So it doesn't write directly to /tmp.
Makes it more difficult to read it by another script :-(
by chris
Sun May 06, 2018 8:22 pm
Forum: PHP
Topic: SOLVED: PHP file_put_contents not writing to /tmp
Replies: 1
Views: 17640

SOLVED: PHP file_put_contents not writing to /tmp

I have a php script that writes to /tmp directory

Code: Select all

file_put_contents('/tmp/file.tmp',$value);
But it doesn't write, I can't find the files.
I also don't get errors (php or in apache)

Anyone got any ideas ?