Skip to content

Instantly share code, notes, and snippets.

💭
root@localhost

Daniel Hansson enoch85

💭
root@localhost
Block or report user

Report or block enoch85

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View outlook.conf
# nginx@nginx:~$ cat /etc/nginx/sites-available/outlook.conf
server {
listen 192.168.128.2:80;
server_name yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 192.168.128.2:443;
View dhcp.sh
#!/bin/bash
# Tech and Me © - 2018, https://www.techandme.se/
# shellcheck disable=2034,2059
true
# shellcheck source=lib.sh
FIRST_IFACE=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
unset FIRST_IFACE
View test.sh
#!/bin/bash
# Tech and Me, ©2017 - www.techandme.se
#
# This install from Nextcloud official stable build with PHP 7, MySQL 5.7 and Apche 2.4.
# Ubuntu 16.04 is required.
# Check for errors + debug code and abort if something isn't right
# 1 = ON
# 0 = OFF
@enoch85
enoch85 / mysql_secure.sh
Last active Jan 19, 2018 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation for MySQL 5.7
View mysql_secure.sh
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@enoch85
enoch85 / lussh
Last active Nov 30, 2017 — forked from sbleon/lussh
lussh - script to authorize your SSH key on a server
View lussh
#!/bin/bash
# make sure to run this with /bin/bash, NOT /bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
View gist
Debugging bruteforce attack on en0ch.se
View install_apcu_4-0-6.sh
#!/bin/bash
#
# Tech and Me 2015 - https://www.en0ch.se
#
# This requires PHP 5.5
# Must be root
[[ `id -u` -eq 0 ]] || { echo "Must be root to run script, in Ubuntu type: sudo -i"; exit 1; }
# Print current version
@enoch85
enoch85 / install_apcu_4-0-7.sh
Last active Nov 1, 2018
Install APCu 4.0.7. This script requires PHP 5.6.
View install_apcu_4-0-7.sh
#!/bin/bash
#
# Tech and Me 2015 - https://www.en0ch.se
#
# This requires PHP 5.6
# Must be root
[[ `id -u` -eq 0 ]] || { echo "Must be root to run script, in Ubuntu type: sudo -i"; exit 1; }
# Print current version
View visitor-counter.sh
#!/bin/bash
#
# Tech and Me 2015 - https://www.en0ch.se
visitor="/var/log/nginx/access.log"
lynx -source http://www.reportsfromearth.com/1140/names-best-known-bots-spiders-crawlers-visiting-website-2014/|grep "<td>"|grep -vE '("<td>"|><)'|sed 's/<td>//g'|sed 's|</td>||g'|sort|uniq|awk 'length >= 4'|grep -ivE '(:|gif|wget|xget)'>.rr_tmp
bnames=$(wc -l .rr_tmp|awk '{print $1}');echo "found ${bnames} known crawlers"
grep -ivf .rr_tmp ${visitor}>.rr1_tmp
rnames=$(wc -l .rr1_tmp|awk '{print $1}');echo "found ${rnames} matching log entries"
View mail_nightly_build.sh
#!/bin/bash
TODAY=`date +"%Y%m%d"`
OLD=`date -d "1 days ago" +"%Y%m%d"`
OLD2=`date -d "10 days ago" +"%Y%m%d"`
USER=enoch
UPLOAD_DIR="/var/www/owncloud/data/$USER/files/Projekt/GITHUB_MAIL"
# Clone Mail master
git clone https://github.com/owncloud/mail.git
You can’t perform that action at this time.