This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get current dir | |
DIR=$(pwd) | |
# echo it out to make sure user is in the right place | |
echo $DIR | |
# What do you want to install 4.2 or latest | |
read -p "Laravel? 4.2 or Latest ? (1/2) " -n 1 -r && echo "" | |
if [[ $REPLY =~ ^[1]$ || ! $REPLY ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script makes zips of dirs in current dir if there is no zips in the dir | |
echo "" #Insert a break before any output | |
for D in *; do | |
if [ -d "${D}" ]; then # Check if dir | |
zip="$(echo $D | tr '[A-Z]' '[a-z]')" # Place letters with over cases | |
if [ -f "${D}/${zip}.zip" ]; then # Check to if there is a zip in the folder | |
# echo "found ${D}/${zip}.zip" # Tell users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Fixing perissions for files and folders." | |
find . -type f -name '*.php' -exec chmod 600 {} \; | |
find . -type f -name '*.html' -exec chmod 644 {} \; | |
find . -type f -name '*.htm' -exec chmod 644 {} \; | |
find . -type f -name '*.xml' -exec chmod 600 {} \; | |
find . -type f -name '*.css' -exec chmod 755 {} \; | |
find . -type f -name '*.less' -exec chmod 644 {} \; | |
find . -type f -name '*.js' -exec chmod 644 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm /var/lib/apt/lists/* -vf | |
apt-get clean | |
apt-get -y autoremove | |
apt-get -y update | |
apt-get -y dist-upgrade | |
apt-get clean | |
cd /var/lib/apt | |
mv lists lists.old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is not finished. I made this back in late 2014 and forgot to finish it if you find anything helpful atleast someone got one use out of it | |
# Quick note this will make a screen and the screen will be named after the folder where this bash script has been excuted from | |
# What jar | |
# The jar usaged to start the server | |
jar="*.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for file sizes | |
# 19456000 = 19GB | |
# Random find on hard drive might not work | |
SPACE= df -P . | tail -1 | awk 'CHECK=$4'; | |
S=df -P $PWD | awk 'NR==2{print $4}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$thisDayNo = Carbon::now()->day; | |
$thisMonthNo = Carbon::today()->month; | |
$nextMonthNo = $thisMonthNo+1; | |
if($nextMonthNo > 12) | |
$nextMonthNo = 1; | |
$ClientBirthday = Client::whereNull('serviceEndDate') // make sure their still in contract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set timeout | |
var tid = setTimeout(idleCheck, 5000); | |
function idleCheck() { | |
$.ajaxSetup({ | |
headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') } | |
}); | |
$.ajax({ | |
type: "post", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// where has relation and key - value | |
// OR | |
// doesnt have a relation | |
->where(function($query){ | |
$query->whereHas('report', function($q){$q->where('accepted', '<=', '0');}) | |
->orWhereHas('report', function($q){$q;}, '<', 1); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## I need a way of checking if screen issue | |
# To re-create the issue simply su a user | |
### | |
# root@local:~# sudo su john | |
# john@local:/root$ screen -l | |
#ISSUE-> Cannot open your terminal '/dev/pts/0' - please check. |
OlderNewer