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 | |
# | |
# After noticing a bunch of weird psql processes running on my server I decided all of them needed to die. | |
# This is what this script is for. | |
# Just put the following line (without the "# " at the beginning) into your crontab, this process in /usr/bin/antivir-psql.sh. | |
# and make it executable only for the owner (readable for the owner as well). If you want to disable the conditional disable, just remove | |
# the lines starting with if and fi. If you want to disable the antivirus for some time, just drop a /antivir-disabled file. Remember | |
# to edit it out when you're gone. And there goes the fabulous crontab line: | |
# |
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/python3 | |
import os | |
import sys | |
""" | |
A tool to copy a named snapshot of a cassandra to a target rsynced thing. | |
Will use ssh to create target directories | |
Requires: rsync ssh |
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 math | |
from dataclasses import dataclass | |
__all__ = ['get_distance', 'Coordinates'] | |
@dataclass | |
class Coordinates: | |
""" | |
A set of coordinates on Earth | |
""" |
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
#include <windows.h> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
#include <lua.hpp> // hpp to plik nagłówkowy C++, taki ukłon w naszą stronę ze strony autorów Lua | |
extern "C" // lua jest pisana w C, uzyj wiec odpowiedniego importu | |
{ | |
#include "lualib.h" | |
#include "lauxlib.h" | |
} |
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
# Python 2 | |
# -*- coding: utf-8 -*- | |
'''Komunikacja MODBUS i kod Kolekcjonera Frisko''' | |
from __future__ import division | |
import struct | |
import socket | |
from threading import Thread | |
from threading import Timer | |
import datetime | |
import os |
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
# Python 2 | |
import socket # System lacznosci sieciowej | |
import WConio # System obslugi konsoli tekstowej | |
import msvcrt # Obsluga klawiatury, ta w WConio wydaje sie nawalac | |
from array import array # Edycja stringow (stringi w Pythonie sa niemodyfikowalne) | |
from struct import pack # Niezbedne do skladania pakietow w calosc | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Korzystamy z zestawu protokolow Internetowych, | |
# gniazdo strumieniowe | |
host = raw_input("Give the address (demo version - type DEMO): ") |
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
program TOFF; | |
uses | |
Registry, Windows; | |
var | |
r: TRegistry; | |
h1, min1, h2: Integer; | |
st: _SYSTEMTIME; | |
godown: Boolean; |
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
/* | |
* Copyright (C) 2021 Dronehub Group sp. z o. o. | |
* | |
* This file is free software; you can redistribute it and/or modify it | |
* under the terms of the MIT license. | |
*/ | |
#ifndef _CPUID_H_INCLUDED | |
#define _CPUID_H_INCLUDED |
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 | |
# | |
# This accepts a two commandline arguments, ie | |
# * the IP address of the host that is to become the node, | |
# * comma-separated list of hosts that are to be seed nodes | |
# | |
docker run --restart always --name cassandra -v /v2/var/lib/cassandra:/var/lib/cassandra -e GC=G1 -e I_ACCEPT_ORACLE_JAVA_LICENSE=1 -e "CLUSTER_NAME=SMOK4 Production" -e MAX_HEAP_SIZE=16G -e HEAP_NEWSIZE=3000M -e "SEED_NODES=$2" -e NUM_TOKENS=256 -e LISTEN_ADDRESS=$1 -e BROADCAST_ADDRESS=$1 -e RPC_ADDRESS=$1 -e RPC_BROADCAST_ADDRESS=$1 -e STREAMING_SOCKET_TIMEOUT_IN_MS=360000000 -e LOCAL_JMX=no -e JMX_REMOTE_PASSWORD=cass -e DISABLE_JOLOKIA=1 -e KEY_CACHE_SIZE_IN_MB=256 -e FILE_CACHE_SIZE_IN_MB=2560 -e JAEGER_AGENT_HOST=$1 -e JAEGER_TRACE_KEY=jaeger-trace -e ROW_CACHE_SIZE_IN_MB=256 -e BATCH_SIZE_FAIL_THRESHOLD_IN_KB=500 -e TOMBSTONE_FAIL_THRESHOLD=1000000 --cpus=30 -d --network=host smokserwis/cassandra |
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 socket | |
import struct | |
import threading | |
class SocketThread(threading.Thread): | |
def __init__(self, sock): | |
super().__init__() | |
self.socket = socket | |
def recv_all(self, length: int) -> bytearray: |
NewerOlder