Archive for the ‘Uncategorized’ Category

SSH tricks

May 27, 2019

Check SSH configuration
sshd -t

Show active SSH connections
lsof -i -n | egrep '\<ssh\>'

Script to keep alive SSH connection with varying IP:

#!/bin/bash

if [ -z "$(ps ax | awk '{print $9}' | grep 2200:svarm:2200)" ]
then
ssh -N -f -R 2200:svarm:2200 -p 2222 mynetwork.net
fi

Establish SSH tunnel to DB on background, save its PID and kill it afterwards:

#!/bin/bash

ssh  -N -L 3333:db.myserver.com:3306 jump-host &
pid=$!
do something
kill -9 $pid

 

 

 

 

Install mono, dotnet, octo.exe on Amazon Linux

October 23, 2017

# mono
yum install yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --enable http://download.mono-project.com/repo/centos/
wget http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-1.fc28.x86_64.rpm
yum install -y libpng15-1.5.30-1.fc28.x86_64.rpm
yum install -y mono
#yum install -y mono-devel
#yum install -y mono-complete

# dotnet
mkdir /opt/dotnet
cd /opt/dotnet/
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl=https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'
sudo yum -y update
sudo yum -y install libunwind libicu
#sudo yum -y install dotnet-sdk-2.0.0
wget ftp://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/o/openssl-libs-1.1.0f-9.fc27.x86_64.rpm
rpm -i --replacefiles openssl-libs-1.1.0f-9.fc27.x86_64.rpm
sudo yum install dotnet-sdk-2.0.0

# octo.exe
mkdir /opt/octopus
cd /opt/octopus
wget https://download.octopusdeploy.com/octopus-tools/4.24.2/OctopusTools.4.24.2.rhel.7-x64.tar.gz
tar -xvzf OctopusTools.4.24.2.rhel.7-x64.tar.gz
ln -s /opt/octopus/Octo /usr/bin/octo.exe

First entry

February 29, 2008

I am a software developer for about 8 years. Now I mostly do Java/J2EE and I love this language and the environment. I started this blog to write short articles about software development, IT career, various tips and tricks for Java and associated technologies.