Skip to content

Instantly share code, notes, and snippets.

View LoganGray's full-sized avatar
🎯
Focusing

Logan Gray LoganGray

🎯
Focusing
View GitHub Profile
@LoganGray
LoganGray / install_laravel_requirements.sh
Last active September 26, 2024 21:26
laravel 2024 setup on Linux Dev box - this'll basically install all the standard stuff. with option to install DB
#!/bin/bash
# Update package list
sudo apt update
# Install PHP and required extensions
sudo apt install -y php php-cli php-fpm php-json php-common php-zip php-gd php-mbstring php-curl php-xml php-bcmath
# Install Composer
curl -sS https://getcomposer.org/installer | php
#!/bin/bash
# set -x
if [ -n "$SUDO_USER" ]; then
echo "Hello $SUDO_USER!!"
elif [ "$EUID" -eq 0 ]; then
echo "This script should NOT be run as root, please run it as a regular user with sudo."
exit 1
else
echo "Please run as a regular user with sudo."
@LoganGray
LoganGray / tailscale.sh
Created November 16, 2023 20:27
tailscale install for steam deck - ref: https://tailscale.com/blog/steam-deck/
#!/usr/bin/env bash
# script originally from https://tailscale.com/blog/steam-deck/ 11/16/2023
set -euo pipefail
dir="$(mktemp -d)"
pushd .
cd "${dir}"
tarball="$(curl 'https://pkgs.tailscale.com/stable/?mode=json' | jq -r .Tarballs.amd64)"
version="$(echo ${tarball} | cut -d_ -f2)"
@LoganGray
LoganGray / setconf.sh
Last active September 27, 2024 01:29
a somewhat supercharged configuration changer/add-er. If someone out there knows something better - please let me know! ;) Seems like this should already exist
#!/bin/bash
#set-conf bash thing
# for setting a configuration setting in a file defaulting with a : colon assignment
# and adds the setting if it doesn't find it.
#
#setconf <filepath&name> "string" "<setting>" [-y]
#i.e. setconf.sh /etc/datadog/datadog.yaml "api_key" "your_api_key_here" -y
# Color and formatting definitions
RED='\033[0;31m'
@LoganGray
LoganGray / starship.toml
Created February 13, 2023 19:50
starship.toml - config file to be placed inside user directory for starship.rs (~/.config/starship.toml ) - adds user on hostname
[username]
style_user = 'white bold'
style_root = 'black bold'
format = 'u: [$user]($style) '
disabled = false
@LoganGray
LoganGray / KioskChanger.ps1
Last active December 15, 2022 23:02
kiosk parameter change
#kiosk display timeout
$user = "Kiosk"
$Parm2change = "kiosk-idle-timeout-minutes"
$Parm2changeNewValue ="5"
$Sid = (Get-LocalUser -Name $user).SID.Value
#this part not really relevant - but interesting to return to compare
$version = (Get-ComputerInfo | Select-Object OsBuildNumber).OsBuildNumber
@LoganGray
LoganGray / install-toolbox.sh
Last active April 27, 2021 03:52 — forked from greeflas/install-toolbox.sh
JetBrains Toolbox installation script for Ubuntu - https://www.jetbrains.com/toolbox/app/
#!/bin/bash
#TODO: check user is NOT root or sudo
set -e
if [ -d ~/.local/share/JetBrains/Toolbox ]; then
echo "It appears that JetBrains Toolbox is already installed! Starting..."
if [ ! -e /usr/local/bin/jetbrains-toolbox ]; then
sudo ln -s ~/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox /usr/local/bin/jetbrains-toolbox
@LoganGray
LoganGray / chromeinstall_ubu16.sh
Last active June 6, 2023 14:35
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04, 20.04.1 LTS desktop, Jan 2021
# also tested and works on Elem OS 5.1 :)
#
# make sure script is run as root or sudo
if [[ $(whoami) != "root" ]] ; then
echo ; echo "This script, $0, SHOULD be run as ROOT. " ; echo
exit 1
fi
#
@LoganGray
LoganGray / sql_from_form.php
Last active November 30, 2018 22:07
Creates basic SQL script of a table based on a form post
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.0/themes/prism.min.css">
</head>
<body>
<pre>
<?php var_dump($_POST);
$xx = count($_POST);
@LoganGray
LoganGray / mysql-drop-all-tables.sh
Created July 24, 2018 21:32 — forked from cweinberger/mysql-drop-all-tables.sh
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in