Friday, 29 January 2016

Cent OS 7 svn client svn: E120104: ra_serf: An error occurred during decompression


Solution:
cd ~/.subversion
vi servers, add line: http-library = neon

Add C C++ developer tools to Eclipse Mars for Java EE


Google "add cdt to eclipse mars", found: https://eclipse.org/cdt/downloads.php,
Eclipse > Help > Install New Software... > work with: http://download.eclipse.org/tools/cdt/releases/8.8, follow instructions

Configure Web Proxy on CentOS 7 configuration


System-wide proxy settings - add the following lines to your /etc/environment file:
# vi /etc/environment
http_proxy="http://proxysrv:8080/"
https_proxy="https://proxysrv:8080/"
ftp_proxy="ftp://proxysrv:8080/"
no_proxy=".mylan.local,.domain1.com,host1,host2"

Configure yum to use proxy:
# vi /etc/yum.conf
proxy=http://proxysrv:8080/

Monday, 25 January 2016

OSCLASS plugins like Google Map, social bookmarks facebook twitter, youtube does not show with HTTPS SSL


After you set up secure web server using https for your website you might find the plugins like Google Map, social bookmarks facebook twitter, youtube does not show with HTTPS,
Solution:
go to corresponding folders under oc-content/plugins, grep http *, edit the found files, replace http with https

Sunday, 24 January 2016

How to check trusted root CA list in Google Chrome web browser

Settings > (bottom of page) Show advanced settings... > (section HTTPS/SSL) "Manage certificates..." button > "Trusted Root Certification Authorities" tab

Saturday, 23 January 2016

Insert an iptables rule before a specific line number with a comment, and restore all rules after reboot


# First get the iptables list with the line numbers enabled
$ iptables -nL --line-numbers

# Look up the line number you want to use (the exisitng rule will shift down) and insert your rule
$ iptables -I INPUT {LINE_NUMBER} -p tcp --dport 2121 -s 123.123.123.123 -j ACCEPT -m comment --comment "important information"

$service iptables save
$iptables -L -v

Add secure SSL certificate https to website


For an SSL encrypted web server install the required software
yum install mod_ssl openssl


Got a free SSL certificate from startssl.com:
First, sign up with an email, after verification code verified, a client certificate will be installed on your PC, you will use it to login going forward.
after you login, choose the free certificate, verify your domain(similar steps as when you sign up), after your domain verified,
you need to download startcomtool.exe from its web page, use the tool to generate a CSR, choose method OpenSSL, copy CSR from the tool, paste into the form
after your domain verified in startssl.com, then click generate, after a few minutes, the certificates generated and you can download the certificates,
then upload to your web server, configure web server to point to it.

Update the Apache SSL configuration file

vi /etc/httpd/conf.d/ssl.conf
Change the paths to match where the Key file is stored. for example:

SSLCertificateFile /etc/pki/tls/certs/ca.crt

SSLCertificateKeyFile /etc/pki/tls/private/ca.key

Quit and save the file and then restart Apache

/etc/init.d/httpd restart

Setting up the virtual hosts in /etc/httpd/conf.d/ssl.conf
  <VirtualHost *:80>  
    <Directory /var/www/vhosts/yoursite.com/httpdocs>  
     AllowOverride All  
     </Directory>  
     DocumentRoot /var/www/vhosts/yoursite.com/httpdocs  
     ServerName yoursite.com  
  </VirtualHost>  


To add a sister site on port 443 you need to add the following at the top of your file

NameVirtualHost *:443

and then a VirtualHost record something like this:
  <VirtualHost *:443>  
     SSLEngine on  
     SSLCertificateFile /etc/pki/tls/certs/ca.crt  
     SSLCertificateKeyFile /etc/pki/tls/private/ca.key  
     <Directory /var/www/vhosts/yoursite.com/httpsdocs>  
     AllowOverride All  
     </Directory>  
     DocumentRoot /var/www/vhosts/yoursite.com/httpsdocs  
     ServerName yoursite.com  
 </VirtualHost>  


Restart Apache again using
service httpd restart

Configuring the firewall

open port 443

iptables -A INPUT -p tcp --dport 443 -j ACCEPT
service iptables save
iptables -L -v
Configure HTTPS everywhere
in /etc/httpd/conf/httpd.conf add always redirect to https
 <VirtualHost *:80>  
   ServerAdmin webmaster@craplist.ca  
   ServerName craplist.ca  
   Redirect permanent / https://craplist.ca/  
 </VirtualHost>  


in config.php:
define('WEB_PATH', 'https://craplist.ca/');

Wednesday, 20 January 2016

Adobe Reader XI content preparation progress turn off

1. Go to Edit > Preferences > Reading.
2. Under "Screen Reader Options" select "Only read the currently visible pages".
3. Restart Adobe reader.

Monday, 18 January 2016

Change default ssh port and turn on firewall on CentOS 7


[root@localhost ~]# cd /etc/ssh
[root@localhost ssh]# ll
total 268
-rw-------. 1 root root 242153 Jun 9 2014 moduli
-rw-r--r--. 1 root root 2123 Jun 9 2014 ssh_config
-rw-------. 1 root root 4442 Jun 9 2014 sshd_config
-rw-r-----. 1 root ssh_keys 227 Jul 27 2014 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 162 Jul 27 2014 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys 1679 Jul 27 2014 ssh_host_rsa_key
-rw-r--r--. 1 root root 382 Jul 27 2014 ssh_host_rsa_key.pub
[root@localhost ssh]# cp sshd_config sshd_config.b2016Jan18
[root@localhost ssh]# vi sshd_config # uncomment line Port 22, change to Port 1234
[root@localhost ssh]# semanage port -a -t ssh_port_t -p tcp 1234
-bash: semanage: command not found
[root@localhost ssh]# getenforce
Enforcing
[root@localhost ssh]# yum -y install policycoreutils-python
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/4): extras/7/x86_64/primary_db | 90 kB 00:15
(2/4): base/7/x86_64/group_gz | 155 kB 00:16
(3/4): updates/7/x86_64/primary_db | 1.7 MB 00:19
(4/4): base/7/x86_64/primary_db | 5.3 MB 00:25
Determining fastest mirrors
* base: centos.mirror.iweb.ca
* extras: centos.mirror.iweb.ca
* updates: centos.mirrors.atwab.net
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.2.5-20.el7 will be installed
--> Processing Dependency: policycoreutils = 2.2.5-20.el7 for package: policycor eutils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.1.10-1 for package: policycor eutils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreu tils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.2.5- 20.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycore utils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycore utils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.2.5-2 0.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycore utils-python-2.2.5-20.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.2.5 -20.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-py thon-2.2.5-20.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-py thon-2.2.5-20.el7.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.4.1-5.el7 will be installed
--> Processing Dependency: audit-libs = 2.4.1-5.el7 for package: audit-libs-pyth on-2.4.1-5.el7.x86_64
---> Package checkpolicy.x86_64 0:2.1.12-6.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-8.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.1.10-18.el7 will be installed
--> Processing Dependency: libsemanage = 2.1.10-18.el7 for package: libsemanage- python-2.1.10-18.el7.x86_64
---> Package policycoreutils.x86_64 0:2.2.5-11.el7 will be updated
---> Package policycoreutils.x86_64 0:2.2.5-20.el7 will be an update
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.7-46.el7 will be installed
--> Running transaction check
---> Package audit-libs.x86_64 0:2.3.3-4.el7 will be updated
--> Processing Dependency: audit-libs = 2.3.3-4.el7 for package: audit-2.3.3-4.e l7.x86_64
---> Package audit-libs.x86_64 0:2.4.1-5.el7 will be an update
---> Package libsemanage.x86_64 0:2.1.10-16.el7 will be updated
---> Package libsemanage.x86_64 0:2.1.10-18.el7 will be an update
--> Running transaction check
---> Package audit.x86_64 0:2.3.3-4.el7 will be updated
---> Package audit.x86_64 0:2.4.1-5.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
policycoreutils-python x86_64 2.2.5-20.el7 base 435 k
Installing for dependencies:
audit-libs-python x86_64 2.4.1-5.el7 base 69 k
checkpolicy x86_64 2.1.12-6.el7 base 247 k
libcgroup x86_64 0.41-8.el7 base 64 k
libsemanage-python x86_64 2.1.10-18.el7 base 94 k
python-IPy noarch 0.75-6.el7 base 32 k
setools-libs x86_64 3.3.7-46.el7 base 485 k
Updating for dependencies:
audit x86_64 2.4.1-5.el7 base 234 k
audit-libs x86_64 2.4.1-5.el7 base 80 k
libsemanage x86_64 2.1.10-18.el7 base 123 k
policycoreutils x86_64 2.2.5-20.el7 base 803 k

Transaction Summary
================================================================================
Install 1 Package (+6 Dependent packages)
Upgrade ( 4 Dependent packages)

Total download size: 2.6 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/11): audit-libs-python-2.4.1-5.el7.x86_64.rpm | 69 kB 00:09
(2/11): checkpolicy-2.1.12-6.el7.x86_64.rpm | 247 kB 00:09
(3/11): libcgroup-0.41-8.el7.x86_64.rpm | 64 kB 00:09
(4/11): audit-libs-2.4.1-5.el7.x86_64.rpm | 80 kB 00:09
(5/11): libsemanage-python-2.1.10-18.el7.x86_64.rpm | 94 kB 00:00
(6/11): libsemanage-2.1.10-18.el7.x86_64.rpm | 123 kB 00:00
(7/11): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00
(8/11): audit-2.4.1-5.el7.x86_64.rpm | 234 kB 00:09
(9/11): setools-libs-3.3.7-46.el7.x86_64.rpm | 485 kB 00:00
(10/11): policycoreutils-2.2.5-20.el7.x86_64.rpm | 803 kB 00:00
(11/11): policycoreutils-python-2.2.5-20.el7.x86_64.rpm | 435 kB 00:00
--------------------------------------------------------------------------------
Total 255 kB/s | 2.6 MB 00:10
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : audit-libs-2.4.1-5.el7.x86_64 1/15
Updating : libsemanage-2.1.10-18.el7.x86_64 2/15
Updating : policycoreutils-2.2.5-20.el7.x86_64 3/15
Installing : libsemanage-python-2.1.10-18.el7.x86_64 4/15
Installing : audit-libs-python-2.4.1-5.el7.x86_64 5/15
Installing : python-IPy-0.75-6.el7.noarch 6/15
Installing : checkpolicy-2.1.12-6.el7.x86_64 7/15
Installing : libcgroup-0.41-8.el7.x86_64 8/15
Installing : setools-libs-3.3.7-46.el7.x86_64 9/15
Installing : policycoreutils-python-2.2.5-20.el7.x86_64 10/15
Updating : audit-2.4.1-5.el7.x86_64 11/15
Cleanup : policycoreutils-2.2.5-11.el7.x86_64 12/15
Cleanup : libsemanage-2.1.10-16.el7.x86_64 13/15
Cleanup : audit-2.3.3-4.el7.x86_64 14/15
Cleanup : audit-libs-2.3.3-4.el7.x86_64 15/15
Verifying : setools-libs-3.3.7-46.el7.x86_64 1/15
Verifying : libsemanage-2.1.10-18.el7.x86_64 2/15
Verifying : libcgroup-0.41-8.el7.x86_64 3/15
Verifying : checkpolicy-2.1.12-6.el7.x86_64 4/15
Verifying : policycoreutils-2.2.5-20.el7.x86_64 5/15
Verifying : python-IPy-0.75-6.el7.noarch 6/15
Verifying : audit-libs-2.4.1-5.el7.x86_64 7/15
Verifying : libsemanage-python-2.1.10-18.el7.x86_64 8/15
Verifying : audit-2.4.1-5.el7.x86_64 9/15
Verifying : policycoreutils-python-2.2.5-20.el7.x86_64 10/15
Verifying : audit-libs-python-2.4.1-5.el7.x86_64 11/15
Verifying : policycoreutils-2.2.5-11.el7.x86_64 12/15
Verifying : audit-libs-2.3.3-4.el7.x86_64 13/15
Verifying : libsemanage-2.1.10-16.el7.x86_64 14/15
Verifying : audit-2.3.3-4.el7.x86_64 15/15

Installed:
policycoreutils-python.x86_64 0:2.2.5-20.el7

Dependency Installed:
audit-libs-python.x86_64 0:2.4.1-5.el7
checkpolicy.x86_64 0:2.1.12-6.el7
libcgroup.x86_64 0:0.41-8.el7
libsemanage-python.x86_64 0:2.1.10-18.el7
python-IPy.noarch 0:0.75-6.el7
setools-libs.x86_64 0:3.3.7-46.el7

Dependency Updated:
audit.x86_64 0:2.4.1-5.el7 audit-libs.x86_64 0:2.4.1-5.el7
libsemanage.x86_64 0:2.1.10-18.el7 policycoreutils.x86_64 0:2.2.5-20.el7

Complete!
[root@localhost ssh]# semanage port -a -t ssh_port_t -p tcp 1234
[root@localhost ssh]#
[root@localhost ssh]# firewall-cmd --permanent --zone=public --add-port=1234/tcp
FirewallD is not running
[root@localhost ssh]#
[root@localhost ssh]# systemctl enable firewalld
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@localhost ssh]# systemctl start firewalld
[root@localhost ssh]# firewall-cmd --permanent --zone=public --add-port=1234/tcp
success
[root@localhost ssh]# firewall-cmd --reload
success
[root@localhost ssh]#
[root@localhost ssh]# systemctl restart sshd.service
[root@localhost ssh]#
[root@localhost ssh]#
[root@localhost ssh]#
[root@localhost ssh]# ss -tnlp | grep ssh
LISTEN 0 128 *:1234 *:* users:(("sshd",24327,3))
LISTEN 0 128 :::1234 :::* users:(("sshd",24327,4))
[root@localhost ssh]#

Thursday, 14 January 2016

Windows 10 built-in hidden screen recording tool

windows key+G
check the 'Yes, this is a game' box
click the circle button to start recording

Friday, 8 January 2016

Tip to make windows 7 run faster

My windows 7 gets very slow easily, when I right click task bar > Start Task Manager > Processes, I see a lot of Chrome.exe *32 processes meaning they are 32 bit applications,
I downloaded Chrome browser 64bit version from here: https://www.google.com/chrome/browser/beta.html, the performance improved a lot, I can not feel the latency/slowness any more.

Search