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
HTML/CSS tricks | |
from: https://www.quora.com/Web-Development/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about | |
different node depth colors, for identifying layouts on page | |
* { background-color: rgba(255,0,0,.2); } | |
* * { background-color: rgba(0,255,0,.2); } | |
* * * { background-color: rgba(0,0,255,.2); } | |
* * * * { background-color: rgba(255,0,255,.2); } | |
* * * * * { background-color: rgba(0,255,255,.2); } |
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/sh | |
### BEGIN INIT INFO | |
# Provides: portforwarding | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Description: Start port redirection | |
### END INIT INFO | |
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
PID==$(docker inspect --format '{{.State.Pid}}' my_container_id) | |
nsenter --mount --uts --ipc --net --pid --target $PID |
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
For a provisioner to work, it must be installed on the local system. with ansible provisioner, need to ansible-playbook on local system |
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
import datetime | |
import time | |
def pause_2b_nice(func): | |
'''Pause the execution for however long func took to run. | |
Useful for not overloading servers when downloading assets. | |
''' | |
def inner(*args, **kwargs): | |
dt_start = dt_end = datetime.datetime.now() | |
ret = func(*args, **kwargs) |
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
Install self-signed cert in chromium on linux: | |
then you don't get complaints, will if it changes (MOTM attack?) | |
First, click on broken https in address bar & export certificate as a .der file | |
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n <cert nickname> -i <cert file> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Setup the tunnel: | |
ssh -i <identity file for bastion> -L <localport>:<endpoint ip or name>:<endpoint ssh port or other port> <bastion user>@<ssh bastion server> | |
Then from local machine connect to local port which will be forwarded to endpoint | |
ssh -i <identity file for endpoint> <endpoint user>@localhost -p <localport from above> |
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
{ | |
"responseHeader":{ | |
"status":0, | |
"QTime":112, | |
"params":{ | |
"facet.query":"true", | |
"q":"-reference_image_md5:[* TO *]", | |
"facet.field":"collection_url", | |
"indent":"true", | |
"fq":"type_ss:\"image\"", |
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
https://52.10.100.133/solr/dc-collection/update?stream.body=<delete><query>collection_url:"https://registry.cdlib.org/api/v1/collection/26198/"</query></delete>&commit=true |