четверг, 29 сентября 2016 г.

Ansible change line in file on remote hosts


  If you want to change some line in some file (for exampe it would be /etc/environment and line that beginning from JAVA_HOME  ) on group of hosts with ansible you should use the next playbook:

---
- hosts: PCPool
  sudo: yes
  tasks:

    - name: Change line
      lineinfile: dest=/etc/environment regexp='^JAVA_HOME' line=JAVA_HOME="/usr/lib/jvm/java-8-oracle"


where hosts - group of hosts from ansible file hosts
          ineinfile - module of ansible

and in console you should use the next command:

 ansible-playbook change_line.yml -k --user=USER --ask-sudo-pass


if you want to chek the results:

ansible PCPool -u agent -k -m shell -a 'less /etc/invironment'

среда, 7 сентября 2016 г.

VSphere Client Windows 10 installation issues

If you have troubles with installing VSphere Client on Windows 10 with error "....NET 3.5 Framework..." you should to run this command where "E" you image with Windows 10.

DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs

пятница, 2 сентября 2016 г.

Charles proxy Windows 10 issue


If you want to debug your application with Charles proxy on Windows 10 but Charles wont show connections from your application you should use Windows Loopback Exemptions Manager ( https://loopback.codeplex.com/ ) and add your application as Checked.

среда, 22 июня 2016 г.

TeamCity Host key verification failed error

TeamCity Build step failed- the error was:

 [Step 5/7] Host key verification failed.
[Step 5/7] fatal: The remote end hung up unexpectedly
 
To fix this you should run the next command on build agent:
 
git ls-remote -h ssh://git@URL_OF_STASH/PATH_TO_FILE.git
 
and type yes to add your stash server to known hosts.

четверг, 7 апреля 2016 г.

Installing Oracle java on Ubuntu 14.04

Steps to install Oracle java on Ubuntu 14.04


sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
 
#install java 8
sudo apt-get install oracle-java8-installer
 
#show installed version of java 
update-alternatives --config java 
 
nano /etc/environment
JAVA_HOME="YOUR_PATH"
 
source /etc/environment
echo $JAVA_HOME  
 
 
change default version of java in your system
update-alternatives --config java 
 
or by the next bash script 

#/usr/bin/sh
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

#install java 8

sudo apt-get install oracle-java8-installer


#show installed version of java

echo 'JAVA_HOME="/usr/lib/jvm/java-8-oracle"' >> /etc/environment

source /etc/environment

echo $JAVA_HOME
echo "!!!ALL DONE!!!"

четверг, 31 марта 2016 г.

VPN bat script

The following script make connection with vpn server with preconfigured windows connection with ConnectionName, MyUsername and password MyP@ssw0rd . And adding static route to NetSubnet with SubnetMask :

 ---------------------------------------------------------------------------------------------------------

@ECHO OFF
COLOR 8F
SET NetSubnet=192.168.0.0
SET SubnetMask=255.255.255.0
ECHO.
ECHO ###########################################################
ECHO            PLEASE DO NOT CLOSE THIS WINDOW     
ECHO This window will automatically disappear after 20 seconds.
ECHO ###########################################################
ECHO.
ECHO Dialing VPN, please wait....
RASDial ConnectionName MyUsername MyP@ssw0rd
ECHO.
ECHO Obtaining IP Address, please wait....
PING 127.0.0.1 -n 15 -l 0 -w 0 >NUL
SET cWMIC=WMIC NICCONFIG WHERE "ServiceName='NdisWan'" GET IPAddress /FORMAT:CSV
FOR /F "tokens=2 delims=,{}" %%i IN (' %cWMIC% ^|FIND "."') DO SET IPAddress=%%i
ECHO Obtained IP address: %IPAddress%
ECHO.
ECHO Updating Routing Table, please wait....
ECHO.
ROUTE DELETE %NetSubnet% >NUL
ROUTE ADD %NetSubnet% MASK %SubnetMask% %IPAddress% METRIC 1
ROUTE PRINT %NetSubnet%
PING -n 5 -w 1 -l 1 127.0.0.1 >NUL
EXIT /B 0

пятница, 26 февраля 2016 г.

Windows 10 Home to Windows 10 Pro


Problem begun when our company brought laptop with Windows 10 Home on board but we should use our corporate Windows 10 Pro. But you cant do this because your laptop have firmwared with your personal Windows 10 Home key.

The solution is simple. You shoud change your key on laptop to the next generic key VK7JG-NPHTM-C97JM-9MPGT-3V66T . After that, laptop will do upgrade to Windows 10 Pro. And in the ending, you can activate your laptop with your corporate key.