Skip to main content

Search file with word list fast

0 likes • Feb 22, 2022 • 1 view

More Shell Posts

0 likes • Nov 8, 2021 • 0 views
#Installs the Vulkan library and other goodies. Works on Arch and Arch based distros. Needs pacman and makepkg
#Tries installing every linux package in existence
packages=( vulkan-tools libvulkan-dev vulkan-loader-devel vulkan-validation-layers spirv-tools mesa-vulkan-devel vulkan-validation-layers-devel )
for package in ${packages[*]}; do
sudo pacman --noconfirm -S $package
#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
sudo git clone /tmp/glfw-git
sudo chmod 777 /tmp/glfw-git
cd /tmp/glfw-git
makepkg -si
sudo git clone /tmp/glm-git
sudo chmod 777 /tmp/glm-git
cd /tmp/glm-git
makepkg -si
#Basically installs glslc
sudo pacman -S shaderc
while true; do
select bruh in installVulkan installLibraries installShaderCompiler "exit"; do

0 likes • Sep 9, 2023 • 2 views
#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 console
REPO_URL=$(git config --get remote.origin.url)
# Check that REPO_URL contains
if [[ $REPO_URL == *""* ]]; then
# Replace https with ssh in the URL
REPO_URL=${REPO_URL/https:\/\/\//[email protected]:}
# Change the remote URL to the SSH version
git remote set-url origin "$REPO_URL"
echo "Error: REPO_URL does not contain" >&2
exit 1

0 likes • Nov 14, 2021 • 0 views
#Takes all the c and h files in the current directory and prints them
#Yup, it's that easy
for file in *.h *.hpp *.c *.cpp; do
#If it exists
if [ -f "$file" ]; then
echo "//===============$file==============="
cat $file

0 likes • Jan 12, 2023 • 0 views
#Originally made by Isaac Cook
#Modified by Leif Messinger [server_ip [server2_ip [...]]]
#To be run locally on a linux computer
if [ -e ~/.ssh/ ];
echo "SSH Key already exists on local machine"
echo "Generating SSH key on local machine"
ssh-keygen -t rsa #generates id_rsa and
chmod -R 700 ~/.ssh #Sets permissions of ssh folder
ssh-add #Adds keys (and passwords?) to ssh_agent. (hopefully doesn't require password)
echo "Loading client public key into memory"
for server
echo "Adding client public key to $server remote server authorized keys"
#Idiot Isaac Cook didn't know about ssh-copy-id
#ssh-copy-id even checks if your key already exists
#In fairness, I didn't either until researching ssh-add
ssh-copy-id -i ~/.ssh/ $server #In theory, this should prompt for a username
#ssh $server "mkdir -p ~/.ssh; #Make the folder if not already made
# echo \"$pubKey\" >> ~/.ssh/authorized_keys; #Append your public key to the server's authorized_keys
# chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" #Set the correct permissions of those files
#echo "Adding server public key to local authorized keys"
#ssh $server "ssh-copy-id -i ~/.ssh/ \$SSH_CLIENT" #this might need some awk, as $SSH_CLIENT spits out clientip portnumber
echo "Displaying server public key"
ssh $server "cat ~/.ssh/"
#Though, he did give me a good idea
echo "Displaying keys authorized on $server (you can paste them in your authorized_keys file)"
ssh $server "cat ~/.ssh/authorized_keys"
#echo "Appending keys authorized on $server to your local authorized_keys"
#ssh $server "cat ~/.ssh/authorized_keys" >> ~/.ssh/authorized_keys
echo "SSH keys schronized successfully!"

0 likes • Sep 30, 2021 • 0 views
touch /tmp/login1.txt /tmp/login2.txt
while [ true ]
who | gawk '{ print $1 }' > /tmp/login2.txt
comm -13 /tmp/login1.txt /tmp/login2.txt
#Just a bit easier to read
#diff /tmp/login1.txt /tmp/login2.txt
cat /tmp/login2.txt > /tmp/login1.txt
sleep 1

Nginx Serve Storybook

0 likes • Oct 17, 2023 • 10 views
# ---------------- FIREWALL STEPS ----------------
# Check if firewalld is installed and running
sudo systemctl status firewalld
# If it's not running, you can start and enable it
sudo systemctl start firewalld
sudo 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 effect
sudo firewall-cmd --reload
# Check the list of allowed ports
sudo firewall-cmd --list-ports
# ---------------- NGINX STEPS ----------------
# Install Nginx (if not already installed)
sudo yum install nginx
# Start and enable Nginx
sudo systemctl start nginx
sudo 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 files
sudo chown -R nginx:nginx /usr/share/nginx/html/storybook-static
# Put the following server block in /etc/nginx/conf.d/storybook.conf
server {
listen 6006;
location / {
root /usr/share/nginx/html/storybook-static;
index index.html;
# Test the Nginx configuration for syntax errors
sudo nginx -t
# If there are no errors, reload Nginx to apply the changes
sudo systemctl reload nginx