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 / 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 May 23, 2023 16:29
a relatively simple 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>"
#i.e. setconf.sh /etc/datadog/datadog.yaml
#first things first!
function replace-line-in-file() {
local file="$1"
@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
@LoganGray
LoganGray / prep.sh
Last active February 23, 2018 21:07
laravel 5.5 install on vagrant scotch box pro nginx (feb 2018)
composer self-update
sudo chown -R $USER:$USER $HOME/.composer
composer global require "laravel/installer"
composer create-project laravel/laravel proj_name_here "5.5"
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
#need?
sudo dpkg-reconfigure tzdata
@LoganGray
LoganGray / Laravel PHP7 LEMP AWS.md
Last active October 25, 2017 00:06 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu 16

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip