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" | |
"os" | |
"github.com/spf13/cobra" | |
"github.com/spf13/viper" | |
) |
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
services: | |
zookeeper: | |
image: jplock/zookeeper | |
container_name: kafka-zk | |
ports: | |
- "9092:9092" | |
- "9093:9093" | |
- "9094:9094" | |
- "2181:2181" |
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
from concurrent.futures import ProcessPoolExecutor | |
import asyncio | |
import signal | |
import sys | |
import socket | |
async def read_client(client, wid, sid): | |
loop = asyncio.get_event_loop() |
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
from concurrent.futures import ProcessPoolExecutor | |
import asyncio | |
import signal | |
import sys | |
def worker(wid): | |
def handler(signum, frame): | |
print("Exit signal in worker {}".format(wid)) |
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
import smtpd | |
import asyncore | |
class MailServer(smtpd.SMTPServer): | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
print("----------message recieved-----------") | |
print("peer: {}".format(peer)) |
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
local GRID_X = 10 | |
local GRID_Y = 10 | |
local COMPARE_SLOT = 1 | |
local FUEL_SLOT = 2 | |
local SAPLING_SLOT = 3 | |
local x_pos = 0 | |
local y_pos = -1 |
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 | |
set -e | |
sudo echo "deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update |
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
uint8_t tmpKey[7]; | |
key_64to56(tmp.mes_char, tmpKey); | |
for ( int j = 0; j < 7; j++) { | |
cout << hex << setfill('0') << setw(2) << (uint64_t)tmpKey[j]; | |
} |
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
NoErrorArgParse = type("NoErrorArgParse", argparse.ArgumentParser.__bases__, copy.deepcopy(dict(argparse.ArgumentParser.__dict__))) | |
NoErrorArgParse.error = lambda: None | |
NoErrorArgParse.exit = lambda: None |