Skip to content

Instantly share code, notes, and snippets.

View d4rkd0s's full-sized avatar
🌐
d4rkd0s.com

Logan Schmidt d4rkd0s

🌐
d4rkd0s.com
View GitHub Profile
@d4rkd0s
d4rkd0s / svn_subgit_authors.sh
Created July 19, 2018 20:13
Get SVN authors.txt file
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
@d4rkd0s
d4rkd0s / pingcheck.go
Created July 16, 2018 22:29
Simple GO Program to ICMP Ping from an ips.txt file of IPs
package main
import (
"bufio"
"fmt"
"os"
"time"
"github.com/sparrc/go-ping"
"github.com/fatih/color"
)
@d4rkd0s
d4rkd0s / twitter_non_feed.js
Created July 16, 2018 22:16
Javascript to detect and mark non-feed items on a running twitter feed
q='querySelector';c='.context .Icon--';setInterval(_=>[...document[q+'All']('.js-stream-item')].filter(e => e[q](c+'heartBadge,'+c+'follower,'+c+'promoted')).map(e=>e.style .border="10px solid red"), 1000);

Keybase proof

I hereby claim:

  • I am d4rkd0s on github.
  • I am d4rkd0s (https://keybase.io/d4rkd0s) on keybase.
  • I have a public key whose fingerprint is F8B4 84A6 5B0E 0482 E7FC E7D3 B3F7 2914 8FB7 7AE8

To claim this, I am signing this object:

@d4rkd0s
d4rkd0s / how_to_add_to_path_windows.md
Last active January 29, 2019 21:32
A simple guide on how to add things to your PATH in Windows 10

How to Add to your PATH in Windows

  1. Open a File Explorer and right click My PC and press Properties

Imgur

  1. Next click Change settings

Imgur

@d4rkd0s
d4rkd0s / fix_atom_gpg_git_commit.md
Last active March 25, 2019 20:55
Steps to temporarily fix GPG commit signing in Atom git

Steps to temporarily fix GPG commit signing in Atom git

This is related to: atom/github#814

  1. Add C:\Program Files\Git\usr\bin (or where ever gpg is installed) to path Guide: how to add to your path windows
  2. Run git config --global gpg.program $(which gpg)
  3. Change gpg-no-tty.sh (see locations below where this file may be) line 22 to 'C:/Program Files/Git/usr/bin/gpg' --batch --no-tty --yes ${PASSPHRASE_ARG} "$@" 3<<EOM

Possible locations for gpg-no-tty.sh:

@d4rkd0s
d4rkd0s / CORS_Middleware.php
Last active July 16, 2018 22:18
Laravel middleware written for secure phone app to endpoint communication (see comments)
<?php
namespace App\Http\Middleware;
use Closure;
class CORS
{
/**
* Handle an incoming request.
*
@d4rkd0s
d4rkd0s / nist_2017_password_rules.txt
Created September 29, 2017 23:20
NIST 2017 Password Standards
These points were pulled from NIST SP 800-63 and is intended for Federal Government use.
Are you worse than the government minimums when it comes to security?
1. password length is key
- mimimum limits set to 8 characters
- maximum limits increased to 64 characters or more -- no truncation!
- all printable ascii will be allowed, including spaces
- all unicode should be allowed, including emoji 👌
2. there should be a password blacklist
@d4rkd0s
d4rkd0s / iptables_22_ssh.txt
Created February 2, 2017 01:33
Blocks more than 4 attempts of ssh in 60 seconds
# Create new SSH Attack Chain
iptables -N SSHATTACK
iptables -A SSHATTACK -j LOG --log-prefix "Possible SSH attack!" --log-level 7
iptables -A SSHATTACK -j DROP
# If someone fails more than 3 times per minute they are dropped, this prevents brute forcing attempts
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j SSHATTACK
@d4rkd0s
d4rkd0s / screen_info.html
Created December 26, 2016 21:37
HTML and JS (requires jQuery) to show screen information like width+height and width in em
<html>
<body>
<h1>Screen width by height and width in em</h1>
<p id="size"></p>
<p id="ems"></p>
</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
var physicalScreenHeight = window.screen.height * window.devicePixelRatio;
var physicalScreenWidth = window.screen.width * window.devicePixelRatio;