Skip to content

Instantly share code, notes, and snippets.

View hex333ham's full-sized avatar
🥞
hankering for pancakes

Connor hex333ham

🥞
hankering for pancakes
  • UK
View GitHub Profile
@hex333ham
hex333ham / ubuntu-user-create-home-dir-bash.sh
Last active April 27, 2022 17:00
Create a sudo user on Ubuntu, with bash as their terminal and a home directory.
#!/bin/bash
echo "Enter Username: "
read varUname
if id "$varUname" &>/dev/null; then
echo 'User already exists, aborting.'
exit
fi
read -s -p "Enter a Password: " varPass
sudo useradd -m -s $(which bash) -G sudo "$varUname"
@hex333ham
hex333ham / rollimages.py
Created January 6, 2022 00:34
rollimages.py - Rolls a folder of images, randomly selecting one with or without a filter
# rollimages.py - Rolls a folder of images, randomly selecting one with or without a filter
# No License
# @hex333ham - GitHub
# CLI usage - rollimages.py [DIR] [FILTER]
# Alternatively, running the script will use file dialogues and input boxes to setup the roller
# Default Python3
import os
import sys
import random
@hex333ham
hex333ham / tetra-dark.css
Last active January 16, 2020 14:59
Tettra dark (Stylus)
html {
background: #1A1A1A !important;
}
/*----- DEFAULT TEXT, BORDER & BACKGROUND COLORS -----*/
* {
@hex333ham
hex333ham / apachecordovacheatsheet.md
Last active June 21, 2019 13:15
Apache Cordova cheat sheet
@hex333ham
hex333ham / Message.php
Last active May 5, 2019 15:14
Setup FOSMessageBundle testing env with FOSUserBundle
<?php
// src/App/Entity/Message.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use FOS\MessageBundle\Entity\Message as BaseMessage;
/**
@hex333ham
hex333ham / github-dark-fixes.css
Last active March 31, 2019 20:42
Stylus - Fixes issues with progress bars, new features and coloured tags.
body {
background-color: #222 !important;
background-clip: border-box !important;
background-origin: padding-box !important;
background-attachment: scroll !important;
background-repeat: repeat !important;
background-size: auto !important;
background-position: left top !important;
}
@hex333ham
hex333ham / gitprojectupdate.md
Last active April 10, 2019 10:53
Centos 6/7 LAMP update web (symfony, laravel etc.) project from git and sort permissions

PLEASE NOTE: not a definitive guide for prod environments, mostly just reference to quickly sort things on dev.

To get permissions right after an update, do the following:

cd /var/www/[DIRECTORY]
git reset --hard
git pull
composer install
sudo chmod -R 0775 ./*
@hex333ham
hex333ham / serversetup.md
Last active August 1, 2019 23:41
Centos 6/7 LAMP server setup

How to setup a Centos 6/7 LAMP server correctly (or at least how I do it, needs work).

To check the centos version and system info, do this:

hostnamectl

To check the full release version, do this:

rpm --query centos-release

@hex333ham
hex333ham / symfony4cheatsheet.md
Last active June 25, 2019 13:33
Symfony 4 cheat sheet