How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
SystemJS.config({ | |
transpiler: "typescript", | |
typescriptOptions: { | |
"experimentalDecorators": true, | |
"emitDecoratorMetadata": true | |
}, | |
map: { | |
"rxjs": "https://npmcdn.com/rxjs", | |
"angular2": "https://npmcdn.com/angular2", | |
"@ngrx": "https://npmcdn.com/@ngrx", |
ubuntu@ip-172-31-51-67 ~ cat /var/shutdown_scripts | |
#!/bin/bash | |
shutdown_if_long() | |
{ | |
TOO_LONG=${1:-30} | |
echo -e "too long = $TOO_LONG" | |
d1=$(last | head -1 | sed -e 's/.* //g' -e 's/ (.*//g' -e 's/..... - //g' -e 's/.* //g' | xargs -I {} date -d {}) | |
d_now=$(date) |
@task | |
def find(): | |
with cd('../../pylib/gh_hazardous_sol/'): | |
print('finding tasks') | |
res = check_output(['/opt/py27env/bin/invoke', '-l']) | |
print('results = {}'.format(res)) | |
if 'build' in res: | |
print('we got build command') | |
# currently all build code is common across all pylibs, through pylib/tasks.py. | |
# folders like gh_hazardous_sol simply call pylib/tasks.py->build function if it exists |
edit mode | history | |
10 hours | |
36000 seconds | |
60000 intervals of 0.600000 (3/5) seconds each |
# http://stackoverflow.com/questions/748324/python-convert-those-tinyurl-bit-ly-tinyurl-ow-ly-to-full-urls | |
############# | |
# urllib2 | |
import urllib2 | |
fp = urllib2.urlopen('http://bit.ly/rgCbf') | |
fp.geturl() | |
# ==> 'http://webdesignledger.com/freebies/the-best-social-media-icons-all-in-one-place' |
sudo dnf install -y icecream.x86_64 icemon.x86_64 | |
# On Main Scheduler server - run both | |
sudo icecc-scheduler -d | |
sudo iceccd -d | |
# On Build Farm Clients | |
sudo iceccd -d |
import logging | |
FORMAT = '%(asctime)-15s %(filename)s <%(lineno)s> %(message)s' | |
logging.basicConfig( | |
filename='log-myreport.log', level=logging.DEBUG, format=FORMAT) | |
stdoutLogger = logging.StreamHandler() | |
stdoutLogger.setFormatter(logging.Formatter(logging.BASIC_FORMAT)) | |
logging.getLogger().addHandler(stdoutLogger) |
def _run_cmd_with_prints(cmd): | |
proc = subprocess.Popen( | |
cmd, | |
bufsize=1, | |
shell=True, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE) | |
for line in proc.stdout.readline(): | |
print('output = {}'.format(line)) |
Some commands: Installations first
pip install hpp2plantuml