Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 | |
#### Functions ### | |
display_usage() { | |
echo "This script must be run with Docker capable privileges and you should login to your registry before pushing!" | |
echo -e "\nUsage:\n$0 <saved_image> [--push]\n" | |
echo -e " <saved_image>\t\t\tThe image file to load and push" | |
echo -e " [--push]\t\t\tPush to registry" | |
echo -e "\nExample: $0 /mydir/ubuntu.tar --push " | |
} |
This file contains 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
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted --add-source=94.204.104.194/32 | |
success | |
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted --add-source=94.206.104.194/32 | |
success | |
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted | |
success | |
[root@ip-11-0-0-239 centos]# firewall-cmd --list-sources | |
You're performing an operation over default zone ('public'), | |
but your connections/interfaces are in zone 'trusted' (see --get-active-zones) | |
You most likely need to use --zone=trusted option. |
This file contains 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type test_struct struct { | |
Test string |
This file contains 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
--- | |
- hosts: all | |
gather_facts: no | |
vars: | |
string: "string" | |
list: | |
- item1 | |
- item2 | |
dict: | |
key1: value1 |
This file contains 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
# Pass the env-vars to MYCOMMAND | |
eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
# … or ... | |
# Export the vars in .env into your shell: | |
export $(egrep -v '^#' .env | xargs) |
This file contains 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
Command to run: | |
ssh -L 2222:localhost:8501 user@remoteserver.com | |
where 2222 is the local port mapping it can be any number above 1000 | |
where localhost must be set to localhost and refers to your current connection | |
where 8501 is the port you will be opening up on the remote machine | |
where user@remoteserver.com is the first hop in your quest for internal access |
This file contains 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
# Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html | |
# Rewritten for Python >=3.4 | |
import asyncio | |
import random | |
@asyncio.coroutine | |
def produce(queue, n): | |
for x in range(n): |
This file contains 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 | |
# # | |
# # Install main dependencies on CentOS: | |
# # Python 3.4.5, CMake 3.10.0, OpenCV 3.3.1 | |
# # Author Andrii Lundiak (landike@gmail.com) | |
# # | |
# https://github.com/ageitgey/face_recognition/issues/191 | |
# https://github.com/opencv/opencv/issues/8471 |
This file contains 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
NewerOlder