Skip to content

Instantly share code, notes, and snippets.

@alikulov
alikulov / na_ontap_pb_upgrade_firmware_disk.yml
Created May 28, 2020 15:41
Examle Ansible playbook for ONTAP disk firmware update
---
- name: ONTAP Firmware Upgrade
hosts: localhost
gather_facts: no
collections:
- netapp.ontap
vars_prompt:
- name: "ontap_admin_username"
private: no
prompt: "Enter your ONTAP admin username"
@alikulov
alikulov / .flake8
Created August 5, 2019 14:13 — forked from krnd/.flake8
(Python) Flake8 configuration file
# .flake8
#
# DESCRIPTION
# Configuration file for the python linter flake8.
#
# This configuration is based on the generic
# configuration published on GitHub.
#
# AUTHOR krnd
# VERSION v1.0

I've been working with Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@alikulov
alikulov / dockerCommands.md
Created April 26, 2019 10:41 — forked from girishrau/dockerCommands.md
[Docker commands] Docker commands #docker

List all stopped containers

docker ps -a -f status=exited

Delete all stopped containers

docker rm $(docker ps -a -f status=exited -q)
REG ADD HKLM\SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device /v DriverParameter /t REG_SZ /d "RequestRingPages=32,MaxQueueDepth=254"

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@alikulov
alikulov / service.sh
Created August 4, 2018 14:37
linux service wrapper
#!/bin/sh
SERVICE_NAME=MyService
PATH_TO_JAR=/usr/local/MyProject/MyJar.jar
PID_PATH_NAME=/tmp/MyService-pid
case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
nohup java -jar $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null &
echo $! > $PID_PATH_NAME

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@alikulov
alikulov / installDante.sh
Created April 13, 2018 22:04 — forked from Fire-/installDante.sh
Basic Dante Socks5 Server Setup and Configuration
# Basic Dante Socks5 Setup, Debian
apt-get update
apt-get install make gcc
cd /usr/src
# get newest from http://www.inet.no/dante/download.html
wget http://www.inet.no/dante/files/dante-1.4.1.tar.gz