Search found 197 matches
- Fri Sep 03, 2010 10:09 am
- Forum: General
- Topic: Solved: Remove the ^M Character
- Replies: 2
- Views: 24484
Re: Remove the ^M Character
When you move files from windows to (l)unix, you always have problems with white characters. Thats because windows and linux handle with spaces differently. Sed can be found on most linux/unix distributions. sed s/\r// hello.txt > goodhello.txt you can also do the same with perl: perl -pie 's/\r//g'...
- Tue Aug 31, 2010 2:07 pm
- Forum: General
- Topic: How do i get columns out of text in shell
- Replies: 1
- Views: 22897
Re: How do i get columns out of text in shell
Hi,
you can do this with awk
For example:
This gets the second column from the file list.txt
Standard the separation is space (" ")
With -F you can change this
You can also use gawk as an alternative.
you can do this with awk
For example:
Code: Select all
awk '{ print $2 }' list.txt
Standard the separation is space (" ")
With -F you can change this
Code: Select all
awk -F ";" '{ print $2 }' list.txt
- Wed Aug 04, 2010 10:46 pm
- Forum: PHP
- Topic: update php on CentOS
- Replies: 2
- Views: 23121
Re: update php on CentOS
You can find a complete explanation here: http://blog.famillecollet.com/pages/Config-en In short: You have to install EPEL: wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm rpm -Uvh epel-release-5*.rpm Then set the Remi repository: cd /etc/yum.repos.d wget http://rp...
- Mon Jul 19, 2010 9:24 pm
- Forum: PHP
- Topic: PHP yesterday date
- Replies: 1
- Views: 20995
Re: PHP yesterday date
Hi,
mktime() works fine for me:
But you can also use the following code:
The result should be the same.
mktime() works fine for me:
Code: Select all
$yesterday=date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")));
Code: Select all
$yesterday=date("Y-m-d", time()-86400);
- Sun Jul 18, 2010 8:33 pm
- Forum: PHP
- Topic: SOLVED: How to send a HTML mail
- Replies: 1
- Views: 20620
Re: How to send a HTML mail
With PHP it is easily done. You create the body of your message in html. Don't forget <html><body></body></html> and in the headers you tell it is a HTML-mail with the following line: Content-type: text/html\r\n So the complete code looks something like this: $email='someone@somewhere.com'; $subject...
- Mon Jun 28, 2010 9:54 am
- Forum: Servers
- Topic: Solved: bincimap not starting
- Replies: 2
- Views: 32266
Re: bincimap not starting
are yo sure svscan is running?
On my gentoo machine I can check this with:
If the status is stopped
You can start it with
then run
and it should work.
Regards
On my gentoo machine I can check this with:
Code: Select all
/etc/init.d/svscan status
You can start it with
Code: Select all
/etc/init.d/svscan start
Code: Select all
svc -u /service/bincimap/
Regards
- Mon Jun 14, 2010 11:14 pm
- Forum: PHP
- Topic: Solved: print of double/float
- Replies: 1
- Views: 20700
Re: print of double/float
You can do this with the function number_format()
Code: Select all
$float = 55.3333333333;
$new_num = number_format($float, 2);
echo $new_num; //55.33
- Sun May 16, 2010 5:50 pm
- Forum: Postfix
- Topic: Solved: How do I create non-local aliases in postfix
- Replies: 2
- Views: 46783
Re: How do I create non-local aliases in postfix
You probably want something like virtual alias domains . Add/edit the following in /etc/postfix/main.cf : virtual_alias_domains = example.com, example.net, example2.com virtual_alias_maps = regexp:/etc/postfix/virtual_alias The create the file /etc/postfix/virtual_alias with the aliases you need: po...
- Sat Mar 20, 2010 3:18 am
- Forum: Apache
- Topic: Solved: Apache won't start: no listening sockets available
- Replies: 4
- Views: 30779
Re: Apache won't start: no listening sockets available
I had this problem once. Apparently, /usr/htdocs is a default directory build in apache. that is way you can't find it in the config files. Your are probably using virtual host, but haven't included it your command to launch apache. It should look something like this: apache2 -D DEFAULT_VHOST -D PHP...
- Fri Mar 19, 2010 10:53 pm
- Forum: Apache
- Topic: Solved: Apache won't start: no listening sockets available
- Replies: 4
- Views: 30779
Re: Apache won't start: no listening sockets available
Sounds like the Listing ports aren't set.
Check in /etc/apache2/httpd.conf
for the line:
(Can be any other port, that isn't used by another service.)
Check in /etc/apache2/httpd.conf
for the line:
Code: Select all
Listen 80