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 | |
# Get the current hour in local time | |
current_hour_local=$(date +%H) | |
# Check if the current time is before 7 AM or after 5 PM | |
if [ "$current_hour_local" -lt 7 ] || [ "$current_hour_local" -ge 17 ]; then | |
# Run cec-client and capture the power status of the TV | |
power_status=$(echo 'pow 0' | cec-client -s -d 1 | grep 'power status' | awk '{print $3}') |
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
<?php //=============================Survey Modal======================= | |
if(is_null($_COOKIE['pcsd-chocochip'])){ ?> | |
<div id="modalcontrols"> | |
<h2>Bottom Modal</h2> | |
<!-- Trigger/Open The Modal --> | |
<button id="myBtn">Open Modal</button> | |
<!-- The Modal --> | |
<div id="myModal" class="modal"> |
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 | |
# Creates backup folder if it doesn't exist | |
mkdir -p /home/pi/backup; | |
# Moves files to home backup folder | |
rsync -av --delete /etc/snmp/ /home/pi/backup/snmp | |
rsync -av --delete /usr/local/bin/ /home/pi/backup/usrlocalbin | |
rsync -av --delete /etc/rc.local /home/pi/backup/rc.local | |
rsync -av --delete /boot/config.txt /home/pi/backup/config.txt |
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/sh | |
# | |
# Define the IP address variable | |
IP_ADDRESS="158.91.1.124" | |
# Runs apt upgrade, dist-upgrade, autoclean, autoremove, and reboots the VM | |
ssh webadmin@$IP_ADDRESS -t 'sudo /home/webadmin/update.sh' | |
# Ping the IP address | |
ping $IP_ADDRESS |
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 | |
# Append IPv6 disable configuration to /etc/sysctl.conf | |
echo "net.ipv6.conf.all.disable_ipv6=1 | |
net.ipv6.conf.default.disable_ipv6=1 | |
net.ipv6.conf.lo.disable_ipv6=1" | sudo tee -a /etc/sysctl.conf > /dev/null | |
# Apply the changes | |
sudo sysctl -p |
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
docker run --rm -v C:\Users\Joshe\OneDrive\Documents\docker\laravel:/app composer create-project --prefer-dist laravel/laravel myapp |
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 | |
hs=$HOSTNAME | |
# Trap interrupts and exit instead of continuing the loop | |
trap "echo Exited!; exit;" SIGINT SIGTERM | |
MAX_RETRIES=10 | |
i=0 | |
# Set the initial return value to failure |
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
<?php | |
// Start “The Loop” | |
if ( have_posts() ) : // Does our website have any posts to display? | |
while ( have_posts() ) : the_post(); // If the answer is “yes”, let’s run some code. | |
the_title( '<h2>', '</h2>' ); // Let’s display the title of our post. | |
the_content(); // Let’s display the content of our post. |
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="chromium" | |
if pgrep "$SERVICE" > /dev/null | |
then | |
echo "$SERVICE is running" | |
#for SNMP | |
echo "0" | |
else | |
echo "$SERVICE stopped" | |
#for SNMP |
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 | |
sudo apt update --fix-missing -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y && sudo shutdown -r now |
NewerOlder