This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
service=$@ | |
/bin/systemctl -q is-active "$service.service" | |
status=$? | |
if [ "$status" == 0 ]; then | |
echo "OK" | |
else | |
/bin/systemctl start "$service.service" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |