Postingan

Menampilkan postingan dari 2014

Perl directory watcher and sender using pscp

This perl program is use for monitoring directory, and doing upload if any matched kind of file using pscp.exe. This program is running on Win32 platform #! perl use warnings; #use strict; use feature "switch"; use Win32::OLE qw(in); use File::Copy; my $app_dir = "C:/EXEC_NEW"; my $raw_dir = "C:/RAW_EOS"; my $arch_npoess = "C:/ARCH_NPOESS"; my $arch_fy = "C:/ARCH_FY"; my $dest = "192.168.20.101"; my $dest_dir = "/raid/raw"; my $dest_acc = "ipopp"; my $dest_access = "*****"; my $dest_addr = "ipopp\@192.168.20.101:/raid/raw"; my $uploaded_file = ""; chdir $app_dir or die "Directory not found"; PARENT: while() { #check pscp #check EOSingest sleep(6); if(matching_processes (qr/EOSingest/)) { print "Retreiving RAW file, please wait ...\n"; next; } if (matching_processes (qr/pscp/)) { print "Uploading $uploa

Perl Directory and Process Watcher

Directory watcher to monitor uploaded files in a server, and do some data extraction after upload process is complete   #!/usr/sbin/perl -w #use strict; use warnings; use POSIX; use feature "switch"; use File::Copy; my $dir = "/raid/raw"; my $rtstps_dir = "/home/ipopp/drl/rt-stps"; my $processed_file = ""; my $config_file = ""; my $rtstps = 0; my $rtstps_file = ""; print "starting ... \n"; chdir $rtstps_dir or die "Cannot find RTPSPS directory"; #daemonize(); PARENT: while () {     sleep(6);     if (check_rtstps()) {         print "rt-stps is running, please wait ....! \n";         next;     } elsif ($rtstps == 1 && $rtstps_file ne "") {         move("$dir/$rtstps_file","$dir/arch/$rtstps_file");         $rtstps = 0;         $rtstps_file = "";     }     if ($processed_file eq "") {         opendir (DH, $dir) || die "Cannot open dire

JQM Designer online

Gambar
http://jqmdesigner.appspot.com/

VSFTPD Anon

    # # Sample anonymous FTP server configuration # # Mandatory directives # listen=YES local_enable=NO anonymous_enable=YES write_enable=NO anon_root=/var/ftp # # Optional directives # anon_max_rate=2048000 xferlog_enable=YES listen_address=192.168.0.100 listen_port=21   Sumber :: http://www.g-loaded.eu/2008/12/02/set-up-an-anonymous-ftp-server-with-vsftpd-in-less-than-a-minute/

Perl Daemon

http://search.cpan.org/~deti/Proc-Daemon-0.14/lib/Proc/Daemon.pod use Proc :: Daemon ; $daemon = Proc :: Daemon -> new ( work_dir => '/my/daemon/directory' , ..... ); $Kid_1_PID = $daemon -> Init ; unless ( $Kid_1_PID ) { # code executed only by the child ... } $Kid_2_PID = $daemon -> Init ( { work_dir => '/other/daemon/directory' , exec_command => 'perl /home/my_script.pl' , } ); $pid = $daemon -> Status ( ... ); $stopped = $daemon -> Kill_Daemon ( ... );

CentOS MySQL boot start

[root@server]# chkconfig mysqld on [root@server]# service mysqld start

Centos 6 Enable NTFS support

# cd /etc/yum.repos.d # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -Uvh epel-release-6-8.noarch.rpm # yum install ntfs-3g.x86_64

Centos 6 Kambing Repo

# CentOS-Base.repo # http://kambing.ui.ac.id/centos/6.5/ # /etc/yum.repos.d/CentOS-Base.repo [SCL] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/SCL/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6 [CentOSPlus] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/centosplus/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6 [Contrib] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/contrib/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6 [Extras] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/extras/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6 [Fasttrack] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/fasttrack/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6 [OS] name=CentOS baseurl=http://kambing.ui.ac.id/centos/6/os/x86_64/ e

Install and Setup VSFTPD in CentOS 6.5

Instal FTP and VSFTPD $sudo yum install vsftpd ftp -y $sudo setsebool -P ftp_home_dir on $getsebool -a |grep ftp allow_ftpd_anon_write --> off allow_ftpd_full_access --> off allow_ftpd_use_cifs --> off allow_ftpd_use_nfs --> off ftp_home_dir --> on ( Value changed from off into on ) ftpd_connect_db --> off ftpd_use_fusefs --> off ftpd_use_passive_mode --> off httpd_enable_ftp_server --> off tftp_anon_write --> off tftp_use_cifs --> off tftp_use_nfs --> off Edit VSFTPD Configuration $sudo nano /etc/vsftpd/vsftpd.conf Set the value anonymous_enable=NO Uncomment these line ascii_upload_enable=YES ascii_download_enable=YES chroot_local_user=YES