Skip to content

Instantly share code, notes, and snippets.

View SamEureka's full-sized avatar
🏚️
Working from home - CA

Sam Dennon SamEureka

🏚️
Working from home - CA
View GitHub Profile
@SamEureka
SamEureka / test.sh
Created October 24, 2017 15:45
work in progress start script
#!/bin/bash
# SAMPLE1='1-first.with.custom.name'
# SAMPLE2='2-second.with.custom.name'
# for (( i = 1; i <= 2; i++ ))
# do
# var="SAMPLE$i"
# echo ${!var}
# done
@SamEureka
SamEureka / iterate.sh
Created October 24, 2017 15:44
shell iterate
#!/bin/bash
LIST=(`screen -list |grep -o '[a-z]\{10\}'`)
for i in "${LIST[@]}"; do
work="$i"
echo ${work}
done
@SamEureka
SamEureka / stop.sh
Last active June 1, 2017 12:01
Stop some servers running in "Screen"
#!/bin/bash
# Create an array with the screen instance names. (The screen names are 10 characters because I suck at REGEX)
LIST=(`screen -list |grep -o '[a-z]\{10\}'`)
# Iterate over the array to do the work.
for i in "${LIST[@]}"; do
# Create a working string variable with the name
work="$i"
check=`screen -list |grep $work`
@SamEureka
SamEureka / splunk-nginx.md
Last active October 30, 2019 17:26
Splunk w/ NGINX SSL Reverse Proxy

Installing Splunk w/NGINX SSL Reverse Proxy

The steps outlined here make many assumptions about both your operating environment and your understanding of the Linux OS and services running on Linux. I am using the current LTS Ubuntu distribution 16.04 running in the cloud on a DigitalOcean Droplet. These steps should work just fine if followed closely and in order... but you know sh!& never works out the way you plan in Linux. I offer some troubleshooting advice, Google and Stack are your friends ask them for help.
  1. SSH into your pre-configured server running NGINX SSL Reverse Proxy ssh <username>@<server-url-or-IP> **See guide here

  2. Download Splunk Enterprise using WGET `wget -O splunk-6.5.1-f74036626f0c-linux-2.6-amd64.deb 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=6.5.1&product=splunk&filename=splunk-6.5.1-f7

@SamEureka
SamEureka / nginx-ssl-proxy.md
Last active August 12, 2021 22:43
NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent

Installing NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent.

The steps outlined here make many assumptions about both your operating environment and your understanding of the Linux OS and services running on Linux. I am using the current LTS Ubuntu distribution 16.04 running in the cloud on a DigitalOcean Droplet. These steps should work just fine if followed closely and in order... but you know sh!& never works out the way you plan in Linux. I offer some troubleshooting advice, Google and Stack are your friends ask them for help.
(Entered on your local workstation)
  1. ssh-add <path-to-ssh-key> and enter key passphrase when prompted. // ex path... /users/you/.ssh/id_rsa_digital-ocean
  2. ssh root@<server-url-or-IP> // should login without prompting for passphrase
(Entered on your remote server)
  1. adduser and follow prompts
@SamEureka
SamEureka / Gravatar Checker (MD5.js Test).markdown
Created April 24, 2016 17:08
Gravatar Checker (MD5.js Test)
@SamEureka
SamEureka / index.css
Last active January 7, 2016 17:45
D3 - SpiroSlinky
body {
margin: 0;
background: #222;
min-width: 960px;
}
rect {
fill: none;
pointer-events: all;
}
@SamEureka
SamEureka / index.html
Created November 27, 2015 15:41
CSS/HTML Exercise - Login
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS / HTML Exercise - Login</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
@SamEureka
SamEureka / app.css
Last active October 9, 2015 04:15
Session Storage - Timer Test
div {
font-size: 10rem;
text-align: center;
}
.pointing {
cursor: pointer;
}
.bold {
@SamEureka
SamEureka / app.js
Last active September 8, 2022 13:54
Testing localStorage with d3
// refactored - combined the retreive and set to one function.
d3.select("#cText").on("input", function() {
localStorage.setItem('cText', this.value);
d3.select('#textOut').text(localStorage.getItem('cText'));
});
d3.select("#nRange").on("input", function() {
localStorage.setItem('nRange', +this.value);
d3.select('#rangeOut').text(localStorage.getItem('nRange'));