This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VBox -> File -> Host Network Manager (Ctrl-W) | |
| Configure Adapter Manually | |
| IPV4 Address: 192.168.56.1 | |
| IPv4 Mask: 255.255.255.0 | |
| IPv6 Address: fe80::grayed out | |
| IPv6 Prefix Ln: 64 | |
| VBox -> Settings -> Network | |
| Attached to: Host-only Adapter | |
| Name: VirtualBox Host-Only Ethernet Adapter #2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: extensions/v1beta1 | |
| kind: DaemonSet | |
| metadata: | |
| namespace: kube-system | |
| name: node-custom-setup | |
| labels: | |
| k8s-app: node-custom-setup | |
| annotations: | |
| command: &cmd apt-get update -qy && apt-get install -qy tgt ceph-fs-common ceph-common xfsprogs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution(object): | |
| def longest_k_sum(self, lst, k): | |
| kv = {0: -1} | |
| sum_val = 0 | |
| ans = 0 | |
| for i in range(len(lst)): | |
| sum_val += lst[i] | |
| if not kv.get(sum_val): | |
| kv[sum_val] = i | |
| if kv.get(sum_val - k) is not None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| class Employee(object): | |
| def __init__(self): | |
| self.id = random.randint(10) | |
| def get_employee_id(self): | |
| return self.id | |
| class Project(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # beginWord = "hit" | |
| # endWord = "cog" | |
| # wordList = ["hot","dot","dog","lot","log","cog"] | |
| # As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog", | |
| # return its length 5. | |
| # | |
| class Vertex(object): | |
| def __init__(self, id): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Complete the function below. | |
| import operator | |
| def dfs(grid_matrix, i, j): | |
| if i > len(grid_matrix) - 1 or i < 0 or j > len(grid_matrix[0]) - 1 or j < 0: | |
| return | |
| if grid_matrix[i][j] == 'N': | |
| return | |
| grid_matrix[i][j] = 'N' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Check if image iso(s) already exist | |
| stat: | |
| path: "/var/www/pxe/iso/{{ item.value.image_name }}" | |
| register: existing_file | |
| with_dict: "{{ images }}" | |
| - name: Veirfy the md5 of exisiting iso(s) | |
| block: | |
| - set_fact: | |
| md5_result: "{{ md5_result|default({}) | combine( { item.item.key : item.stat.md5} ) }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| unshared () { | |
| grep '^[0-9]\+$' "$1" > /dev/null | |
| } | |
| for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do | |
| echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]" | |
| if ! unshared $cpu/topology/core_siblings_list; then | |
| echo " same package as $(cat $cpu/topology/core_siblings_list)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| mkdir -p ~/Project/splunk | |
| cd ~/Project/splunk | |
| git clone -b 7.0.1 https://github.com/splunk/docker-splunk.git | |
| cd docker-splunk/enterprise/ | |
| docker build -t splunk/splunk:7.0.1 . | |
| docker-compose up & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PS1='[\[\e[32m\]#\##\[\e[31m\]\u@\[\e[36m\]\h \w]\$\[\e[m\]' |
NewerOlder