Skip to content

Instantly share code, notes, and snippets.

View zachbrowne's full-sized avatar

Zach Browne zachbrowne

View GitHub Profile
# Clean up webserver permissions
alias fix='sudo find /var/www/* -type d -exec sudo chmod 755 {} \; && sudo find /var/www/* -type f -exec sudo chmod 644 {} \; && sudo chown -R www-data:www-data /var/www/*'
# Add User and Add to Sudo
adduser zach
usermod -a -G sudo exampleuser
CREATE DATABASE database;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
@zachbrowne
zachbrowne / .bashrc
Created August 27, 2016 04:27
Bash Pimping
# /etc/bash.bashrc
#
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
# Test for an interactive shell. There is no need to set anything
@zachbrowne
zachbrowne / index.html
Created August 26, 2016 14:14
The Ultimate Bad Ass VIM Cheat Sheet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>The Ultimate Bad Ass VIM Cheat Sheet by Zach Browne</title>
<meta name="viewport" content="width=device-width">
<meta name="description" content="The Ultimate Bad Ass VIM Cheat Sheet">
<link rel="canonical" href="http://zachbrowne.me/">
apt update; apt -y upgrade; apt -y install sudo nano wget curl git build-essential software-properties-common dnsutils
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
I solved this on 12.10 by editing /etc/gai.conf and uncommenting the line:
#
# For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96 100
# Problems in Fedora
touch /etc/modprobe.d/disableipv6.conf
###############################################################################################
# LAMP setup for Ubuntu 16.04 Server #
# Apache + PHP + Percona #
###############################################################################################
# Update and prepare server
apt update; apt -y upgrade
apt -y install nano sudo curl wget git dnsutils lynx
sudo hostname srv.zdb.bz
sudo service hostname start
#!/bin/bash
echo 'Checking for a new Java Version...'
kern_arch=$(uname -r | sed 's/.*-\(.*\)/\1/')
if [ "$kern_arch" = amd64 ]; then
java_ver=' x64'
fi
current_version=$(java -version 2>&1 >/dev/null | sed -n '1s/.*"\([^"]*\)"/\1/p')
latest_version_url=$(curl https://www.java.com/en/download/manual.jsp 2>/dev/null | grep -Po -m 1 "href=\"\K[^\"]*(?=.*Linux${java_ver} en JRE)"
)
latest_version=$(curl $latest_version_url 2>/dev/null | sed -n 's/.*File=jre-\([0-9]\)u\([0-9]\{2\}\).*/1.\1.0_\2/p')
@zachbrowne
zachbrowne / GoogleHackMasterList.txt
Created October 20, 2015 09:36 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www&#8221; domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
#!/usr/bin/env bash
## Update
sudo apt-get update && sudo apt-get upgrade -y
## Update Hostname
echo "server" > /etc/hostname
hostname -F /etc/hostname
## Update hosts File