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
void main(void) { | |
int pole[5]; // tady mas staticky definovany pole pro 5 cisel, "pole" je typu "int *" | |
int pole2[5]; // "pole2" je typu "int *" (pointer(==adresa) na int) | |
// vztah pole a pointeru | |
// takhle se na nejaky volny adrese vyhradi pamet pro 5 cisel | |
// malloc == "memory allocation" fce | |
int *pole3; // definice pointeru - pointer je hodnota adresy v pameti, v tuhle chvili nejaka nedefinovana (pole3 je typu "int *") | |
pole3 = malloc(5* sizeof(int)); // ted je to uplne to samy jako "int pole3[5]" |
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
class Server | |
SOCKET_PATH = "/tmp/receptor.sock".freeze | |
DELIM = "\x1b[K".freeze | |
def initialize | |
@proxy = SurroGate.new | |
@transmitter = Thread.new do | |
loop do | |
@proxy.select(1000) |
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
# Red Hat Header | |
plain_rh_identity="{\"identity\":{\"account_number\":\"test-mock\"}, \"internal\": {\"org_id\": \"54321\"}}" | |
export X_RH_IDENTITY=$(echo ${plain_rh_identity} | base64 --wrap=0) | |
# Sources API service | |
# Create routes in openshift to get these hosts | |
export SOURCES_API_SERVICE_HOST="http://localhost" | |
export SOURCES_API_SERVICE_PORT=3002 | |
export SOURCES_API_BASE_PATH="api/sources/v1.0" |
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 | |
export X_RH_IDENTITY="{\"identity\":{\"account_number\":\"test\"}}" | |
base64_rh_identity=$(echo ${X_RH_IDENTITY} | base64) | |
# Topological API service | |
export TOPOLOGICAL_INVENTORY_API_SERVICE_HOST="http://topological-inventory-api-test-mslemr.10.8.96.54.nip.io" | |
export TOPOLOGICAL_INVENTORY_API_SERVICE_PORT=80 | |
export BASE_PATH="api/topological-inventory/v0.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
#!/usr/bin/env bash | |
source "config" | |
# Usage: api_get <path> | |
# Example: api_get "source_types?filter[name]=mock" | |
function api_get { | |
if [[ -z $2 ]]; then | |
api_path=${BASE_PATH} | |
else |
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 ruby | |
# | |
class Integer | |
alias_method :old_multiply, :* | |
def *(num) | |
m = method(:old_multiply).unbind | |
m.bind(3).(num / self) | |
end | |
end |
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 --login | |
# Usage: update_tp-inv.sh [update] | |
source "$HOME/.rvm/scripts/rvm" | |
# Script for creating/updating topology inventory plugins | |
cd /home/mslemr/Projects/topological-inventory |
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 | |
# Script for creating/updating topology inventory plugins | |
# @param --clone for cloning and set upstream | |
# | |
# TODO: Change to your existing directory | |
# | |
cd /home/mslemr/Projects/topological-inventory |
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
repositories=("topological_inventory-api" | |
"topological_inventory-core" | |
"topological_inventory-ingress_api" | |
"topological_inventory-ingress_api-client-ruby" | |
"topological_inventory-collector-amazon" | |
"topological_inventory-collector-mock" | |
"topological_inventory-collector-openshift" | |
"inventory_refresh") |
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 --login | |
source "$HOME/.rvm/scripts/rvm" | |
INGRESS_API_SVC_DIR=/home/mslemr/Projects/topological-inventory/topological_inventory-ingress_api | |
PERSISTER_SVC_DIR=/home/mslemr/Projects/topological-inventory/topological_inventory-persister | |
rvm use 2.4 | |
rvm gemset use tp-inv |
NewerOlder