Disable:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
| def knapsack_aux(x: (Int, Int), is: List[Int]): List[Int] = { | |
| for { | |
| w <- is.zip(is.take(x._1) ::: is.take(is.size - x._1).map(_ + x._2)) | |
| } yield math.max(w._1, w._2) | |
| } | |
| def knapsack_rec(xs: List[(Int, Int)], is: List[Int]): List[List[Int]] = { | |
| xs match { | |
| case x :: xs => knapsack_aux(x, is) :: knapsack_rec(xs, knapsack_aux(x, is)) | |
| case _ => Nil |
| [core] | |
| # The home folder for airflow, default is ~/airflow | |
| airflow_home = /Users/p1nox/airflow | |
| # The folder where your airflow pipelines live, most likely a | |
| # subfolder in a code repository | |
| dags_folder = /Users/p1nox/airflow/dags | |
| # The folder where airflow should store its log files. This location | |
| base_log_folder = /Users/p1nox/airflow/logs |
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def hello(): | |
| await asyncio.sleep(3) | |
| print('Hello!') | |
| if __name__ == '__main__': | |
| loop.run_until_complete(hello()) | |
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| def xpath_soup(element): | |
| # type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str | |
| """ | |
| Generate xpath from BeautifulSoup4 element. | |
| :param element: BeautifulSoup4 element. | |
| :type element: bs4.element.Tag or bs4.element.NavigableString |
Disable:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Disable:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
| # https://pypi.python.org/pypi/kafka-python | |
| from kafka import TopicPartition | |
| from kafka import KafkaConsumer | |
| topic_name = 'test-01' | |
| group_id = 'test-consumer-01' | |
| KAFKA_BROKER_LIST="10.2.65.197:9092,10.2.67.55:9092,10.2.91.23:9092" | |
| # option 1 |
| #!/bin/bash | |
| ################ | |
| # Uncomment if you want the script to always use the scripts | |
| # directory as the folder to look through | |
| #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| REPOSITORIES=`pwd` | |
| IFS=$'\n' |
| oc project kubernauts | |
| podname=$(oc get pods | grep postgres-$(oc get dc postgres -o jsonpath='{.status.latestVersion}') | grep -v deploy | grep Running | awk '{print $1}') | |
| oc rsh -c postgres $podname | |
| OR | |
| oc get pods | grep postgres | |
| oc exec -it postgres-pod-name bash | |