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
package main | |
import ( | |
"fmt" | |
"syscall" | |
"github.com/shirou/gopsutil/v3/process" | |
) | |
var print = fmt.Println |
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
search_dir=/usr/share/nano/*.nanorc | |
nano_file=/.nanorc | |
for entry in `ls $search_dir`; do | |
echo include "'${entry}'" >> $nano_file | |
done | |
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 click | |
import requests | |
ZONE = "<zone>" | |
API_VERSION = 4 | |
TYPE_TYPES = list(set(["CAA","A","AAAA","CNAME","URI","MX","SRV","URI","TXT","CERT","DS","HTTPS","LOC","NAPTR","NS","PTR","SMIMEA","SPF","SRV","SSHFP","SVCB","TLSA","TXT"])) | |
TYPE_TYPES.sort() | |
defaults = { | |
"email": "<email>", |
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
TOKEN=<github_token> | |
USERNAME=<github_user> | |
FILENAME=automate_git.sh | |
echo "What name do you want to give your remote repo? " | |
read REPO_NAME | |
echo "Enter a repo description. Do NOT use spaces: " | |
read DESCRIPTION |
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
#create-github-repository | |
curl https://gist.githubusercontent.com/costa86/472edcbb933844ec98aa070ab90c49e6/raw/cb691dc5932b4070521e5d8bc1b41af48fb49a72/automate_git.sh -o automate_git.sh | |
#ssh-pyhon | |
curl https://gist.githubusercontent.com/costa86/e720730272385cd2c8c469c0fbac3c3d/raw/5b72d3a4a0b1c4bc73c8341f134a1d87248d8bcd/ssh-sftp-python.py -o ssh-python.py | |
#aliases | |
curl https://gist.githubusercontent.com/costa86/0869810c1dc492bb5f4d7d1b9fe8b73e/raw/6313cfe4c7270e87901ecf9f74284b8bc51b9866/aliases.sh -o aliases.sh |
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
eval "$(ssh-agent -s)" | |
number=100 | |
path=$HOME/.ssh/ | |
read -p 'Keyname: ' keyname | |
comment=$keyname | |
ssh-keygen -a $number -t ed25519 -f $path$keyname -C $comment | |
ssh-add $path$keyname |
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
MAX_LOG_FILE_SIZE_IN_MB = 1.00 | |
def get_current_log_file() -> str: | |
logs_path = os.path.join(os.getcwd(), "logs") | |
log_files = os.listdir(logs_path) | |
log_files_numbers = [int(i.split(".")[0].split("-")[-1]) | |
for i in log_files] | |
greater_log_file_number = max(log_files_numbers) | |
current_log_file = os.path.join( | |
os.getcwd(), "logs", f"log-{greater_log_file_number}.json") |
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
from typing import List | |
import requests | |
import json | |
from pprint import pprint | |
from csv import reader,DictReader | |
from ast import literal_eval | |
base_url = "http://localhost:9200" | |
data_stream = "women" |
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
fish | |
1.Create ~/.config/fish/config.fish | |
2.Set aliases here | |
3.Restart fish | |
---------- | |
One-line solution for defining and saving an alias (for example): alias cl 'clear' -s. Instantly works across all sessions and is persisted. | |
Navigate to the ~/.config/fish/functions/ and you'll see cl.fish file. | |
------------------ | |
Functions in this dir are auto-loaded |
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
""" | |
Requirements: | |
tabulate==0.8.9 | |
""" | |
import os | |
from tabulate import tabulate | |
headers = ["ALIAS",'USER',"IP","PRIVATE KEY FILE","LOCAL FORWARD","ID"] | |
PRIMARY_SSH_KEY = r"C:\Users\costa\.ssh\sample" |