This file contains 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
# This file must be used with "source bin/activate" *from bash* | |
# you cannot run it directly | |
deactivate () { | |
# reset old environment variables | |
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then | |
PATH="${_OLD_VIRTUAL_PATH:-}" | |
export PATH | |
unset _OLD_VIRTUAL_PATH | |
fi |
This file contains 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
version: "3.9" | |
services: | |
jupyter: | |
image: jupyter/scipy-notebook | |
ports: | |
- "8888:8888" | |
# volumes: | |
# - ./notebooks:/home/jovyan/ | |
environment: |
This file contains 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
status="$(systemctl is-active Services_Name])" | |
if [ "$status" = "active" ]; then | |
echo "Services_Name 1" | curl --data-binary @- http://localhost:9091/metrics/job/Pushgateway/instance/compute-01 | |
else | |
echo "Service_Name 0" | curl --data-binary @- http://localhost:9091/metrics/job/Pushgateway/instance/compute-01 | |
exit 1 | |
fi |
This file contains 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 -e | |
# Port scanner with Bash | |
# Author: Ridwan_G4 | |
# Bash Color | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
YELLOW='\e[1;33m' | |
WHITE='\e[1;37m' | |
PURPLE='\e[0;35m' |
This file contains 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 | |
# ping | |
echo " " | |
echo Mengirim Ping ! | |
echo "Tanggal : $(date)" | |
echo " " | |
cat node.txt | while read output | |
do | |
ping -c 1 $"output" > /dev/null | |
if [ $? -eq 0 ]; then |
This file contains 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 | |
HOSTS="host1 host2 host3 host4" | |
RETENTION_TIME=14 | |
echo "$(date) - Log Cleaner - $RETENTION_TIME days - $HOSTS" >> /var/log/hadoop_log_cleaner.log | |
for host in $HOSTS | |
do | |
ssh root@$host << ENDSSH |
This file contains 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
## Create file "server.txt" | |
## then write all the server addr, and import ssh key to all server. | |
# example | |
for i in `cat server.txt`; do ssh root@${i} "Try Linux command"; done | |
# Check status SELinux | |
for i in `cat server.txt`; do ssh root@${i} "hostname && sestatus"; done | |
# Check IP Address |
This file contains 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
#cloud-config | |
users: | |
- default | |
- name: user-01 | |
gecos: Regular user | |
sudo: ["ALL=(ALL) NOPASSWD:ALL"] | |
groups: wheel | |
chpasswd: | |
list: | | |
root:p@ssw0rd! |