This file contains hidden or 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
-- Inspirations: https://stackoverflow.com/questions/14551419/listing-all-windows-of-all-applications | |
-- 2: https://gist.github.com/krid78/4673164 | |
-- 3: https://gist.github.com/dpinney/d7b83b1ac3405aee244547e42b14ce72 | |
-- Get the size of the Display(s), only useful if there is one display | |
-- otherwise it will grab the total size of both displays | |
tell application "Finder" | |
set _b to bounds of window of desktop | |
set screen_width to item 3 of _b | |
set screen_height to item 4 of _b |
This file contains hidden or 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
package com.company; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.List; | |
import java.util.Date; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Locale; |
This file contains hidden or 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
#!/usr/bin/perl | |
# Based on this: https://www.perlmonks.org/?node_id=113661 | |
use strict; | |
use Time::HiRes qw( sleep ); | |
#$|=1; |
This file contains hidden or 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
package main | |
/* | |
Put ldap.go in ldap subdir | |
Run: go build example.go | |
Run: ./example < ldap-filter.txt | |
*/ | |
import ( | |
"fmt" |
This file contains hidden or 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
var Scroller = (function() { | |
var scrollHandle = 0; | |
var height = () => { | |
var body = document.body, html = document.documentElement; | |
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight,html.offsetHeight ); | |
return height; | |
}; | |
var slowScroll = (amt) => { | |
window.scrollBy({left: 0, top: amt, behavior: 'smooth'}); |
This file contains hidden or 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
# /home/nemo/python/lib/python3.6/site-packages/NEMO/views/ | |
# settings.py: AUTHENTICATION_BACKENDS = ['NEMO.views.fake_authentication.AllowAnyPasswordBackend'] | |
from django.contrib.auth import get_user_model | |
from pprint import pprint | |
class AllowAnyPasswordBackend: | |
def authenticate(self, username=None, password=None): | |
User = get_user_model() |
This file contains hidden or 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
[ | |
{ | |
"pk": 1, | |
"model": "NEMO.user", | |
"fields": { | |
"username": "cap", | |
"first_name": "Steven", | |
"last_name": "Rogers", | |
"qualifications": [ | |
3, |
This file contains hidden or 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 | |
cd /home/nemo | |
pip3 install git+https://github.com/usnistgov/NEMO.git@b219bba1166b893b4223d23ed3383fbf54e77fc5 gunicorn | |
mkdir /home/nemo/{email,media,secrets,logs,nginx,static} | |
wget -q -O - https://gist.github.com/saltlakeryan/5e3b1a2612f973689f25fced3452629/raw > settings.py | |
nemo generate_secret_key > secrets/django_secret_key.txt | |
django-admin makemigrations NEMO |
This file contains hidden or 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
# -------------------- Django settings for NEMO -------------------- | |
# Customize these to suit your needs. Documentation can be found at: | |
# https://docs.djangoproject.com/en/1.11/ref/settings/ | |
# Core settings | |
# DANGER: SETTING "DEBUG = True" ON A PRODUCTION SYSTEM IS EXTREMELY DANGEROUS. | |
# ONLY SET "DEBUG = True" FOR DEVELOPMENT AND TESTING!!! | |
DEBUG = True | |
AUTH_USER_MODEL = 'NEMO.User' |
This file contains hidden or 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 | |
############################## | |
### Run as Root: "sudo su" ### | |
############################## | |
apt-get update | |
apt-get install -y zlib1g-dev git curl vim gcc wget sqlite3 openssl git unzip | |
apt-get install -y build-essential checkinstall | |
apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev |
NewerOlder