Skip to main content

in1.lt – All in one about IT

Tag: script

Powershell check file expiration

2017-08-282017-08-28 gintautas

I need script for file modify time check and if date older, file will be deleted and send report to my email : Read More

Shell script to watch the disk space

2016-01-062016-01-06 gintautas

Find out the percentage of space:
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'
Output:

71% /dev/hdb1
98% /dev/hdb5

Read More

Direct ssh access between two unix system/access two unix system without password

2015-06-072015-06-07 gintautas
if [ -z “$1″ ]; then
echo “usage: ssh-uploadkeys user@host”
else
if [ -e “$HOME/.ssh/id_dsa.pub” ]; then
echo “SSH public key found: ~/.ssh/id_dsa.pub”
else
echo -e ‘\n\n’|ssh-keygen -t dsa -N ”
fi
cat ~/.ssh/id_dsa.pub| \
ssh $1 ‘cat > tero-authorized_keys && mkdir -p $HOME/.ssh/ && chmod 0700 $HOME
/.ssh/ && cat tero-authorized_keys >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys && rm tero-authorized_keys && echo “Success, next time you do not need to type password.”||echo “SSH key generation or upload failed.”‘
fi

Categories

  • Be kategorijos
  • Linux
  • Websites
  • Windows

Recent Posts

  • firewalld – managing firewall from command line
  • Cockpit – remote management tools
  • How to install qbittorrent-nox [Note]
  • Install Samba on Raspberry PI
  • Raspberry Pi Media Server – MiniDLNA

Archives

  • February 2021
  • December 2020
  • September 2020
  • June 2020
  • April 2020
  • February 2019
  • January 2019
  • November 2018
  • October 2018
  • September 2018
  • July 2018
  • January 2018
  • December 2017
  • November 2017
  • August 2017
  • April 2017
  • September 2016
  • August 2016
  • July 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
sparkling Theme by Colorlib Powered by WordPress