Skip to content

Instantly share code, notes, and snippets.

View yakaviuk's full-sized avatar

Ilya Yakaviuk yakaviuk

  • Vilnius, Lithuania
View GitHub Profile
@yakaviuk
yakaviuk / Check_vestcp_version
Created May 30, 2020 10:02
check_vestcp_version.sh
#!/bin/bash
#vestapc version checker
#beta script
# Checking installed vesta version
if [ -d "/etc/sysconfig" ]; then
rpm_format="VERSION='%{VERSION}'"
rpm_format="$rpm_format RELEASE='%{RELEASE}'"
rpm_format="$rpm_format ARCH='%{ARCH}'"
rpm_format="$rpm_format UTIME='%{INSTALLTIME}'\n"
#!/bin/bash
a=`free -m | grep Mem | awk '{print $3}'`
b=`date | awk '{print $2,$3,$4}'`
c=`cat /proc/loadavg`
echo $a $b >> /home/user/ram_monitoring
echo $b $c >> /home/user/cpu_monitoring
#!/bin/bash
service=$@
/bin/systemctl -q is-active "$service.service"
status=$?
if [ "$status" == 0 ]; then
echo "OK"
else
/bin/systemctl start "$service.service"
fi
@yakaviuk
yakaviuk / Check jdk version
Created March 1, 2020 09:01
Check jdk version
You're looking for this on the command line (for a class called MyClass):
On Unix/Linux:
$ javap -verbose MyClass | grep "major"
On Windows:
$ javap -verbose MyClass | findstr "major"
You want the major version from the results. Here are some example values:
@yakaviuk
yakaviuk / Version.java
Created March 1, 2020 08:56
Check Java Version
public class Version {
public static void main(String[] args) {
// System.out.println("Enter your name");
// Scanner scan = new Scanner(System.in);
int a, n;
n = args.length;
for (a = n-1; a > -1; a--) {
System.out.println(args[a]);}
String version = Runtime.class.getPackage().getImplementationVersion();
System.out.println(version);