Skip to content

Instantly share code, notes, and snippets.

@miaoles
miaoles / main.odin
Last active October 28, 2024 12:16
vulkan-tutorial.com Triangle with Odin
// vulkan-tutorial.com Triangle with Odin
// also has personal tweaks/additions, explicit naming, entire enum names
package main
import fmt "core:fmt"
import math "core:math"
import os "core:os"
import str "core:strings"
import glfw "vendor:glfw"
#!/bin/bash
CURRENTDATE=$(date +"%m-%d-%Y")
sudo mkdir /home/miles/backup/$CURRENTDATE
sudo tar czf /home/miles/backup/$CURRENTDATE/backup.tar.gz /home/*
#!/bin/bash
CONTINUE=false
USERNAME=null
GROUPNAME=null
check_username () {
if [ id -u "$USERNAME" >/dev/null 2>&1 ]; then
echo 'This user already exists.'
CONTINUE=false
#!/bin/bash
CONTINUE=true
main_menu () {
echo "Enter the letter for one of the following options:"
echo "1. Display today's date and time."
echo "2. Display first 5 lines of top command's output."
echo "3. Display a list of who is logged in."
echo "4. Display disk usage for /home/admin in human readable format."
#!/bin/bash
PASSWORD='pa$$w0rd'
for name in $(cat users.txt); do
sudo mysql> CREATE DATABASE '$name'
sudo mysql> CREATE USER '$name'@'localhost' identified by '${PASSWORD}';
sudo mysql> GRANT ALL PRIVILEGES ON ${name}.* TO '$name'@'localhost' IDENTIFIED BY '${PASSWORD}'
echo "User $name created with password $PASSWORD with database $name"
done
#!/bin/bash
PASSWORD=pa$$w0rd
for name in $(cat users.txt); do
sudo mysql -u $name -p $PASSWORD create $name
echo "User $name with password $PASSWORD added to created database $name"
done
#!/bin/bash
CONTINUE=true
main_menu () {
echo "Enter the letter for one of the following options:"
echo "1. Display today's date and time."
echo "2. Display first 5 lines of top command's output."
echo "3. Display a list of who is logged in."
echo "4. Display disk usage for /home/admin in human readable format."
#!/bin/bash
CONTINUE=false
echo 'Enter the username for a new user:'
read USERNAME
check_username
if [ $CONTINUE = true ]; then
#!/bin/bash
CURRENTDATE==$(date +"%m-%d-%Y")
sudo mkdir /home/miles/backup/$CURRENTDATE
sudo tar zvf /home/miles/backup/$CURRENTDATE/backup.tar.gz /home/*
@miaoles
miaoles / ccm-miles.html
Created May 7, 2021 17:38
Just some thing.
<html>
<head><title>CMP255</title></head>
<body>
<h1>
Describe what you have learned about Linux. How much did you know about it before class started? Do you feel comfortable using it after the class? Explain.
</h1>
<p>
I had already been using Linux casually for awhile, but I gained a much better foundational knowledgebase for it in this class. I had known of some things from disparate sources but having a class to give me all the information from the ground up helped fill the knowledge gaps. Now I feel better going forward and learning more.
</p>
<h1>