Friday, January 8, 2016

How to host bugzilla in RHEL6

http://bugzilla.readthedocs.org/en/latest/installing/linux.html

https://www.rosehosting.com/blog/how-to-install-bugzilla-on-centos-6/

http://ftp.mozilla.org/pub/webtools/


http://www.thegeekstuff.com/2010/05/install-bugzilla-on-linux/


1. Install perl, httpd, mysql-server, etc
2. Install perl modules (perl install-module.pl --all)
3. Configure mysql-server config files
4.

 yum install httpd mysql-server mod_perl mod_perl-devel httpd-devel 

Troubleshooting MySQL:
http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run


Tuesday, December 22, 2015

Perl CSV to Excel 2003

http://www.perlmonks.org/?abspart=1;displaytype=displaycode;node_id=635437;part=1

http://www.perlmonks.org/?node_id=635437

http://cpansearch.perl.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.37/examples/csv2xls.pl

http://unix.stackexchange.com/questions/158254/convert-csv-to-xls-file-on-linux


Wednesday, November 18, 2015

Download ebook recursively

http://stackoverflow.com/questions/273743/using-wget-to-recursively-fetch-a-directory-with-arbitrary-files-in-it

wget -r --no-parent ftp://ftp.ni.com/pub/events/

wget -r --no-parent ftp://ftp.ni.com/pub/branches/uk/


Tuesday, October 13, 2015

Modify Screen Saver Timeout in Registry

Modify Screen Saver Timeout in Registry

1. Start > Run > regedit
2. Find "ScreenSaveTimeOut"
3. Click and modify the value

Monday, October 12, 2015

Windows Task Manager - kill task and list task

References:
http://www.addictivetips.com/windows-tips/kill-processes-from-the-command-prompt-in-windows-7/
https://technet.microsoft.com/en-us/library/bb491009.aspx

1. List Task List
C:\> Tasklist

2. Kill Tasks in single command
C:\> TaskKill /f /im excel.exe



Thursday, July 2, 2015

Perl Gmail SMTP

Credit to :
http://robertmaldon.blogspot.sg/2006/10/sending-email-through-google-smtp-from.html

# Remember to enable to allow less secure app to login the account

#!/usr/bin/perl -w

use Net::SMTP::SSL;

sub send_mail {
my $to = $_[0];
my $subject = $_[1];
my $body = $_[2];

my $from = 'cybertech@company.com';
my $password = 'Pass';

my $smtp;

if (not $smtp = Net::SMTP::SSL->new('smtp.gmail.com',
                            Port => 465,
                            Debug => 1)) {
   die "Could not connect to server\n";
}

$smtp->auth($from, $password)
   || die "Authentication failed!\n";

$smtp->mail($from . "\n");
my @recepients = split(/,/, $to);
foreach my $recp (@recepients) {
    $smtp->to($recp . "\n");
}
$smtp->data();
$smtp->datasend("From: " . $from . "\n");
$smtp->datasend("To: " . $to . "\n");
$smtp->datasend("Subject: " . $subject . "\n");
$smtp->datasend("\n");
$smtp->datasend($body . "\n");
$smtp->dataend();
$smtp->quit;
}

# Send away!
&send_mail('cybertech@cybertechcom', 'Testing is working', 'Should try this out!');


Wednesday, July 1, 2015

Configuring Samba RHEL

Credit references to:
http://www.debuntu.org/samba-how-to-share-files-for-your-lan-without-userpassword/

http://www.techotopia.com/index.php/Sharing_Files_between_RHEL_6_and_Windows_Systems_with_Samba

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-samba-configuring-cmdline.html

http://www.techotopia.com/index.php/Sharing_Files_between_RHEL_6_and_Windows_Systems_with_Samba

https://www.youtube.com/watch?v=yDA8DOHDaRg

https://aaronwalrath.wordpress.com/2011/03/26/install-samba-server-on-red-hat-enterprise-linux-6scientific-linux-6/

http://www.linuxexplorers.com/2014/04/configure-samba-share-in-red-hat-enterprise-linux-7-rhel7/

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-iptables-saving.html

Now we need to make changes to the “iptables” firewall startup config file. Backup the file and edit:
# cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
# vi /etc/sysconfig/iptables
Add the first line accepting packets on TCP/445. Be sure and add it above the last line of the “input” chain with the “Reject” target, that way the rule will be processed.
-A INPUT -p tcp --dport 445 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited

Then RESTART IPTABLE service
# service iptables restart

Configuring the smb.conf File

# Edit smb.conf
[cyber@cybertech ~]$ sudo vi /etc/samba/smb.conf
[sudo] password for cyber:

# Share with defined user to read and write permission
        [ITshare]
        comment = IT scripts folder
        path = /home/itshare/
        valid users = cyber
        public = yes
        writeable = yes
        printable = no
        create mask = 0777
        browseable = yes

# Share without prompt login and able to read and write permission
       [ITshare]
        comment = IT scripts folder
        path = /home/itshare/
        write list = guest  # This allow guest to write without login
        read only = No
        create mask = 0777
        guest ok = Yes


        [WWW]
        comment = Web Hosting Folder
        path = /var/www/
        valid users = cyber root
        public = yes
        writeable = yes
        printable = no
        create mask = 0777
        browseable = yes


# Restart SMB service
[cyber@cybertech ~]$ sudo service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]