Skip to content

Instantly share code, notes, and snippets.

View onfire4g05's full-sized avatar

Justin Osborne onfire4g05

View GitHub Profile
@onfire4g05
onfire4g05 / gitea-upgrade.sh
Created November 5, 2019 21:14
Simple Gitea upgrade script
#!/bin/bash
VERSION=$1
FILE_NAME="gitea-$VERSION-linux-arm64"
FULL_PATH="https://dl.gitea.io/gitea/$VERSION/$FILE_NAME"
cd ./versions
wget $FULL_PATH
cd ..
rm ./gitea
chmod 0755 ./versions/$FILE_NAME
version: "2"
services:
plex:
container_name: plex
image: lsioarmhf/plex:latest
network_mode: "host"
environment:
PUID: 1001
PGID: 1001

Client and Server

netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes

Server

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Enable-NetFirewallRule -DisplayGroup "Windows Remote Management"
Set-NetFirewallRule -DisplayGroup 'Windows Management Instrumentation (WMI)' -Enabled true -PassThru
@onfire4g05
onfire4g05 / questions.md
Created May 7, 2015 21:14
Programming Questions
  1. What are your thoughts on TDD (Test Driven Development)?
  2. What coding standards do you follow (code formatting, unit testing, and any tools used like CI, PHPMD, etc)? What tool(s), if any, do you use to debug?
  3. Are you familiar with PHPDoc/JavaDoc standards?
  4. What is SQL injection? Please provide a code example that allows SQL injection and two ways that you can fix it using either mysqli or PDO.
  5. What data type is the following unfiltered query parameter:

index.php?page_id=3

What data type is $_GET['page_id']? How would you change this to another data type?

@onfire4g05
onfire4g05 / gist:2927dcaf38c3ba30ae91
Created September 17, 2014 20:37
Find Invalid PHP

Find parse errors in php code inside directory

Windows

Find-ChildItem -name .php -exec "c:\xampp\php53\php -l '{}' \;" > c:\xampp\htdocs\test.txt

No syntax errors detected(.*)$\r\n

Linux

find -name '*.php' -exec php -l '{}' \; | grep -v 'No syntax' > ~/php-errors.txt

@onfire4g05
onfire4g05 / Move files older than X days
Created March 7, 2014 20:15
Will move files based on time specified, keeping directory structure
find . -mtime +1786 -type f -print0 | xargs -0 -I {} sh -c '
file="{}"
destination="/var/shares/primary/backup-images"
mkdir -p "$destination/${file%/*}"
mv "$file" "$destination/$file"'