Michael Li
- About: I blog issues resolved at work
Recent Actions
-
Posted how to sync time between two linux servers to Michael Li
-
Found a way to synchronize date and time with a server over ssh which can quickly solve the problem:
- Option 2
# date --set="$(ssh user@server date)"
Or you can do it the other way around:
# ssh user@host "date --set \"$(date)\""
‘ntp… -
Posted passwordless ssh not working on rhel5 to Michael Li
Was doing automation test, trying to set up passwordless ssh between the dirver and couple of test nodes. it just didn't work with one rhel5 box. Finally find the solution:
[root@perlrh5-179 .ssh]# tail -n 10 /var/log/secure
Dec 4 12:39:56 perlrh5-179 sshd[9397]: Authentication refu… -
Posted find and exec to Michael Li
first we can use find's exec opiton
find . -name CVS -exec ls -dl {} \;
also we can use shell
for i in `find . -name CVS` ; do echo -n $i," "; done
change ls, echo to whatever suits you, like rm -rf
-
Posted cmd to compare contents of two directories to Michael Li
diff -qr dir1 dir2
-
Posted How to remove a carriage return (\r\n) to Michael Li
use strict;
{
my $str = "abcd\r\n";
$str =~ s/\r|\n//g;
print "[$str]";
}{
my $str = "abcd\n";
$str =~ s/\r|\n//g;
print "[$str]";
}{
my $str = "abcd\r";
$str =… -
Posted Check Eclipse Hot keys to Michael Li
open Eclipse press Control-Shift-L.
Alt-left arrow: Go back in navigation history.
Alt-right arrow: Go forward. -
Posted MySQL DATE_SUB() to Michael Li
SELECT OrderId,DATE_SUB(OrderDate,INTERVAL 2 DAY) AS OrderPayDate
FROM Orders -
Posted use variable from other module to Michael Li
In module bait we have
our %IMAGEPADV = (
'SxRT-5.1' => [ qw(sol_sparc sol_x64) ],
'LxRT-5.1' => [qw(rhel5_x86_64 sles10_x86_64 sles11_x86_64)],
...
);In my own module use this to access %IMAGEPADV
%bait::IMAGEPADV
Comment Threads
No responses to comments.
Responses to Comments from Michael LiAbout blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.