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 | |
set -uxeo pipefail | |
# https://docs.conda.io/en/latest/miniconda.html#linux-installers | |
# warning, creates ~/.conda dir, you can delete it manually | |
############################################### | |
# setup variables | |
############################################### |
First download alpine-make-vm-image from https://github.com/alpinelinux/alpine-make-vm-image
wget https://raw.githubusercontent.com/alpinelinux/alpine-make-vm-image/v0.4.0/alpine-make-vm-image \
&& echo '5fb3270e0d665e51b908e1755b40e9c9156917c0 alpine-make-vm-image' | sha1sum -c \
|| exit 1
mv alpine-make-vm-image /usr/local/bin/
chmod +x /usr/local/bin/alpine-make-vm-image
Create a new alpine qcow2 image
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 python3 | |
import lxml.html | |
import urllib.request | |
from pathlib import Path | |
import requests | |
telegram_bot_token = "FIXME" | |
telegram_group_name = "@kvetinac" |
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 ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%[email protected]' % username |
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 | |
#Paths are for Centos 7.x | |
#stop logging services | |
/sbin/service rsyslog stop | |
/sbin/service auditd stop | |
#remove old kernels | |
/usr/bin/package-cleanup --oldkernels --count=1 |
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/awk -f | |
# Sample 1: 3141,"Smith, John",$52000 | |
# col[0] = 3141 | |
# col[1] = Smith, John | |
# col[2] = $52000 | |
# Sample 2: 3141,"John ""The Rocket"" Smith",$52000 | |
# col[0] = 3141 | |
# col[1] = John "The Rocket" Smith | |
# col[2] = $52000 | |
head = $0 { |
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
val grpcJavaVersion = "1.3.0" | |
val downloadJGrpc = { | |
val grpcArtifactId = "protoc-gen-grpc-java" | |
val jgrpcExeFileName = { | |
val os = if (scala.util.Properties.isMac) "osx-x86_64" | |
else if (scala.util.Properties.isWin) "windows-x86_64" | |
else "linux-x86_64" |
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
# env | |
export KAFKA_HOST="my.kafka.hostname" | |
export KAFKA_OPTS="-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf" | |
# create topics | |
kafka-topics --create --topic securing-kafka --replication-factor 1 --partitions 3 --zookeeper $KAFKA_HOST:2181 | |
# producer acl | |
kafka-acls --authorizer-properties zookeeper.connect=$KAFKA_HOST:2181 --add --allow-principal User:kafkaclient --producer --topic securing-kafka |