Skip to content

Instantly share code, notes, and snippets.

View un1xman's full-sized avatar
💭
I may be slow to respond.

un1xman un1xman

💭
I may be slow to respond.
  • Sectigo
  • Baku,Azerbaijan
View GitHub Profile
@un1xman
un1xman / a-aide.sh
Created May 1, 2021 22:35
Aide Automation for LInux Servers
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
change_var=$(/usr/sbin/aide --check | tee -a "$SCRIPT_DIR"/temp.log | grep "differences between")
current_date=$( date +%Y%m%d)
if [ "$change_var" == "" ]
then
echo "everythink ok"
else
echo -e "\e[31m ================================================================================ \e[0m" >> "$SCRIPT_DIR"/report-"$current_date".log
/usr/sbin/aide --check >> "$SCRIPT_DIR"/report-"$current_date".log
@un1xman
un1xman / c_switch.py
Created May 1, 2021 22:34
Working Network Switches with Python
#Importing modules
import paramiko
import sys
import time
#setting parameters like host IP, username, passwd and number of iterations to gather cmds
HOST = "10.11.214.143"
USER = "admin"
PASS = "passwd"
ITERATION = 3
@un1xman
un1xman / create_db_table.py
Created May 1, 2021 22:32
Create MySql database and table with python
import mysql.connector
import os
#def connect():
db_server_host=input(str("Enter database server hostname or ipaddress: "))
db_user=input(str("Enter database user: "))
db_passwd=input(str("Enter password: "))
my_database=input(str("Enter database name: "))
#mydb = null
def connect(db_server_host,db_user,db_passwd,my_database):
return mysql.connector.connect(
@un1xman
un1xman / main.tf
Created May 1, 2021 22:29
Terraform Google Cloud PubSub Module
resource "google_pubsub_topic" "example" {
name = "example-topic"
}
resource "google_pubsub_subscription" "example" {
name = "example-subscription"
topic = un1x-topic
labels = {
foo = "bar"