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
try: | |
gpsd = gps.gps(mode=gps.WATCH_ENABLE) | |
while True: | |
# Read the GPS state from the laptop | |
gpsd.next() | |
if (gpsd.valid & gps.LATLON_SET) != 0: | |
print "Latitude: %s" % gpsd.fix.latitude | |
print "Longitude: %s" % gpsd.fix.longitude |
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
server { | |
listen 80; | |
server_name api.example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name api.example.com; | |
ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; |
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
"""RNN Example.""" | |
from __future__ import print_function, division | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
num_epochs = 100 | |
total_series_length = 50000 | |
truncated_backprop_length = 15 | |
state_size = 4 |
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
"""Example RNN.""" | |
from __future__ import print_function, division | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
num_epochs = 100 | |
total_series_length = 50000 | |
truncated_backprop_length = 15 | |
state_size = 4 |
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
"""Example RNN.""" | |
from __future__ import print_function, division | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
num_epochs = 100 | |
total_series_length = 50000 | |
truncated_backprop_length = 15 | |
state_size = 4 |
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
$ docker rm $(docker ps -a -q) |
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
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT | |
firewall-cmd --direct --add-rule ipv6 filter INPUT 0 -p gre -j ACCEPT | |
firewall-cmd --reload |
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 isAuth = function(req, res, next) { | |
if(req.user) { | |
res.locals.layout = 'app'; | |
next(); | |
} else { | |
res.redirect(res.locals.url.login); | |
} | |
} | |
module.exports = isAuth; |
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 | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
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
server { | |
listen 80; | |
server_name domain.com; | |
location / { | |
proxy_pass http://localhost:8090/; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |