Search found 212 matches

by chris
Sun Sep 02, 2018 7:11 pm
Forum: Shell
Topic: Bash last char of a string
Replies: 2
Views: 82503

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: 99192

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: 55931

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: 55931

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 ?
by chris
Fri Feb 09, 2018 9:52 pm
Forum: SQL
Topic: SOLVED: update query update from another table
Replies: 2
Views: 70400

Re: update query update from another table

Yes, you can with update:

here is an example:

Code: Select all

UPDATE update_table AS a, source_table AS b SET a.update_column=b.source_table WHERE a.id=b.id;
by chris
Sat Feb 03, 2018 9:25 pm
Forum: HTML
Topic: HTML CSS show li items in multiple columns
Replies: 1
Views: 63658

Re: HTML CSS show li items in multiple columns

You can use CSS and set inline-block ( with fixed width )
It will set the Li-element next to each other,
and with fixed-width it will look like columns.

li {display: inline-block; width:200px;}

You can also play with the following in CSS,
but the support depends on browser.


columns: 2 ...
by chris
Tue Jan 30, 2018 8:44 pm
Forum: SQL
Topic: SOLVED : Drop table fails
Replies: 2
Views: 63585

Re: Drop table fails

The foreign key is actually on another table;
Use this command to find it:
SELECT * FROM information_schema.table_constraints WHERE constraint_schema = 'DATABASE_NAME' AND constraint_type = 'FOREIGN KEY' ;

Once you find it, you can remove it on that table:
ALTER TABLE other_table DROP FOREIGN ...
by chris
Thu Jan 11, 2018 2:56 pm
Forum: Shell
Topic: SOLVED : Bash remove trailing digits
Replies: 2
Views: 72715

Re: Bash remove trailing digits

Thanks that is what I was looking for :-)
by chris
Tue Jan 09, 2018 10:06 pm
Forum: Shell
Topic: SOLVED : Bash remove trailing digits
Replies: 2
Views: 72715

Re: Bash remove trailing digits

You can use

Code: Select all

VARIABLE="test 556";

VARIABLE=${VARIABLE//[0-9]/};
But this will remove all digits not only at the end.

Better is to use sed

Code: Select all

VARIABLE=`echo $VARIABLE | sed -e 's/[0-9]*$//g'`;