Thursday, November 5, 2015

DevOps

Switch JDK on MacOS

obrienlabs-mbp15:bin michaelobrien$ /usr/libexec/java_home -V
Matching Java Virtual Machines (6):
    1.8.0_65, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
    1.8.0_20, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home
    1.8.0_11, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
    1.7.0_51, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
    1.7.0_45, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
    1.7.0_15, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home


obrienlabs-mbp15:bin michaelobrien$ sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents \
> /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
ln: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK: Operation not permitted
obrienlabs-mbp15:bin michaelobrien$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_65`
obrienlabs-mbp15:bin michaelobrien$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
obrienlabs-mbp15:bin michaelobrien$ vi ~/.bashrc

obrienlabs-mbp15:bin michaelobrien$ java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
obrienlabs-mbp15:bin michaelobrien$ javac -version

javac 1.8.0_65

Ubuntu
Add proxy for APT
 Add the following line to /etc/apt/apt.conf : Acquire::http::proxy "http://global.proxy.*-*.com:8000/";

Static Network Config
Second Network Config survives reboot
RHEL
>vi /etc/sysconfig/network-scripts/ifcfg-*
ONBOOT=yes

BOOTPROTO=static
NETWORK=192.168.2.0
NETMASK=255.255.255.0
IPADDR=192.168.2.101
USERCTL=no
DNS1=192.168.2.1
GATEWAY=192.168.2.1

for dns check /etc/yp.conf

Configure VNC
https://access.redhat.com/solutions/966063

Configuring AWS CodeCommit on OSX


  • git config --global credential.helper '!aws codecommit credential-helper $@'
  • git config --global credential.UseHttpPath true
  • 534  curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
  • 535  unzip awscli-bundle.zip
  • 536  sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws537  aws --version539  aws configure541  aws ec2 describe-instances --output table --region us-east-1

verify


Eclipse IDE Workarounds

Maven Project changes remove spring lib folder in STS

This error occurs a couple times a month when I asjust a war project - eclipse causes spring exceptions on tomcat startup.  The issue is the spring jars local to the war classloader are not loaded


Dec 24, 2016 10:21:03 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.request.RequestContextListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)

fix:
Add back
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>



IOS 9.0/Xcode 7 Security changes force HTTPS

state

Xcode 7 changes block http access

2015-10-17 19:40:27.422 Biometric[72723:1193943] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.


https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html


PostgreSQL 9.4 Installation - RHEL 7.2

   yum install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
   yum install postgresql94-server postgresql94-contrib
   /usr/pgsql-9.4/bin/postgresql94-setup initdb
   chkconfig postgresql-9.4 on
   systemctl enable postgresql-9.4.service

   systemctl start postgresql-9.4.service


vi /var/lib/pgsql/9.4/data/pg_hba.conf 
host    all             all             192.168.0.0/24          trust


MySQL 5.7 install - RHEL 7.2

http://dev.mysql.com/downloads/mysql/ 
http://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html
cd Downloads
yum repolist enabled | grep "mysql.*-community.*"
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum install mysql-community-server
service mysqld start
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
mysql> ALTER User 'root'@'localhost' IDENTIFIED BY 'S';
/usr/bin/mysql_secure_installation
mysql -u root -p

mysql>create database biometric;
mysql>create user 'obrienlabs'@'192.168.0.21' IDENTIFIED BY 'OC';
mysql>grant all on biometric.* to 'obrienlabs'@'192.168.0.21';
mysql> create user 'obriensystems'@'%' IDENTIFIED BY 'S';
mysql> grant all on biometric.* to 'obriensystems'@'%';
mysql>flush privileges;
firewall-cmd --permanent --zone=public --add-service=mysql
firewall-cmd --permanent --zone=public --add-port=3306/tcp
systemctl restart firewalld.service

help hibernate
#https://github.com/Elgg/Elgg/issues/8121
# remove ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES
SET GLOBAL sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;


block systems doing 330ms scans on /manager
24-Apr-2016 20:56:23.562 WARNING [http-nio-8080-exec-1] org.apache.catalina.realm.LockOutRealm.authenticate An attempt was made to authenticate the locked user "manager"
191.100.28.217 - - [24/Apr/2016:20:56:23 -0400] "GET /manager/html HTTP/1.1" 401 2473
traceroute to 191.100.28.217 (191.100.28.217), 30 hops max, 60 byte packets
 1  gateway (192.168.0.1)  1.751 ms  2.171 ms  2.460 ms
 2  7.11.161.65 (7.11.161.65)  15.363 ms  15.520 ms  18.285 ms
 3  67.231.220.65 (67.231.220.65)  19.414 ms  19.632 ms  19.744 ms
 4  van58-9-231-73.dynamic.rogerstelecom.net (209.148.231.73)  27.127 ms  27.336 ms  35.187 ms
 5  van58-9-229-225.dynamic.rogerstelecom.net (209.148.229.225)  38.660 ms  39.272 ms  39.359 ms
 6  24.156.144.178 (24.156.144.178)  50.564 ms  33.076 ms  38.590 ms
 7  if-ae-12-0.tcore2.CT8-Chicago.as6453.net (64.86.79.89)  50.078 ms  51.630 ms  51.746 ms
 8  if-ae-26-2.tcore2.NTO-New-York.as6453.net (216.6.81.28)  58.778 ms  58.646 ms  58.857 ms
 9  if-ae-14-15.thar2.NJY-Newark.as6453.net (66.198.111.8)  58.387 ms if-ae-26-2.tcore2.NTO-New-York.as6453.net (216.6.81.28)  66.430 ms if-ae-18-2.thar2.NJY-Newark.as6453.net (66.198.111.6)  66.812 ms
10  if-ae-11-2.tcore2.AEQ-Ashburn.as6453.net (216.6.87.137)  68.125 ms  69.242 ms if-ae-14-14.thar2.NJY-Newark.as6453.net (66.198.111.125)  67.023 ms
11  if-ae-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)  67.213 ms  67.326 ms  69.655 ms
12  if-ae-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)  56.081 ms 66.198.155.2 (66.198.155.2)  64.697 ms if-ae-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)  47.116 ms
13  66.198.155.2 (66.198.155.2)  46.881 ms te0-6-0-1-grtjaxtw1.net.telefonicaglobalsolutions.com (176.52.249.141)  71.706 ms te0-7-0-2-grtjaxtw1.net.telefonicaglobalsolutions.com (176.52.251.203)  80.713 ms
14  te0-6-0-5-grtjaxtw1.net.telefonicaglobalsolutions.com (84.16.15.199)  75.481 ms telconet_te-0-0-0-36-grtjaxtw1.net.telefonicaglobalsolutions.com (213.140.39.109)  139.924 ms  150.283 ms
15  telconet_te-0-0-0-36-grtjaxtw1.net.telefonicaglobalsolutions.com (213.140.39.109)  147.605 ms * *
16  * 186.3.125.54 (186.3.125.54)  149.461 ms  171.109 ms
17  * * *

18  217.191-100-28.etapanet.net (191.100.28.217)  178.335 ms * *

[root@nuc12-i7 ~]# firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='188.40.95.70' reject"

[root@nuc12-i7 ~]# firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='191.100.28.217' reject"

Total Pageviews

Followers