text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.hypervisor.xenserver.discoverer;

import com.cloud.agent.AgentManager;
import com.cloud.agent.Listener;
import com.cloud.agent.api.AgentControlAnswer;
import com.cloud.agent.api.AgentControlCommand;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.SetupAnswer;
import com.cloud.agent.api.SetupCommand;
import com.cloud.agent.api.StartupCommand;
import com.cloud.agent.api.StartupRoutingCommand;
import com.cloud.alert.AlertManager;
import com.cloud.configuration.Config;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.DataCenterVO;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.dao.HostPodDao;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.ConnectionException;
import com.cloud.exception.DiscoveredWithErrorException;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.OperationTimedoutException;
import com.cloud.host.HostEnvironment;
import com.cloud.host.HostInfo;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.xenserver.resource.CitrixHelper;
import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
import com.cloud.hypervisor.xenserver.resource.XcpOssResource;
import com.cloud.hypervisor.xenserver.resource.XcpServerResource;
import com.cloud.hypervisor.xenserver.resource.XenServer56FP1Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer56Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer56SP2Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer600Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer610Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer620Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer620SP1Resource;
import com.cloud.hypervisor.xenserver.resource.XenServer650Resource;
import com.cloud.hypervisor.xenserver.resource.XenServerConnectionPool;
import com.cloud.hypervisor.xenserver.resource.Xenserver625Resource;
import com.cloud.resource.Discoverer;
import com.cloud.resource.DiscovererBase;
import com.cloud.resource.ResourceStateAdapter;
import com.cloud.resource.ServerResource;
import com.cloud.resource.UnableDeleteHostException;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.dao.VMTemplateDao;
import com.cloud.user.Account;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.db.QueryBuilder;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.exception.HypervisorVersionChangedException;
import com.xensource.xenapi.Connection;
import com.xensource.xenapi.Host;
import com.xensource.xenapi.HostPatch;
import com.xensource.xenapi.Pool;
import com.xensource.xenapi.PoolPatch;
import com.xensource.xenapi.Session;
import com.xensource.xenapi.Types.SessionAuthenticationFailed;
import com.xensource.xenapi.Types.UuidInvalid;
import com.xensource.xenapi.Types.XenAPIException;
import org.apache.cloudstack.hypervisor.xenserver.XenserverConfigs;
import org.apache.log4j.Logger;
import org.apache.xmlrpc.XmlRpcException;

import javax.inject.Inject;
import javax.naming.ConfigurationException;
import javax.persistence.EntityExistsException;
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;

public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
    private static final Logger s_logger = Logger.getLogger(XcpServerDiscoverer.class);
    protected String _publicNic;
    protected String _privateNic;
    protected String _storageNic1;
    protected String _storageNic2;
    protected int _wait;
    protected XenServerConnectionPool _connPool;
    protected boolean _checkHvm;
    protected String _guestNic;
    protected boolean _setupMultipath;
    protected String _instance;

    @Inject
    protected AlertManager _alertMgr;
    @Inject
    protected AgentManager _agentMgr;
    @Inject
    private VMTemplateDao _tmpltDao;
    @Inject
    private HostPodDao _podDao;

    protected XcpServerDiscoverer() {
    }

    void setClusterGuid(ClusterVO cluster, String guid) {
        cluster.setGuid(guid);
        try {
            _clusterDao.update(cluster.getId(), cluster);
        } catch (EntityExistsException e) {
            QueryBuilder<ClusterVO> sc = QueryBuilder.create(ClusterVO.class);
            sc.and(sc.entity().getGuid(), Op.EQ, guid);
            List<ClusterVO> clusters = sc.list();
            ClusterVO clu = clusters.get(0);
            List<HostVO> clusterHosts = _resourceMgr.listAllHostsInCluster(clu.getId());
            if (clusterHosts == null || clusterHosts.size() == 0) {
                clu.setGuid(null);
                _clusterDao.update(clu.getId(), clu);
                _clusterDao.update(cluster.getId(), cluster);
                return;
            }
            throw e;
        }
    }

    protected boolean poolHasHotFix(Connection conn, String hostIp, String hotFixUuid) {
        try {
            Map<Host, Host.Record> hosts = Host.getAllRecords(conn);
            for (Map.Entry<Host, Host.Record> entry : hosts.entrySet()) {

                Host.Record re = entry.getValue();
                if (!re.address.equalsIgnoreCase(hostIp)){
                    continue;
                }
                Set<HostPatch> patches = re.patches;
                PoolPatch poolPatch = PoolPatch.getByUuid(conn, hotFixUuid);
                for(HostPatch patch : patches) {
                    PoolPatch pp = patch.getPoolPatch(conn);
                    if (pp != null && pp.equals(poolPatch) && patch.getApplied(conn)) {
                        s_logger.debug("host " + hostIp + " does have " + hotFixUuid +" Hotfix.");
                        return true;
                    }
                }
            }
            return false;
        } catch (UuidInvalid e) {
            s_logger.debug("host " + hostIp + " doesn't have " + hotFixUuid + " Hotfix");
        } catch (Exception e) {
            s_logger.debug("can't get patches information, consider it doesn't have " + hotFixUuid + " Hotfix");
        }
        return false;
    }

    @Override
    public Map<? extends ServerResource, Map<String, String>>
    find(long dcId, Long podId, Long clusterId, URI url, String username, String password, List<String> hostTags) throws DiscoveryException {
        Map<CitrixResourceBase, Map<String, String>> resources = new HashMap<CitrixResourceBase, Map<String, String>>();
        Connection conn = null;
        if (!url.getScheme().equals("http")) {
            String msg = "urlString is not http so we're not taking care of the discovery for this: " + url;
            s_logger.debug(msg);
            return null;
        }
        if (clusterId == null) {
            String msg = "must specify cluster Id when add host";
            s_logger.debug(msg);
            throw new RuntimeException(msg);
        }

        if (podId == null) {
            String msg = "must specify pod Id when add host";
            s_logger.debug(msg);
            throw new RuntimeException(msg);
        }

        ClusterVO cluster = _clusterDao.findById(clusterId);
        if (cluster == null || cluster.getHypervisorType() != HypervisorType.XenServer) {
            if (s_logger.isInfoEnabled())
                s_logger.info("invalid cluster id or cluster is not for XenServer hypervisors");
            return null;
        }

        try {
            String hostname = url.getHost();
            InetAddress ia = InetAddress.getByName(hostname);
            String hostIp = ia.getHostAddress();
            Queue<String> pass = new LinkedList<String>();
            pass.add(password);
            conn = _connPool.getConnect(hostIp, username, pass);
            if (conn == null) {
                String msg = "Unable to get a connection to " + url;
                s_logger.debug(msg);
                throw new DiscoveryException(msg);
            }

            Set<Pool> pools = Pool.getAll(conn);
            Pool pool = pools.iterator().next();
            Pool.Record pr = pool.getRecord(conn);
            String poolUuid = pr.uuid;
            Map<Host, Host.Record> hosts = Host.getAllRecords(conn);
            String latestHotFix = "";
            if (poolHasHotFix(conn, hostIp, XenserverConfigs.XSHotFix62ESP1004)) {
                latestHotFix = XenserverConfigs.XSHotFix62ESP1004;
            } else if (poolHasHotFix(conn, hostIp, XenserverConfigs.XSHotFix62ESP1)) {
                latestHotFix = XenserverConfigs.XSHotFix62ESP1;
            }

            /*set cluster hypervisor type to xenserver*/
            ClusterVO clu = _clusterDao.findById(clusterId);
            if (clu.getGuid() == null) {
                setClusterGuid(clu, poolUuid);
            } else {
                List<HostVO> clusterHosts = _resourceMgr.listAllHostsInCluster(clusterId);
                if (clusterHosts != null && clusterHosts.size() > 0) {
                    if (!clu.getGuid().equals(poolUuid)) {
                        String msg = "Please join the host " +  hostIp + " to XS pool  "
                                       + clu.getGuid() + " through XC/XS before adding it through CS UI";
                        s_logger.warn(msg);
                        throw new DiscoveryException(msg);
                    }
                } else {
                    setClusterGuid(clu, poolUuid);
                }
            }
            // can not use this conn after this point, because this host may join a pool, this conn is retired
            if (conn != null) {
                try {
                    Session.logout(conn);
                } catch (Exception e) {
                    s_logger.debug("Caught exception during logout", e);
                }
                conn.dispose();
                conn = null;
            }

            poolUuid = clu.getGuid();
            _clusterDao.update(clusterId, clu);

            if (_checkHvm) {
                for (Map.Entry<Host, Host.Record> entry : hosts.entrySet()) {
                    Host.Record record = entry.getValue();

                    boolean support_hvm = false;
                    for (String capability : record.capabilities) {
                        if (capability.contains("hvm")) {
                            support_hvm = true;
                            break;
                        }
                    }
                    if (!support_hvm) {
                        String msg = "Unable to add host " + record.address + " because it doesn't support hvm";
                        _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, dcId, podId, msg, msg);
                        s_logger.debug(msg);
                        throw new RuntimeException(msg);
                    }
                }
            }

            for (Map.Entry<Host, Host.Record> entry : hosts.entrySet()) {
                Host.Record record = entry.getValue();
                String hostAddr = record.address;

                String prodVersion = CitrixHelper.getProductVersion(record);
                String xenVersion = record.softwareVersion.get("xen");
                String hostOS = record.softwareVersion.get("product_brand");
                if (hostOS == null) {
                    hostOS = record.softwareVersion.get("platform_name");
                }

                String hostOSVer = prodVersion;
                String hostKernelVer = record.softwareVersion.get("linux");

                if (_resourceMgr.findHostByGuid(record.uuid) != null) {
                    s_logger.debug("Skipping " + record.address + " because " + record.uuid + " is already in the database.");
                    continue;
                }

                CitrixResourceBase resource = createServerResource(dcId, podId, record, latestHotFix);
                s_logger.info("Found host " + record.hostname + " ip=" + record.address + " product version=" + prodVersion);

                Map<String, String> details = new HashMap<String, String>();
                Map<String, Object> params = new HashMap<String, Object>();
                details.put("url", hostAddr);
                details.put("username", username);
                params.put("username", username);
                details.put("password", password);
                params.put("password", password);
                params.put("zone", Long.toString(dcId));
                params.put("guid", record.uuid);
                params.put("pod", podId.toString());
                params.put("cluster", clusterId.toString());
                params.put("pool", poolUuid);
                params.put("ipaddress", record.address);

                details.put(HostInfo.HOST_OS, hostOS);
                details.put(HostInfo.HOST_OS_VERSION, hostOSVer);
                details.put(HostInfo.HOST_OS_KERNEL_VERSION, hostKernelVer);
                details.put(HostInfo.HYPERVISOR_VERSION, xenVersion);

                String privateNetworkLabel = _networkMgr.getDefaultManagementTrafficLabel(dcId, HypervisorType.XenServer);
                String storageNetworkLabel = _networkMgr.getDefaultStorageTrafficLabel(dcId, HypervisorType.XenServer);

                if (!params.containsKey("private.network.device") && privateNetworkLabel != null) {
                    params.put("private.network.device", privateNetworkLabel);
                    details.put("private.network.device", privateNetworkLabel);
                }

                if (!params.containsKey("storage.network.device1") && storageNetworkLabel != null) {
                    params.put("storage.network.device1", storageNetworkLabel);
                    details.put("storage.network.device1", storageNetworkLabel);
                }

                DataCenterVO zone = _dcDao.findById(dcId);
                boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
                params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));

                params.put("router.aggregation.command.each.timeout", _configDao.getValue(Config.RouterAggregationCommandEachTimeout.toString()));
                params.put("wait", Integer.toString(_wait));
                details.put("wait", Integer.toString(_wait));
                params.put("migratewait", _configDao.getValue(Config.MigrateWait.toString()));
                params.put(Config.XenServerMaxNics.toString().toLowerCase(), _configDao.getValue(Config.XenServerMaxNics.toString()));
                params.put(Config.XenServerHeartBeatTimeout.toString().toLowerCase(), _configDao.getValue(Config.XenServerHeartBeatTimeout.toString()));
                params.put(Config.XenServerHeartBeatInterval.toString().toLowerCase(), _configDao.getValue(Config.XenServerHeartBeatInterval.toString()));
                params.put(Config.InstanceName.toString().toLowerCase(), _instance);
                details.put(Config.InstanceName.toString().toLowerCase(), _instance);
                try {
                    resource.configure("XenServer", params);
                } catch (ConfigurationException e) {
                    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + record.address, "Error is " + e.getMessage());
                    s_logger.warn("Unable to instantiate " + record.address, e);
                    continue;
                }
                resource.start();
                resources.put(resource, details);
            }
        } catch (SessionAuthenticationFailed e) {
            throw new DiscoveredWithErrorException("Authentication error");
        } catch (XenAPIException e) {
            s_logger.warn("XenAPI exception", e);
            return null;
        } catch (XmlRpcException e) {
            s_logger.warn("Xml Rpc Exception", e);
            return null;
        } catch (UnknownHostException e) {
            s_logger.warn("Unable to resolve the host name", e);
            return null;
        } catch (Exception e) {
            s_logger.debug("other exceptions: " + e.toString(), e);
            return null;
        }
        return resources;
    }

    String getPoolUuid(Connection conn) throws XenAPIException, XmlRpcException {
        Map<Pool, Pool.Record> pools = Pool.getAllRecords(conn);
        assert pools.size() == 1 : "Pools size is " + pools.size();
        return pools.values().iterator().next().uuid;
    }

    protected void addSamePool(Connection conn, Map<CitrixResourceBase, Map<String, String>> resources) throws XenAPIException, XmlRpcException {
        Map<Pool, Pool.Record> hps = Pool.getAllRecords(conn);
        assert (hps.size() == 1) : "How can it be more than one but it's actually " + hps.size();

        // This is the pool.
        String poolUuid = hps.values().iterator().next().uuid;

        for (Map<String, String> details : resources.values()) {
            details.put("pool", poolUuid);
        }
    }

    protected CitrixResourceBase createServerResource(String prodBrand, String prodVersion, String prodVersionTextShort, String hotfix) {
        // Xen Cloud Platform group of hypervisors
        if (prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0")
              || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") || prodVersion.startsWith("1.6"))) {
            return new XcpServerResource();
        } // Citrix Xenserver group of hypervisors
        else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.0"))
            return new XenServer56Resource();
        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0"))
            return new XenServer600Resource();
        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2"))
            return new XenServer600Resource();
        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0"))
            return new XenServer610Resource();
        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0")) {
            if (hotfix != null && hotfix.equals(XenserverConfigs.XSHotFix62ESP1004)) {
                return new Xenserver625Resource();
            } else if (hotfix != null && hotfix.equals(XenserverConfigs.XSHotFix62ESP1)) {
                return new XenServer620SP1Resource();
            } else {
                return new XenServer620Resource();
            }
        } else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) {
            if ("5.6 SP2".equals(prodVersionTextShort.trim())) {
                return new XenServer56SP2Resource();
            } else if ("5.6 FP1".equals(prodVersionTextShort.trim())) {
                return new XenServer56FP1Resource();
            }
        } else if (prodBrand.equals("XCP_Kronos")) {
            return new XcpOssResource();
        } else if (prodBrand.equals("XenServer")) {
            final String[] items = prodVersion.split("\\.");
            if ((Integer.parseInt(items[0]) > 6) ||
                    (Integer.parseInt(items[0]) == 6 && Integer.parseInt(items[1]) >= 4)) {
                s_logger.warn("defaulting to xenserver650 resource for product brand: " + prodBrand + " with product " +
                        "version: " + prodVersion);
                //default to xenserver650 resource.
                return new XenServer650Resource();
            }
        }
        String msg =
                "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6,  XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0, 6.2.0, >6.4.0 but this one is " +
                        prodBrand + " " + prodVersion;
        s_logger.warn(msg);
        throw new RuntimeException(msg);
    }

    protected CitrixResourceBase createServerResource(long dcId, Long podId, Host.Record record, String hotfix) {
        String prodBrand = record.softwareVersion.get("product_brand");
        if (prodBrand == null) {
            prodBrand = record.softwareVersion.get("platform_name").trim();
        } else {
            prodBrand = prodBrand.trim();
        }
        String prodVersion = CitrixHelper.getProductVersion(record);

        String prodVersionTextShort = record.softwareVersion.get("product_version_text_short");
        return createServerResource(prodBrand, prodVersion, prodVersionTextShort, hotfix);
    }

    protected void serverConfig() {
        String value = _params.get(Config.XenServerSetupMultipath.key());
        _setupMultipath = Boolean.parseBoolean(value);
    }

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        super.configure(name, params);
        serverConfig();

        _publicNic = _params.get(Config.XenServerPublicNetwork.key());
        _privateNic = _params.get(Config.XenServerPrivateNetwork.key());

        _storageNic1 = _params.get(Config.XenServerStorageNetwork1.key());
        _storageNic2 = _params.get(Config.XenServerStorageNetwork2.key());

        _guestNic = _params.get(Config.XenServerGuestNetwork.key());

        String value = _params.get(Config.XapiWait.toString());
        _wait = NumbersUtil.parseInt(value, Integer.parseInt(Config.XapiWait.getDefaultValue()));

        _instance = _params.get(Config.InstanceName.key());

        value = _params.get(Config.XenServerSetupMultipath.key());
        Boolean.parseBoolean(value);

        value = _params.get("xenserver.check.hvm");
        _checkHvm = Boolean.parseBoolean(value);
        _connPool = XenServerConnectionPool.getInstance();

        _agentMgr.registerForHostEvents(this, true, false, true);

        createXsToolsISO();
        _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
        return true;
    }

    @Override
    public boolean matchHypervisor(String hypervisor) {
        if (hypervisor == null)
            return true;
        return Hypervisor.HypervisorType.XenServer.toString().equalsIgnoreCase(hypervisor);
    }

    @Override
    public Hypervisor.HypervisorType getHypervisorType() {
        return Hypervisor.HypervisorType.XenServer;
    }

    @Override
    public void postDiscovery(List<HostVO> hosts, long msId) throws DiscoveryException {
        //do nothing
    }

    @Override
    public int getTimeout() {
        return 0;
    }

    @Override
    public boolean isRecurring() {
        return false;
    }

    @Override
    public boolean processAnswers(long agentId, long seq, Answer[] answers) {
        return false;
    }

    @Override
    public boolean processCommands(long agentId, long seq, Command[] commands) {
        return false;
    }

    private void createXsToolsISO() {
        String isoName = "xs-tools.iso";
        VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName);
        Long id;
        if (tmplt == null) {
            id = _tmpltDao.getNextInSequence(Long.class, "id");
            VMTemplateVO template =
                    VMTemplateVO.createPreHostIso(id, isoName, isoName, ImageFormat.ISO, true, true, TemplateType.PERHOST, null, null, true, 64, Account.ACCOUNT_ID_SYSTEM,
                            null, "xen-pv-drv-iso", false, 1, false, HypervisorType.XenServer);
            _tmpltDao.persist(template);
        } else {
            id = tmplt.getId();
            tmplt.setTemplateType(TemplateType.PERHOST);
            tmplt.setUrl(null);
            _tmpltDao.update(id, tmplt);
        }
    }

    @Override
    public void processHostAdded(long hostId) {
    }

    @Override
    public void processConnect(com.cloud.host.Host agent, StartupCommand cmd, boolean forRebalance) throws ConnectionException {
        if (!(cmd instanceof StartupRoutingCommand)) {
            return;
        }
        long agentId = agent.getId();

        StartupRoutingCommand startup = (StartupRoutingCommand)cmd;
        if (startup.getHypervisorType() != HypervisorType.XenServer) {
            s_logger.debug("Not XenServer so moving on.");
            return;
        }

        HostVO host = _hostDao.findById(agentId);

        ClusterVO cluster = _clusterDao.findById(host.getClusterId());
        if (cluster.getGuid() == null) {
            cluster.setGuid(startup.getPool());
            _clusterDao.update(cluster.getId(), cluster);
        } else if (!cluster.getGuid().equals(startup.getPool())) {
            String msg = "pool uuid for cluster " + cluster.getId() + " changed from " + cluster.getGuid() + " to " + startup.getPool();
            s_logger.warn(msg);
            throw new CloudRuntimeException(msg);
        }

        Map<String, String> details = startup.getHostDetails();
        String prodBrand = details.get("product_brand").trim();
        String prodVersion = details.get("product_version").trim();
        String hotfix = details.get(XenserverConfigs.XS620HotFix);
        String prodVersionTextShort = details.get("product_version_text_short");

        String resource = createServerResource(prodBrand, prodVersion, prodVersionTextShort, hotfix).getClass().getName();

        if (!resource.equals(host.getResource())) {
            String msg = "host " + host.getPrivateIpAddress() + " changed from " + host.getResource() + " to " + resource;
            s_logger.debug(msg);
            host.setResource(resource);
            host.setSetup(false);
            _hostDao.update(agentId, host);
            throw new HypervisorVersionChangedException(msg);
        }

        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Setting up host " + agentId);
        }
        HostEnvironment env = new HostEnvironment();

        SetupCommand setup = new SetupCommand(env);
        if (_setupMultipath) {
            setup.setMultipathOn();
        }
        if (!host.isSetup()) {
            setup.setNeedSetup(true);
        }

        try {
            Answer answer = _agentMgr.send(agentId, setup);
            if (answer != null && answer.getResult() && answer instanceof SetupAnswer) {
                host.setSetup(true);
                host.setLastPinged((System.currentTimeMillis() >> 10) - 5 * 60);
                host.setHypervisorVersion(prodVersion);
                _hostDao.update(host.getId(), host);
                if (((SetupAnswer)answer).needReconnect()) {
                    throw new ConnectionException(false, "Reinitialize agent after setup.");
                }
                return;
            } else {
                s_logger.warn("Unable to setup agent " + agentId + " due to " + ((answer != null) ? answer.getDetails() : "return null"));
            }
        } catch (AgentUnavailableException e) {
            s_logger.warn("Unable to setup agent " + agentId + " because it became unavailable.", e);
        } catch (OperationTimedoutException e) {
            s_logger.warn("Unable to setup agent " + agentId + " because it timed out", e);
        }
        throw new ConnectionException(true, "Reinitialize agent after setup.");
    }

    @Override
    public AgentControlAnswer processControlCommand(long agentId, AgentControlCommand cmd) {
        return null;
    }

    @Override
    public boolean processDisconnect(long agentId, Status state) {
        return false;
    }

    @Override
    public void processHostAboutToBeRemoved(long hostId) {
    }

    @Override
    public void processHostRemoved(long hostId, long clusterId) {
    }

    @Override
    public boolean processTimeout(long agentId, long seq) {
        return false;
    }

    @Override
    public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource, Map<String, String> details, List<String> hostTags) {
        StartupCommand firstCmd = startup[0];
        if (!(firstCmd instanceof StartupRoutingCommand)) {
            return null;
        }

        StartupRoutingCommand ssCmd = ((StartupRoutingCommand)firstCmd);
        if (ssCmd.getHypervisorType() != HypervisorType.XenServer) {
            return null;
        }

        HostPodVO pod = _podDao.findById(host.getPodId());
        DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
        s_logger.info("Host: " + host.getName() + " connected with hypervisor type: " + HypervisorType.XenServer + ". Checking CIDR...");
        _resourceMgr.checkCIDR(pod, dc, ssCmd.getPrivateIpAddress(), ssCmd.getPrivateNetmask());
        return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.XenServer, details, hostTags);
    }

    @Override
    public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage) throws UnableDeleteHostException {
        if (host.getType() != com.cloud.host.Host.Type.Routing || host.getHypervisorType() != HypervisorType.XenServer) {
            return null;
        }

        _resourceMgr.deleteRoutingHost(host, isForced, isForceDeleteStorage);
        return new DeleteHostAnswer(true);
    }

    @Override
    protected HashMap<String, Object> buildConfigParams(HostVO host) {
        HashMap<String, Object> params = super.buildConfigParams(host);
        DataCenterVO zone = _dcDao.findById(host.getDataCenterId());
        if (zone != null) {
            boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
            params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
        }
        return params;
    }

    @Override
    public boolean stop() {
        _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName());
        return super.stop();
    }
}

redpajama_set_name: RedPajamaGithub


text:
PHILOSOPHY > Great Thinkers > The Vilna Gaon > The Vilna Gaon - Series 1 > This World and the World-to-Come
Shiur #12: THIS WORLD AND THE WORLD-TO-COME
I. THE GRA'S EXEGETICAL METHOD
In the previous shiur, we examined the Gra's dichotomous world view, as it emerges from several passages in his commentaries to Scripture. Before we continue to examine this issue, I wish to focus on some of the citations that we have already seen in order to better understand the Gra's exegetical method. Earlier we brought partial citations of the Gra's words; here we shall try to broaden the canvas.
First of all, an examination of the passages raises the question regarding the relationship between the plain sense of the text and the midrashic understanding. For example, one passage that we already discussed is taken from the book of Mishlei: the seductions of the harlot – a passage that is understood by the Gra as connected to man's struggle with his evil yetzer. Is this interpretation the plain meaning of the text? Surely the verses speak of a harlot! It should, however, be noted that sometimes the metaphoric meaning is so obvious and necessary that many of us would say that it is the plain meaning of the text. For example, when the Torah commands, "You shall not put a stumbling block before the blind" (Vayikra 19:14), the Halakha understands that one is forbidden to give inappropriate counsel to one who is "blind" – i.e., ignorant – about a certain matter. It would seem from the Halakha that this understanding is the plain meaning of the text, for many maintain – and this seems to be the majority opinion – that the verse does not prohibit the literal situation, i.e., to place an actual stumbling block before the blind.[1] So too in connection with the harlot in the book of Mishlei, it should be remembered that the prophets in general used harlotry as a metaphor for the sins of Israel and their betrayal of God. In our case in the book of Mishlei, the Gra is not the only commentator who takes this approach. The Ralbag also argues that the verses refer to man's inclination to follow "the craving soul."
The uniqueness of the Gra's interpretation lies in what he says about the words of the harlot, "This day have I paid my vows." What do these words mean? According to most commentators, she means to say that she has an abundance of meat, and she asks the object of her seductions to come and eat with her. However, the meat of peace-offerings would not be necessary for this purpose. It is of course possible that the role of the peace-offerings is only to add color to illustrate the matter. But in the wake of the moral of the story, the Gra understands that the sacrificial meat is part of the seduction, and thus we are presented with one of the devices of the yetzer: the way it disguises itself in a mitzva. The Gra explains why the mitzva is so great from a halakhic perspective. For even on Shabbat, when we are commanded to eat and to delight ourselves, a person can fulfill his obligation to eat with some insignificant food – "a pie of fish-hash" – whereas with respect to a peace-offering, the entire offering must be eaten with joy, and if one does not fulfill the mitzva in perfect manner, he transgresses the prohibition of leaving part of a sacrifice past the time it is permitted to be eaten. This exegetical novelty, that inserts a halakhic perspective into a biblical passage of a moralistic character, is typical of the Gaon of Vilna.
In contrast, we would certainly not accept the Gra's moral in the book of Yona – the story of the soul's flight from its spiritual destiny – as the plain sense of the text. But even when the Gra sails off to the zones of allusion and metaphor, he takes with him his characteristic sensitivity that is so uniquely different from that which is commonly found in the world of exegesis. For when a darshan proposes an explanation based on metaphor, he might rely on some superficial common denominator between the metaphor and what it stands for, with his creative imagination making the connection between them. The Gra, on the other hand, as opposed to the typical exegete/darshan, does not base his interpretation merely on creativity, a fertile imagination, or even on reasonableness. But rather he demonstrates for us that the connections that he builds are anchored in the sources.
For example, Yona's flight "from before God" symbolizes, as stated, the soul's flight into the bosom of this worldly pleasures, and its distancing itself from its original position in the spiritual world, where it stood "before God," prior to its descent into the material world. The designation "before God" as referring to the prior existence of the soul before it is born in a person's body, does not present any linguistic or exegetical difficulty, and it is quite reasonable. But nevertheless the Gra takes pains to clarify that he does not present this understanding of Scripture "on his own," but rather he has a source in the Zohar. Indeed, this idea is found in the Zohar to Parashat Vayechi, in connection with Eliyahu's words to Achav: "As the Lord lives, before whom I stand" (I Melakhim 17:1):
Yet come and see: All the souls which have existed since the Creation of the world, all stand before the Holy One, blessed be He, before descending into the world
When the soul is ready to descend into the world with the very shape it is about to have in this world, it stands before the Holy One, blessed be He, who adjures it to observe the precepts of the Torah and never transgress them.
Whence do we know that the souls stand before Him? From the verse: "As the Lord, God of Israel, lives, before whom I stand" (I Melakhim 17:1), stood assuredly before being created….
In similar fashion, when the Gra likens the troubles in this world to the waves of the sea, one would say that his words need no foundation, as everyone would agree that the metaphor is appropriate. Nevertheless, the Gra adduces Scriptural proofs that the waves of the sea can be assigned this sense. His first proof-text is Tehilim 42:8: "All Your waves and Your billows are gone over me." It is clear that the Psalmist is not referring to actual waves, for the entire chapter relates to various troubles – persecutions, abuse of enemies, distance from the house of God – and it is clear that the waves and billows are used here in the metaphoric sense. The Gra brings another verse to support his understanding, from the prayer of Yona himself: "The waters compassed me about, to the point of death (lit., 'to the soul')" (Yona 2:6). Here there was room to understand that we are dealing with actual water, for Yona was in fact encompassed by water; but if so, what is meant by "to the soul"? The Gra apparently understands that the reference is to some trouble that touches the depths of a person's soul.[2]
Let us bring an example from another detail in the book of Yona. The soul (Yona) flees to Tarshish to enjoy the pleasures of this world. The real Tarshish is a famous port, but the Gaon understood that its being chosen to symbolize the attraction of temporal seductions is also anchored in its concrete existence, as is explained in the book of Yechezkel (27:12):
Tarshish was your merchant by reason of the multitude of all kind of riches; with silver, iron, tin, and lead, they traded for your wares.
The Gra's interpretation of "in the wilderness in the desert" at the beginning of the book of Devarim, which we brought in the previous shiur, illustrates this principle. He proves that these words were already given symbolic meaning by Yirmiyahu, who uses them to describe the metaphoric fate of "the man who trusts in man." The Vilna Gaon applies the metaphor to Moshe's rebuke, as a practical lesson that promotes separation from this worldly pleasures.
In summary, the same principle that rules the Gra's Halakhic teachings – anchoring everything in some source – also leaves its mark on his Biblical exegesis.
II. WHICH WORLD IS PREFERABLE?
Let us now go back to the moral approach to life that emerged from the passages that we studied, an approach that sees man as placed in a split reality, divided between a world of spirit and a fleeting material world. During his lifetime a person must preserve to the extent possible his connection to the timeless dimension, and set before his eyes "the end," i.e., death. According to the Gra's understanding of the verse: "Who rejoice exceedingly, and are glad, when they can find a grave," death is portrayed as a gate to an elevated and meaningful reality, which is beyond man's reach as long as he is trapped in his body.
This outlook is built on two assumptions: 1) a dichotomous division of reality; 2) a preference given to connection to the heavenly over the present world. But despite what we have seen, there is room to challenge the absoluteness of this approach in the Gra's teachings, especially with respect to the second principle. The same Gaon who so rejoiced over the Torah that he attained, who was so deeply satisfied with his life work, as we saw in the past – is it possible to say that all of his yearnings were directed to the world-to-come?
Indeed, Rav Chayyim of Volozhin relates in his introduction to Sifra de-Tzeni'uta that his master would say:
That even the wonderful and awesome things that the soul attains in sleep, in supernal pleasure in the heavenly academies, he did not regard as being so great, the main thing being what a person attains in this world through toil and labor when he chooses the good and opens himself to the words of the Torah. With this he pleases his Creator, blessed be His Name, this being all of man's duty to occupy himself in His Torah, blessed be His Name. But that which the soul attains in sleep… is merely reward, the Holy One, blessed be He, giving him a taste of the world-to-come in this world….
From here it follows that from an ethical perspective, preference should be given to service in this world over the world-to-come, where one merely receives reward.
Rabbi Joseph Soloveitchik, in his "Halakhic Man," cites the following tradition:
The story is told about the Gaon of Vilna, how just before his death he clutched the tzitzit of his garment, wept, and exclaimed: "How beautiful is this world – for one penny a person can acquire eternal life." (p. 30)
We hear the same idea from Rav Chayyim of Volozhin. On the night of Selichot in the year 5572, Rav Chayyim delivered a sermon that has been published many times since. He reports that he heard –
many times from the holy mouth of our master, the Gaon, the pious, Eliyahu of Vilna, what is the importance of the world-to-come; it has no value whatsoever in contrast to one hour in this world of occupation in Torah and commandments, for in the world-to-come it is impossible to serve God
This citation provides additional support to the thesis that even the Gra preferred this world, where he felt very much "at home." But Rav Chayyim's attitude towards these words of his master was complex; what is more, from an educational-communal perspective, he viewed them as constituting a stumbling block and danger.
Why did Rav Chayyim cite these words of the Gra? Because they reminded him of a saying that was common among the Jews of his time:
And owing to our many sins, the yetzer blinds the eyes of the masses, putting words into their mouths saying, that people say that even this world is a world, and it too should be considered
When Rav Chayyim plays the role of preacher, and tries to convince his audience that they should worry about their world-to-come, he is bothered by the fact that people set this world at the head of their concerns, and justify their worry about material success. In response to such sentiments, he continues:
In truth, the righteous of the world who serve God out of love with no other end but their desire to serve God – for them it is fitting to say this, as I have heard[3]… But we who are low in value, how can we imagine forsaking the life of the soul for the life of the body.
This time, Rav Chayyim refrains from setting the Gra as an example who should be followed by the masses. Joy in the life of this world is fitting and appropriate for the truly righteous, says Rav Chayyim, because they really know what should guide man during his lifetime: Torah and the commandments. But Heaven forbid that we, the simple people, should adopt such an outlook, which is liable to bring us to cleave to material good.
Reading this brings to mind a famous affair in the second Temple period. It is reported in Pirkei Avot that Antigonos of Sokho taught his disciples "to serve their master not for the sake of receiving a reward," that is to say, to see God's service as the ultimate objective, and not to give any consideration whatsoever to the reward to be received in the world-to-come. The paradox here is that it is precisely a very righteous person who recommends that we ignore death. Antigonos advises that we should forget what is recommended elsewhere (even in Pirkei Avot) that man will in the end have to give a reckoning for his actions, and that we should live wholly "in the present." These words did not make sense to two disciples who heard his teachings, Tzaddok and Boethus, certainly not in the way that Antigonos meant them. These disciples left the proper path, after concluding from Anitgonos's words that one should not live "for the sake of" the world-to-come, which is nothing but false hope; and accordingly they invested their efforts in pursuing the pleasures of this world. As a result, Antigonos was subjected to strong criticism on the part of the Sages. He had mistakenly set a high religious standard before people for whom it was inappropriate, and he was insufficiently sensitive to the dangers that his words were liable to stir up.
It would appear that Rav Chayyim wished to avoid a similar mistake. Only a person at the level of the Gra could "ignore" the world-to-come. But ordinary people who set their primary interests in this world endanger their eternal souls.
Here, however, we must ask: What is the position of the Gra himself on this issue? For in the end, his words seem to be contradictory. We have already noted that in many places he advises that a person should always keep in mind the vision of death, and he should know that this is his destiny as a human being. In other places, however, we hear that the Gaon himself was happy with his achievements, and he emphasizes that it is only the reality of this world that made them possible, for this is the only place where the service of God is possible. How can these contradictory tendencies be reconciled? One way to resolve the contradiction emerges from the words of Rav Chayyim cited above. It might be possible to understand that the Gra himself valued life on earth more than anything else, because, as stated, only here can one serve God. But the community at large cannot understand this idea, and the attempt to set it as the ideal poses a danger. Accordingly – for mass consumption – the Gra acted in the manner of his disciple: He adopts a different approach, he demands the same constant awareness of "over against Suf," and he preaches that one should yearn for the wonderful reward in the world of the spirit that awaits anyone who cleaves to the Torah in our lowly world.
The truth, however, is that it is exceedingly difficult to be convinced that this indeed is the Gra's position. His statements about the greatness of the world-to-come are very impressive, and the connection of the Gra himself to that world – the ascents of his soul and his conversations with the heavenly academy – bear such intensity that it is difficult to dismiss it all as an educational tactic aimed at the low-leveled. It would seem that some other point underlies the Gra's position, and it is reasonable to assume that this point will also shine new light on the words of Rav Chayyim of Volozhin.
III. "YOU DESIRE PRAISE"
The great esteem for the spirituality of the world-to-come, as recorded by the Gra's son in the name of his father in his commentary to the book of Iyyov, is a necessary stage, without which a person cannot possibly reach a proper assessment of the Torah and the mitzvot that are fulfilled in this world. Why? Because it is impossible to assert that the mitzvot that are sold in this world "for pennies" are the main thing, without being entirely clear about what the less-important remainder is. The credibility of the statement is conditioned on the paradox that it embodies. The seriousness with which it can be said that seventy years of Divine service are more important than an eternal life of enjoying the splendor of the Shekhina – depends upon our recognizing the existential attraction of that eternity, of the liberation from the chains of matter, of the redemption from the prison of the body. Only after we reach this recognition, then when we stubbornly turn our heads and say: "Despite it all, the Torah and the commandments in this world are greater" – is there substance to our words. Only then are we credible.
And on the other hand, someone who doesn't instinctively see that the superiority of the heavenly world is like the superiority of light to darkness, and who owing to this blindness asserts that "what is most important is life in this world," distorts reality and goes off the path as did Tzadok and Boethus. His words stem from the fact that this world is the only world that he knows. His words are superficial, even cynical, and lead to hedonism.
A poetic expression of this idea is found in a profound work that is included in the Yom Kippur prayer according to the Ashkenazi rite. It speaks of the praise of God sounded by the ministering angels and by man. In stanza after stanza, the paytan presents the comparison and the contrast between the two:
You who are revered by the faithful and mighty angels,
Formed of ice and of flashing light, for Your awe is upon them,
Yet You desire praise from dust-made men dwelling on earth,
Who fall short and are poor in good deeds – and that is Your fame.
God's eyes are lifted up in expectation, as it were, to the praise of flesh and blood, and for its sake He ignores the bands of His mighty angels. But the incomprehensible greatness of the deeds of man is portrayed against the background of heavenly worlds that look out upon human actions, perhaps with hope, perhaps with jealousy. Without recognizing the awesome stature of those "formed of ice", it would be impossible to properly understand the impact of the proclamation that it is precisely the praise of those "formed of matter" – which is "Your fame"!
Accordingly, when the Gra expresses his deep attachment to life on earth and to what may be achieved through it, his excitement is based on all of his teachings about the supernal spiritual reality, that looks down upon us from above, and which man enters when his soul parts from his body. When his disciple, Rav Chayyim, warns his listeners against clinging to their earthly lives, he does this because the spirit of rationality is gaining in strength and modernity is at the door. The community at large is beginning to distance itself from the traditional consciousness of "God in heaven and you on earth," and when someone expresses his belief "that this world is also a world," he speaks about the material world in its literal sense, a world of day to day dealings, which does not evoke the jealousy of the angels or the esteem of the holy ones above. The detachment from the world of celestial spirituality deprives this world of its supremacy, which only the paradox can bestow upon it.
If, based upon what has been said here, it seems to you that as the zeitgeist of modernity progressed, the less possible the Gra's original outlook became for many, it would be difficult for me to disagree. That which Rav Chayyim tried to keep from his audience, turned out to be the only alternative, the sole path that they could take. The more that the Enlightenment distanced the world of emanation from the thinking and the religious experience of the average Jew, they were left with no other choice but to cling to the visible world, and to struggle within it to maintain Torah study and the observance of the mitzvot in their concrete sense. It was the Gra who opened this door. It was he who raised the banner of the earthly service of God. But the conceptual-spiritual system that supported the Gra's outlook and that made possible the beginning of this change, was forced to shift into a defensive mode, and even to retreat in great measure from its positions because of the changes in the spirit of the time.
In the next shiur, we shall examine this process more closely.
[1] This is certainly forbidden by Torah law for various reasons, but this is not what the Torah had in mind when it commanded: "You shall not put a stumbling block before the blind."
[2] It should be noted that many commentators assume that the reference is to actual water that reach "to the soul" – that is to say, to the point of death, for Yona was in danger of drowning. It should also be noted that the first verse, "All Your waves and Your billows are gone over me," is found not only in Tehilim, but also in Yona's prayer. But it is likely that the Gra was referring to the verse in Tehilim, as he was interested in adducing proof for his metaphoric understanding.
[3] Here appears the citation brought above in the name of the Gra.
Torah, Experience and Morality in the Thought of R. Chayyim of Volozhin
Shiur #20: Perspective on the "Horizon"

redpajama_set_name: RedPajamaCommonCrawl


The Stark Raving Viking: Will elected officials do something about a Police State?
Will elected officials do something about a Police State?
Should a Connecticut State Police Commissioner be able to target citizens who complain to elected officials, proposing laws regarding police misconduct and making police function better serving the public?
Should the Connecticut State Police Commissioner be able to illegally collude with Connecticut Judges to rig cases so targets have their families broken up, lose their homes, ability to get a job, are no longer taxpayers, and are railroaded to prison to be ruined for life?
Should lawyers be coerced into serving the Police State, not their clients?
Is it ok with you that State Registered Police Confidential Informants are paid to hurt, ruin, assault, set up, and even kill citizens on a Police "Enemies List"?
Are you interested in having a hearing on this matter?
Are you interested in learning the fate of Ritt Goldstein who proposed Civilian Oversight of Police at a Special Hearing in front of Connecticut legislators and then was so terrorized by police that he fled to Sweden to seek political asylum?
The 37-year-old Meehan, who was suspended from the force after the charges and now lives in Meriden, was one of eight police officers - a state police trooper, five Hartford officers and two New Britain officers, arrested in late 1994.
Meehan is the son of former Hartford assistant police chief James Meehan Sr., who along with his wife, daughter, James Meehan Jr.'s wife and other family members watched the trial closely from the spectator's section, behind the defense table.
Should there be one allegedly corrupt judge, a former Connecticut State Police Commissioner be the only person on a Grand Jury system? Or should there be a real Grand Jury System [like this]?


text:
IndojazziaMusik
Hear2Ear
Down in the Longhorn
Interviewer James Joyce, Literary Hub, New York
Arlo Hennings - musician, author, music business shaker remembers Jay's Longhorn
Vitamin Q 1979 Jay's Longhorn.
Arlo Hennings (left guitar) Michael Gacek (drums) Steve Knaeble (bass) Anita Kozan (keys) - Photo unknown
About Jay's Longhorn
Jay's Longhorn was a underground music venue that gave birth to many local, national, and international artists in the late 70s and early 80s. The venue has been compared to places like CBGB's in New York. A recent book called, "Complicated Fun" and a documentary by Mark Engergretsen "Jay's Longhorn Film" as well as several reunion concerts has shined new light on that music scene.
JJ: Arlo Hennings started into the music biz as a teen in 1968 selling pop in a dancehall. 22 years later he was a local A&R rep for a major record label, and in between, traveled the road from Woodstock to performing in Jay's Longhorn, managed his own venue, recording studio, record distribution manager, live musician, and artist manager.
JJ: When did you first play Jay's Longhorn?
AH: It was 40 years ago in 1979 when my Neo-psychedelic Vaudeville band "Vitamin Q" played the Horn (1979-1983). As Hugo's roommate (drummer of the Suburbs) and part of Bruce Allen's (Guitarist of the Suburbs) pre-Suburbs experiment "The Tsetse Flies" the Q mostly opened for the Suburbs. Later there were member changes and the band went on to perform many venues until 1985.
JJ: Can you tell me a little more about the Tsetse Flies?
AH: In 1977, I was introduced by Steve Knaeble (roommate and co-originator Vitamin Q) to a visionary guitarist named Bruce Allen. The short, self-effacing, MCAD art student was starting a punk band he dubbed the "Tsetse Flies." As Hugo Klares roommate and friend of Bruce Allen and Michael Halliday, I was asked to join the fledging group as the rhythm guitarist. The line-up at that time consisted of Bruce Allen, (lead guitar/vocals), Michael Halliday, (bass) Hugo (Huck) Klaers, (drums) and myself, rhythm guitar. We practiced in the living room and basement of a house rented at 3545 Minnehaha Ave for about 6 months, not Podanys as was believed. Checking on our progression now and then was Chris Osgood. At the time Hugo and Michael worked at Pracna & Main, I did odd jobs, and I can't remember what Bruce did - probably graphics stuff. When is a band a band? The Flies never performed live or recorded but the songs we jammed on were penned by Bruce Allen. I wrote one of them down called "Do Right," which I taught to my next band Vitamin Q and performed my version of it to Bruce's liking at the Longhorn in 1979. Bruce asked me to leave the band and later Steve Knaeble's brother, Johnny Knaeble, might have jammed on guitar for a short while before Hugo left for California.
The song "Do Right" as charted by Arlo.
Songs by Vitamin Q
http://www.arlohennings.com/ME.mp3
http://www.arlohennings.com/BABIES.mp3
http://www.arlohennings.com/fire.mp3
JJ: Can you share your favorite stories at Jay's Longhorn?
Listen to Hennings Story on YouTube
AH: Highlights were getting paid $50 by Hartley Frank for playing my own music. Even though he grinded me into the floor like a cigarrette to get the money, I was estatic. It was my own music. A first. A dream. Another time was witnessing Hartley Frank stand in front of the stage while Husker played and demanded they turn it out. I don't think Bob Mould could hear him or cared. He was playing a solo. Frank unplugged him. Another time David Johansen played to a near empty house and I stood in front of the stage by myself. He came by me, made shoulder contact, and gave me a nod. It was the closest I had ever come to a rock star. My second rock star encounter happened when Elvis Costello was dating Steve Knaeble's (my roommate) sister, Katie Knaeble. He would come to her apartment late after the gig.
JJ: Did you know Jay Bernie?
AH: No. I only saw him once leaving the building one time. My cousins, Billy Peterson and Bobby Peterson played in Natural Life before the venue switched music direction. When Hartley took over there was this band war between the Horn and Duffys. I think Duffy's started it with demanding exclusivity. I don't know if Jay worked at Duffy's then.
JJ: What do you take away from the Jay's Longhorn experience?
AH: It was where I cut my music business teeth. It was Rock n Roll University 101. I don't put the Horn on the same level as my experience as Woodstock. However, both did impact the national music scene in unique ways. I feel fortunate that I got to partake. In all the excitement, I was inspired to record "Down in the Longhorn," which is based on the Animals "Down in Monterey."


text:
Home › News Center › SGS Certification for Lifting Equipment and Training Crane Operators
SGS Certification for Lifting Equipment and Training Crane Operators
Overhead cranes and rigging hardware are often regarded as safe to operate, but nevertheless, accidents happen. In Quebec, Canada alone, more than 600 lifting operations incidents at industrial and manufacturing facilities are reported yearly to the Occupational Health and Safety Commission.
The major factors that cause such incidents are insufficient training and experience in the operation of cranes and the use of worn, inappropriate or damaged equipment. Moreover, improper rigging practices, poor maintenance, lack of inspection procedures and operator errors can lead to the serious injury or death of workers and others involved.
In the province of Quebec, regulations on inspection and operations underwent changes in 2008. A new act concerning occupational health and safety (current version: July 15, 2008 and May 16, 2009) was announced, requiring that an overhead traveling crane must be operated exclusively by an operator who has received theoretical and practical training from an instructor.
In addition to this, the Canadian Standard Association revised the B167 standard to include a new section on safe operation. The current edition is the third edition published on October 1, 2008: CSA B167-08, Overhead Traveling Cranes - Design, Inspection, Testing, Maintenance and Safe Operation.
In 2008, SGS was appointed to evaluate the safety of lifting operations in a major copper foundry in Montreal in accordance with these new regulations. SGS first performed a thorough inspection of every overhead crane in the foundry, including Non-Destructive Testing (NDT) inspection on critical elements. This was followed by proof testing on all rigging hardware which included chain falls, chain slings, wire rope slings and blocks.
The assessment procedure was concluded with the Visual Inspection of synthetic slings and small hardware.
In addition to machinery certification, SGS provides training for crane operators and inspectors in accordance with the most up-to-date Canadian standards as well as all applicable international standards. In Montreal, over 300 operators have already received training on how to operate cranes safely.
As industrial inspection procedures directly affect safety, you can develop the best suitable conformity assessment procedure for your equipment and your target markets using the worldwide network of SGS Industrial Services for Product Certification.
Gerard Landry, Eng.
Director of Sales – Quebec
SGS Industrial Services Canada
SGS Canada Inc.
3420, St. Joseph Blvd East
Montreal (Quebec) Canada
H1X 1W6
t: +514 255 1679 ext: 362
m: +514 968 7446
f: +514 252 0071
The SGS Group is the global leader and innovator in inspection, verification, testing and certification services. Founded in 1878, SGS is recognized as the global benchmark in quality and integrity. With more than 56,000 employees, SGS operates a network of over 1,000 offices and laboratories around the world.
SGS Awarded a 10-Year Statutory Vehicle Inspection Contract in Albania
The Minister of Transport in Albania officially signed and awarded a 10-year Statutory Vehicle Inspection Contract to SGS SA.
SGS Competence Center Wind Energy Attends Wind Power Expo 2009 Conference and Exhibition in Zaragoza
The Wind Power Expo 2009 Conference and Exhibition in Zaragoza provided an excellent opportunity for the SGS Satellite Competence Center Wind Energy Spain to present its comprehensive Certification, Inspection and Testing Services. Attendees had a unique chance to learn about the services offered by SGS along the project life cycle of wind turbines such as wind farm project certification, blade inspection and condition monitoring.


text:
Movies, Family and kids
After seeing dozens of different permutations of Count Dracula over the years, you'd assume you knew everything about the aristocratic bloodsucker. Here's one thing you didn't know: This prince of darkness is quite the hospitality-industry bigwig. Genndy Tartakovsky's toon comedy turns the world's best-known non–Robert-Pattinson vampire (Adam Sandler) into a successful hotelier who runs a resort for the monstrosity crowd that's free of angry, pitchfork-wielding mobs. Drac is also an overprotective helicopter parent, refusing to let his 118-year-old daughter (Selena Gomez) out of the castle, or his sight. Then a handsome human backpacker (Andy Samberg) accidentally finds his way to this haven for the horrifying, and all hell breaks loose.
There's an impressive pedigree here: Tartakovsky was responsible for the amazing Samurai Jack and Dexter's Laboratory series; several Saturday Night Live veterans, including ace-in-the-hole writer Robert Smigel, lend their talents; Sony Animation has been making a name for itself with smart, savvy features like 2009's Cloudy with a Chance of Meatballs; and the durable Universal Horror stable—the fire-hating Frankenstein's monster, the howlin' Wolfman, the original Egyptian Lover, a.k.a. the Mummy—is diligently ransacked for laughs. (Why no one had previously milked the humorous potential regarding the flatulence of a creature made of stitched-together corpses is a mystery.)
So why does this animated kids' film fail to come together? Bursts of manic pacing steamroll over most of the wit, a little of Sandler's thick-accent shtick goes a looong way, and by the time the requisite life lessons about letting your offspring leave the nest get rolled out, the undead-on-arrival jokes are outnumbered by anemic sitcom gags. Tweens might appreciate the sugar-rush ghoulishness; Famous Monsters of Filmland fans and discerning kids-flick viewers may find themselves reaching for torches.
Follow David Fear on Twitter: @davidlfear
Posted: Monday September 24 2012
Friday September 28 2012


text:
Daniel Ward, DVM, PhD, DACVO
Professor | Small Animal Clinical Sciences
Dr. Ward was born and raised in the Frayser section of Memphis. He attended Christian Brothers High School and Christian Brothers College, where he majored in chemical engineering. He attended veterinary school at the University of Tennessee, after which he spent time in private small animal practice in Greenville SC. He did his ophthalmology residency, doctoral studies and post doc at the University of Georgia. He joined the University of Tennessee faculty in 1990. Dr. Ward lives with his wife and daughter on a small farm in East Tennessee, and his son is a senior at the University of Notre Dame. His interests outside the university include running, jazz music, farming, baseball, dabbling with antique cars and tractors, and the French existentialist movement of the mid-20th century.
dward@tennessee.edu
Diplomate - American College of Veterinary Ophthalmologists 1991
Residency in Ophthalmology, University of Georgia 1989
Post-doc - Clinical Pharmacology, University of Georgia 1990
PhD - Pharmacology, University of Georgia 1990
DVM -, University of Tennessee 1985


text:
Keynote Books
Rally Against Censorship
Carissa's Law
Boyd, Misty
Carissa's Law
Categories: Fiction
about Carissa's Law
Eighteen-year-old, Carissa Schultz, hangs between childhood and adulthood. While trying to navigate college, her health and her growing independence, she feels a calling on her life to change things for the generation following her. Born with a severe birth defect called spina bifida, Carissa has already overcome many challenges in her life, but can she find it in herself to follow her calling and keep her health in check while Isaac, a young man with dreams and ambitions of his own, is competing for her attention?
Misty Boyd was born in August of 1983 with spina bifida, the same birth defect as her main character, Carissa, in her novel, "Carissa's Law".
That You'll Love
Master of Deceit
Nueces Deceit
Defiance Press & Publishing is committed to promoting high-quality and thought-provoking books to readers by partnering with outstanding conservative and libertarian authors in politics, fiction, business, children's and non-fiction genres via alternative and traditional book distribution methods.
Why Defiance?
Copyright © Defiance Press & Publishing. All Rights Reserved


text:
BlogsCelebrityCelebrity Surrogacy
Supermodel Naomi Campbell, 50, announces birth of first baby
Naomi Campbell's Instagram followers were treated to a special surprise yesterday – a photo of her hand holding a newborn baby's feet.
If there was any doubt about the context, the caption explains it all. "A beautiful little blessing has chosen me to be her mother, so honoured to have this gentle soul in my life. There are no words to describe the lifelong bond that I now share with you my angel."
Naomi, one of the world's most renowned supermodels, has long spoken about her desire to have children, but she did not reveal that she was expecting. At 50, she has finally made her dream of motherhood come true. She has not revealed any details about the father, the circumstances around the birth, the birth date, or the baby's name.
Many of her famous friends rushed to offer their congratulations
Designer Marc Jacobs wrote, "Oh my God!!!!! Today is the day?? How absolutely incredible. How lucky she is and how lucky you are! What a wonderful Mother you will be. Blessings all around."
British Vogue editor Edward Enninful's regards were especially poignant, as Naomi was the first Black British model to appear on the cover of Vogue. He wrote, "Seeing the two of you together made my year. You will bring each other so much joy."
Naomi's mother, Valerie Morris Campbell, is overjoyed to have a new grandchild
She also posted on Instagram: "I'm beyond thrilled as I've waited a long time to be a grandmother." Other friends, including fellow models Laura Bailey, Mariacarla Boscono, Munroe Bergdorf, and Lily Aldridge, all wrote their own glowing messages on the post.
Back in a 2017 Evening Standard interview, Naomi opened up about her desire to become a mother, and her confidence that modern technology could help her achieve her dream. She said, "I think about having children all the time. But now, with the way science is, I think I can do it when I want." In 2014, she told designer Diane von Furstenberg that she "definitely" wanted children, even if she was single in the future.
A megastar and global icon, Naomi was discovered when she was a schoolgirl and went on to become one of the most famous women in the world. In addition to her massive body of work, she is also the founder of the Fashion For Relief charity.
Since Naomi's announcement yesterday, we've seen plenty of articles about other women who have had babies at a later age and who love their decision. Despite some "judgey, snippy comments," an iNews article exclaimed, "I had a baby later in life, and I'm loving it.
Naomi Campbell is far from the only celeb to have a baby over the age of 45
Halle Berry recently had a baby at 47, Janet Jackson at 50, Laura Linney at 49, and Kristen Wiig just had twins at 48!
We wish Naomi and her bundle of joy all the best – we're over the moon for her.
celebrity surrogacy Naomi Campbell baby at 50 older celebrity mothers
US changes law to recognise all surrogate children born abroad
Young mother with breast cancer fundraising for funds to freeze her eggs
CelebrityCelebrity SurrogacyHomeLGBT
Singer Lance Bass talks surrogacy plans
Former NSYNC singer and producer Lance Bass has spoken about his plans to have a family with husband, Michael Turchin The 39-year-old has said the couple have a doctor and surrogate in place and are ready to be parents...
BlogsEndometriosisFertility Research
Singapore sees increase in endometriosis cases, new study reveals
Singapore researchers have reported an increase in endometriosis diagnosis in 2021 The National University Hospital(NUH) has reportedly seen cases rise from 70 to 80 women a month in 2019, to 100 to 110 a month in 2021...
BlogsNewsNHS IVFNHS postcode lottery
Cambridgeshire CCG to reinstate NHS-funded IVF
Fertility campaigners are celebrating a small success after Cambridgeshire and Peterborough CCG agreed to reinstate NHS-funded IVF The Cambridgeshire and Peterborough CCG committee met to discuss the outcome of the...


My husband and I are expecting our first child in a couple weeks and we're trying to get Stori ready for the new member of the family. From the first day we got Stori we've always handled her as if a child would, pulling gently on her ears, jowls, tail, etc to get her to be okay with any kind of handling. We've had her around the bassinet, playpen, swing, and car seat so she gets used to them without baby using them, and we've taken her for walks with the stroller. I've carried things in my arms, to mimic holding a baby, and have played youtube sounds of newborns crying for her to get used to those as well.
Our plan after baby is born, before we bring him home from the hospital, is that my husband will come home (we live 2 minutes away from the hospital) with a blanket that smells like baby and introducing the blanket to Stori first.
Any other tips and advice or experiences?
When we first brought Olivia home we put her right in the pack and play and then let the dogs come up and sniff her. She was in a safe place and they could have access to her. They were obvioulsy curious as to what this new crying wiggling thing was...but were very gentle with her. We of course were there at all times to supervise when the dogs were in the room. Another good way is to put the baby in a swing and let the Stori sniff her on her own.
They also say for you to go in when you get home from the hospital and greet the dog first, because she will be excited to see you since you have been gone a couple days. Then have your husband bring the baby in when she is calmed down.
My only other advice is to just include her in everything, don't make her feel like she's being blocked from the baby. The more she is around the baby the better she will and the more it will be just old news.
I agree with Kristin and congrats on the new baby..
Thanks very much ladies We are pretty excited.
Kristen, I love the pictures.
Stori has been around lots of kids before and she's very curious about them, especially the ones her size. She's good with them but they go home at the end of the day, lol. There was one day I was hosting a bridal shower for a friend and one of the guests brought their infant along and put the carseat with the baby in it on the chair. Stori walked up to the carseat and sat down and rested her head on the baby's legs, and just stared. So freaking cute.
Aww how cute! I think she will be just fine then! The trainer told me that she worries more about toddler interaction with dogs then infants. Once they start becoming mobile is when the real trouble can start...the pulling, the climbing, etc. I think as long as you are aware of what the baby and dog are both doing you will be fine.
Sounds like she will be fine.
Congratulations! How exciting! Be sure to keep us posted, and we'll need photos of that new baby too!


Oregon's Senate voted Tuesday by 17-12 to pass a bill aimed at moving away from the electoral college and awarding the presidency to the nationwide popular vote winner, the Oregonian reports.
Why it matters: There's a growing movement toward voting changes. The state would join 14 others and the District of Columbia in the National Popular Vote interstate compact if the Oregon House approves the bill and signs it into law. Most 2020 Democratic hopefuls are sponsoring or considering plans to dismantle the electoral college.


Let's camp under a Full Pink Moon, with Mt. Blanca and the Great Sand Dunes within view. Immerse yourself in Mother Nature and reconnect with yourself.
You will arrive Friday afternoon at our 'primitive' campsite at Rabbit Hole Ranch. After pitching your tent and getting settled, you'll enjoy a 'Full Pink Moon Dinner' in front of our meeting tent. Dinner will be provided for you.


text:
Police Launch Probe Into Disneyland Brawl Caught On Viral Video
Kailash Satyarthi On 'Kailash' Doc & His Global Mission To Rescue Children From Slavery — Sundance Studio
By Matt Grobar
Matt Grobar
Assistant Editor, Awardsline
More Stories By Matt
'Russian Doll' Co-Creators Natasha Lyonne & Leslye Headland Discuss The Triumph Of 13 Emmy Nominations & The Status Of Season 2
Julia Louis-Dreyfus, Anna Chlumsky & Showrunner David Mandel Discuss 'Veep's Swan Song Emmy Noms & Leaving "The Satire Of This Decade" Behind
Working closely with Oscar-winning documentarian Davis Guggenheim for a number of years, Derek Doneen found the inspiration for his feature directorial debut in contacts the director had made.
Following world-renowned Pakistani activist Malala Yousafzai in the making of He Named Me Malala, as she was preparing to accept the Nobel Peace Prize, Guggenheim met children's rights activist Kailash Satyarthi, who shared that honor with his documentary subject. Meeting Satyarthi, Guggenheim saw an individual whose work should be celebrated and spotlighted with a film.
The founder of the Bachpan Bachao Andolan (Save Childhood Movement), as well as the Kailash Satyarthi Children's Foundation and the Global March Against Child Labour, Satyarthi has consistently put himself in harm's way while liberating more than 86,000 children in India from child labor, slavery and trafficking, all the while advocating strongly for children's medical care and education, creating the change he wishes to see in the world.
Morgan Neville On His Mister Rogers Sundance Docu, New Netflix Series & Civility
"I was shocked to read about Kailash and his work because I didn't know anything about it," Doneen admitted, sitting down with Satyarthi and producer Sarah Anthony at Deadline's Sundance Studio. "I didn't know the pervasiveness of this issue and immediately was [struck] by how inspiring he is, the movement he's built on a global level."
"Thrilled" by the prospect of having his work captured in a film, Satyarthi's only drive was to bring child slavery into the global discourse. "People must understand that slavery has not yet been abolished, and there are people—very ordinary people—who are fighting to end slavery, and especially child slavery and child labor," the activist said.
To hear more from Deadline's conversation with the Kailash team—as they discuss the harrowing circumstances inherent to Satyarthi's rescue missions—click above.
The Deadline Studio at Sundance 2018 is presented by Hyundai. Special thanks to Calii Love.
Derek Doneen
Sundance Studio
Anchor Norah O'Donnell Closes First 'CBS Evening News' Broadcast With Pledge To Edward R. Murrow
'Carrier' Podcast First Trailer: Upcoming Thriller Stars 'Bad Times At The El Royale's Cynthia Erivo
'Mulan' Teaser Trailer Logs Epic 175M+ Views In First 24 Hours, Including 52M From China


istics of an ideal screening test are outlined and the authors pose several questions for clini- cians and scientists to consider in the evaluation of current and future studies of �... The test anxiety construct is too narrow to capture these features of examination stress, but at the same time, owing to its lack of specificity, this broad notion of examination stress is not always helpful.
MC0-001 Test Simulator & Comptia Actual MC0-001 Test Pdf - Certified Mission Critical Operator Exam - Realtalkplasticsurgery Written by patty@dragonflystrategy.com Posted in Rhinoplasty Comments 0 Therefore, modern society is more and more pursuing efficient life, and our MC0-001 Test Simulator exam materials are the product of this era, which conforms to the development trend of the whole era. dope 4 bird personality test pdf Critical Evaluation of a Screening Test for Detection of Herbicides 25 1 ~o aqueous; Tween 80-glycerol solution: 0.5 ml Tween 80 (Fa.
NCLEX-RN examination test items are written within each level within Bloom�s taxonomy, however more questions are at the application and analysis level (Masters et al, 2001). Despite the advantages for using MCQ�s, there are challenges.
The injury evaluation process must include several key components�namely, taking a history of the current condition, visually inspecting the area for noticeable abnormalities, physically palpat- ing the region for abnormalities, and completing functional and stress tests.
MC0-001 Test Simulator & Comptia Actual MC0-001 Test Pdf - Certified Mission Critical Operator Exam - Realtalkplasticsurgery Written by patty@dragonflystrategy.com Posted in Rhinoplasty Comments 0 Therefore, modern society is more and more pursuing efficient life, and our MC0-001 Test Simulator exam materials are the product of this era, which conforms to the development trend of the whole era.


Yeshua Ha Mashiach - as your personal Lord and Savior, you can do so right now by faith through prayer!
"Lord Jesus, I need you. Thank You for dying on the cross for my sins. I repent of my sins and turn away from them. I open the door of my life and receive You as my Savior and Lord. Come into my heart Lord Jesus. Thank You for forgiving my sins and giving me eternal life. Take control of my life and make me the kind of person You want me to be. Amen."
If you prayed this prayer or a similar prayer, and meant it sincerely, Christ has now come into your heart, just as He promised, and you now have the blessed assurance of eternal life. You are now a child of God and can come boldly before our heavenly Father in prayer.
May the Lord of all Creation bless you always.
Now click on the icon below and find out what to do next.


Difference between revisions of "Schedules/KDE4/4.6 Release Schedule"
KDE SC 4.6 is a feature release for KDE SC 4. All dates given here are subject to revision, but we will try our best to stick to them if possible. The KDE Release Team is acting as the coordinator for this release.


Wondering if anyone can help me troubleshoot a problem with my S7, I've tried a lot of different options but still having no luck and I'm thinking I might just have to take it in for repair.
I've had this S7 for over two years now and it worked fine up until the last 6 months or so. My phone would overheat constantly when I was on the London underground. The phone wouldn't last longer than maybe 60 seconds at most before restarting itself. I had to turn it off, take off the case and let it cool down because it was burning hot. Similar thing happened when on holiday in Sri Lanka.
However, now, it does this constantly, regardless of where I am. I haven't turned it on for the last month because it's unusable. I don't want to get into conspiracy theories but it's quite the coincidence this happened the day I cancelled my Vodafone contract.
So I've tried turning it on in a cool environment, I've tried it in safe mode, I've tried clearing the cache partition - I've tried everything I can really apart from doing a hard reset.
Has anyone else experienced this? It sounds like it's a battery fault. In which case, can I get a free repair given it's a manufacturer's fault?
Are you still experiencing this issue? We'd highly recommend visiting your nearest Support Centre to have an engineer look into this for you further. As you have exceeded the 24 month warranty repair, please note that any repair carried out will be chargeable. Here's a link to help locate your nearest Support Centre.


text:
NEEDSHES
The Central Asian country of Uzbekistan is the homeland of Otabek Salamov (Bek), songwriter, composer, multi-instrumentalist, producer, and founder of the alternative rock/indie-pop band NEEDSHES. Currently based in Moscow, the band – rounded out by Ivan Petukhov (guitar) and Alexey Manakhov (drums) – continues to expand their eclectic style rooted in David Bowie, Queen, and James Brown in 2020.
Bek started his musical journey in early childhood. He attended the music academy in his hometown, Tashkent, where he was awarded the first national prize for his precision on clarinet at the age of 13. As a teen, his interests varied, and he was drawn to compose and perform metalcore in night clubs with cross paint on his face. At that time, Bek was working as an assistant audio engineer in local studios, so he quickly adapted to recording and producing his own music. One day he decided to dilute it with melodic undertones. In the process of creating this transition, he realized that the switch was something that gravitated to his liking.
In 2013 he founded a melodic rock project, NEEDSHES, and moved to Moscow. His biggest influences stemmed from The Killers, Jack White, James Brown, David Bowie, Queen, RHCP, U2, a-ha, Coldplay, Nirvana.
Otabek gathered a full traditional formation around his brainchild with the intent to create authentic rock music. In 2016 after several line-up changes, Ivan (guitar) and Alexey (drums) joined him and made it possible for the sound created in the studio to fully sound live.
Don't Make Me Cry (Animated Music Video)


I'm currently working on an Arduino project where I need to keep track of entries for a certain amount of time, in this case, 30 days. Our company will attempt to sell this product to cities and governments. Therefore it really has to just work, which makes me want to refrain from dynamically allocating memory.
The entries are really small, they (currently) consist out of a single char, but they might get bigger before the end of this project. An entry will be generated every specific interval, for now I am assuming this to be once every 5 minutes.
This product has to keep running for way more than 50 days in a row, it should be able to stand for a couple years with only the bare minimum on maintenance. So I'll have to deal with this overflow. If the timer would overflow at, say, exactly TOTAL_ENTRIES_TO_KEEP * MILLISECONDS_PER_ENTRY this would be no problem, as then it would overflow from entry 4999 to 0, which is what I do with %TOTAL_ENTRIES_TO_KEEP anyways. Point is, it doesn't, and messing with the internal libraries to make it do so would not seem like the best idea to me.
I do not care about a slight deviation in the interval between entries, nor in the total amount of entries to keep. This system needs to show an average of entries over a monthly period, which is already ambiguous, so whether a month to the system lasts 30, 31, 32 or 30.94836 days does not matter to the end result.
How could I protect this system against the effects of this overflow? Thanks in advance for your input.
If you insist on using millis() to index the array, then you either have to make the array size a factor of the max millis() value, or you have to reset the millis() value to zero when your array wraps. But these seem like bad ideas and I don't understand why you are using millis() to index the array.
Think of the array as a circular (ring) buffer. Create a variable that represents the current index value into the array. The current index gets incremented every time an entry is stored. When the array is full the index value wraps to zero. Use this index variable to index the array instead of millis(). You can still store entries at the same rate but now you've disassociated the millis() value from the array index.
The key to this is to extend the range of the counter that you are using to track time.
Just keep a "number of overflows" 32bit counter that you increment each time the millis() value wraps, and use your counter and the millis() value to form a 64-bit counter -- that will give you a wrap time of 50 * 2^32 (or about 200 billion) days -- probably longer than you can expect your device to keep functioning.
You can detect the overflow by keeping track of the last value of millis() you got, and if the current value is smaller, then you increment your "number of overflows" counter.
You'll have to be sure to call this routine at least once every wrap period.
Not the answer you're looking for? Browse other questions tagged c++ algorithms embedded-systems or ask your own question.
Do Databases Optimize Queries with Sum/Average or Other Aggregates?
How to create single integer index value based on two integers where first is unlimited?