Loading...
More Shell Posts
# ---------------- FIREWALL STEPS ----------------# Check if firewalld is installed and runningsudo systemctl status firewalld# If it's not running, you can start and enable itsudo systemctl start firewalldsudo systemctl enable firewalld# Add a rule to allow traffic on port 6006. Port 6006 is the default port that storybook runs on.sudo firewall-cmd --permanent --add-port=6006/tcp# Reload the firewall for the changes to take effectsudo firewall-cmd --reload# Check the list of allowed portssudo firewall-cmd --list-ports# ---------------- NGINX STEPS ----------------# Install Nginx (if not already installed)sudo yum install nginx# Start and enable Nginxsudo systemctl start nginxsudo systemctl enable nginx# Copy your storybook-static directory to a location that Nginx can serve from.# The default web root directory for Nginx is /usr/share/nginx/html.sudo cp -r /path/to/storybook-static /usr/share/nginx/html/# Adjust file permissions if needed to ensure that Nginx can read the filessudo chown -R nginx:nginx /usr/share/nginx/html/storybook-static# Put the following server block in /etc/nginx/conf.d/storybook.confserver {listen 6006;server_name your_domain.com;location / {root /usr/share/nginx/html/storybook-static;index index.html;}}# Test the Nginx configuration for syntax errorssudo nginx -t# If there are no errors, reload Nginx to apply the changessudo systemctl reload nginx
#!/bin/bash#Changes the remote url from https to ssh.#Only works for github, because I'd have to store a dictionary of every https to ssh url otherwise.#Made using Bing Chat# Get the remote URL from the consoleREPO_URL=$(git config --get remote.origin.url)# Check that REPO_URL contains https://github.comif [[ $REPO_URL == *"https://github.com"* ]]; then# Replace https with ssh in the URL# Change the remote URL to the SSH versiongit remote set-url origin "$REPO_URL"elseecho "Error: REPO_URL does not contain https://github.com" >&2exit 1fi
#for ssh abuse attemptsaction = %(action_)s%(action_abuseipdb)s[abuseipdb_apikey="", abuseipdb_category="18,22"]actionban = curl --fail --ciphers ecdhe_ecdsa_aes_256_sha --data 'key=<abuseipdb_apikey>' --data-urlencode 'comment=<matches>' --data 'ip=<ip>' --data 'category=<abuseipdb_category>' "https://www.abuseipdb.com/report/json"
#!/bin/bash#Installs the Vulkan library and other goodies. Works on Arch and Arch based distros. Needs pacman and makepkginstallVulkan(){#Tries installing every linux package in existencepackages=( vulkan-tools libvulkan-dev vulkan-loader-devel vulkan-validation-layers spirv-tools mesa-vulkan-devel vulkan-validation-layers-devel )for package in ${packages[*]}; dosudo pacman --noconfirm -S $packagedone}installLibraries(){#All of these packages don't exist, so we have to download and install the AUR packages#packages=( libglfw3-dev glfw-devel libglm glm-devel )#for package in ${packages[*]}; do# sudo pacman --noconfirm -S $package#donesudo git clone https://aur.archlinux.org/glfw-git.git /tmp/glfw-gitsudo chmod 777 /tmp/glfw-gitcd /tmp/glfw-gitmakepkg -sisudo git clone https://aur.archlinux.org/glm-git.git /tmp/glm-gitsudo chmod 777 /tmp/glm-gitcd /tmp/glm-gitmakepkg -si}installShaderCompiler(){#Basically installs glslcsudo pacman -S shaderc}while true; doselect bruh in installVulkan installLibraries installShaderCompiler "exit"; do$bruhdonedone
#!/bin/bash#cpcmd.sh [file1 [file2...]]#Prints out the commands needed to copy the file to your local machine#This will work on any server that also has the same hostname as in your hosts file.#I should update this to detect if a file is a directory, and enable recursion for those commands. If you do it now, it will probably just warn you.if [ -n "$1" ]; thenwhile [ -n "$1" ]; doprintf "scp \"$(whoami)@$(hostname):"printf `readlink -f $1`printf "\" .\n"shiftdoneelseecho "scp \"$(whoami)@$(hostname):$PWD/*\" ."fi#-----------EDIT:#On the UNT cell machines, you have to do this script instead#if [ -n "$1" ]; then# while [ -n "$1" ]; do# printf "scp $(whoami)@$(hostname).eng.unt.edu:"# printf `readlink -f $1`# printf " .\n"# shift# done#else# echo "scp $(whoami)@$(hostname).eng.unt.edu:$PWD/* ."#fi
CLIENT_VPN_ID="cvpn-endpoint-xxxxxxxxxxxx"for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); doecho "Searching in region: $region"aws ec2 describe-client-vpn-endpoints --region $region --query "ClientVpnEndpoints[?ClientVpnEndpointId=='$CLIENT_VPN_ID']" --output tabledone