Add this to torrc ( located on /etc/tor/torrc):
VirtualAddrNetwork 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9051
server { | |
charset utf-8; | |
#listen <YOUR_IP>:80; | |
server_name <YOUR_DOMAIN> www.<YOUR_DOMAIN>; | |
root /PATH/TO/YOUR/PRESTASHOP/INSTALLATION; | |
index index.php; | |
access_log /var/log/nginx/domains/<YOUT_DOMAIN>.log combined; |
-- Max Jaderberg 4/9/13 | |
-- GPU Effectiveness test | |
require 'torch' | |
require 'sys' | |
require 'nn' | |
require 'xlua' | |
cmd = torch.CmdLine() | |
cmd:text() |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
# /srv/salt/upgrade_the_app.sls | |
# Example of a complex, multi-host Orchestration state that performs status checks as it goes. | |
# Note, this is untested and is meant to serve as an example. | |
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}' | |
{% set nodes = salt.pillar.get('nodes', []) %} | |
{% set all_grains = salt.saltutil.runner('cache.grains', | |
tgt=','.join(nodes), tgt_type='list') %} | |
{# Default version if not given at the CLI. #} |
Responding to requests via simple route matching is built in to Go's net/http
standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe
to have the default request handler invoked on each request. For example:
package main
import (
#!/home/bruno/.virtualenvs/salt/bin/python | |
""" | |
This script formats pepper output using salt outputters. | |
It can both format sync and async jobs, and can be used in the following ways: | |
``` | |
$ pepper \* state.sls core | pepper_format.py -o highstate | |
$ pepper --client=local_async \* state.highstate | pepper_format.py | |
$ pepper_format.py 20170504160400750792 | |
``` |
/** | |
* This file provides common stuff to be used in the pipelines. | |
* It is important to load it after repo checkout is done: see https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#triggering-manual-loading | |
* | |
*/ | |
/** | |
* Dumps some info about the environment. | |
* @return | |
*/ |
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
import time | |
import threading | |
class BaseThread(threading.Thread): | |
def __init__(self, callback=None, callback_args=None, *args, **kwargs): | |
target = kwargs.pop('target') | |
super(BaseThread, self).__init__(target=self.target_with_callback, *args, **kwargs) | |
self.callback = callback | |
self.method = target |