openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
| import os | |
| import cherrypy | |
| from cherrypy import wsgiserver | |
| from my_wsgi_app import wsgi | |
| PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), 'public')) | |
| class Root(object): |
Do you use an usb mouse and keyboard and have laptop_mode installed under your Arch linux ? Then maybe you have the same problems as me - mouse and keyboard getting inactive every 2 seconds or so.
To solve this, go to /etc/laptop-mode/conf.d and copy usb-autosuspend.conf to /etc/laptop-mode/conf.d/board-specific.
After that run lsusb and get the ID of the usb device you want, e.g., 093a:2500 .
Open the board-specific/usb-autosuspend.conf file and find the AUTOSUSPEND_USBID_BLACKLIST conf option.
Put the desired usb IDs there. You might need to run sudo laptop_mode afterwards to reload the configs.
I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.
"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.
| #!/usr/bin/python | |
| import sys | |
| import yaml | |
| import rethinkdb as r | |
| from rethinkdb.errors import RqlDriverError, RqlRuntimeError | |
| import socket | |
| import time | |
| # Load Configuration |
| #!/bin/bash | |
| NAME="hello_app" # Name of the application | |
| DJANGODIR=/webapps/hello_django/hello # Django project directory | |
| SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
| USER=hello # the user to run as | |
| GROUP=webapps # the group to run as | |
| NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
| DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
| DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
| # verifica encoding do arquivo | |
| $ file -I script_perebento.sql | |
| $ file -bI script_perebento.sql | |
| # converte arquivo de ISO-8859-1 para UTF-8 | |
| $ iconv -f ISO-8859-1 -t UTF-8 script_perebento.sql > script_bonitao.sql |
| $(window).load(function(){ | |
| $('.image-class').each(function(){ | |
| this.src = grayscale(this.src); | |
| }); | |
| $('.image-class').fadeIn(500); | |
| }); | |
| function grayscale(src){ | |
| var canvas = document.createElement('canvas'); | |
| var ctx = canvas.getContext('2d'); |
| #!//usr/local/bin/python | |
| # Author: tckb <chandra.tungathurthi@rwth-aachen.de> | |
| # A python client to simulate device pushes into GeoLocator service | |
| # Usage: | |
| # ./GeoLocator-sim.py --show (-s) [devices/clusters]: shows devices or clusters available in server | |
| # ./GeoLocator-sim.py --reset (-r) : resets the simulation devices | |
| # ./GeoLocator-sim.py --addDevice : registers new device | |
| # ./GeoLocator-sim.py --start (-S) : starts simulation | |
| # ./GeoLocator-sim.py --help (-h) : prints this message |
| #!/bin/bash | |
| if [ -z "${SAUCE_USERNAME}" ] || [ -z "${SAUCE_ACCESS_KEY}" ]; then | |
| echo "This script can't run without your Sauce credentials" | |
| echo "Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables" | |
| echo "export SAUCE_USERNAME=ur-username" | |
| echo "export SAUCE_ACCESS_KEY=ur-access-key" | |
| exit 1 | |
| fi | |
| SAUCE_TMP_DIR="$(mktemp -d -t sc.XXXX)" |