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 ctypes | |
import os | |
from unicorn import * | |
from unicorn.x86_const import * | |
from capstone import * | |
import struct | |
main_start = 0x00400000 | |
start = 0x00401255 | |
end = 0x00401324 |
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
curl -Lo nuxmv.tar.gz https://nuxmv.fbk.eu/theme/download.php?file=nuXmv-2.0.0-linux64.tar.gz | |
gunzip nuxmv.tar.gz | |
tar -xvf nuxmv.tar | |
cat << EOF >> ~/.bashrc | |
export PATH="$PATH:$(pwd)/nuXmv-2.0.0-Linux/bin/" | |
alias nu="nuXmv" | |
EOF | |
source ~/.bashrc |
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/env python3 | |
""" | |
This is a prototype for automating prod error tickets from GCP to Jira. | |
""" | |
import os | |
import json | |
import argparse | |
import subprocess | |
import logging as pylog | |
import datetime as d |
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/env python | |
""" | |
This script is a prototype of a ssl monitoring system. | |
It checks for the expiration date and alerts whether cert is | |
1. Expired | |
2. About to expire in 2 weeks | |
3. Valid, with the expiration date | |
Script uses asyncio to speed up checking hostnames simultaneously. | |
""" |
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 | |
while inotifywait -e modify /var/log/auth.log; | |
do | |
word=`tail -n1 /var/log/auth.log | grep 'user NOT in sudoers'` | |
if [[ $word ]]; then | |
echo '{"text":"'$word'"}' > sendtoslack | |
curl -X POST \ | |
-H 'Content-type: application/json' \ | |
--data @sendtoslack \ | |
<webhook url> |
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 boto3 | |
import json | |
import datetime | |
PREFIX = "" | |
client_1 = boto3.client('s3') | |
client_2 = boto3.client('sqs', | |
aws_access_key_id='KEY', | |
aws_secret_access_key='KEY' | |
) |
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 | |
#Usage: | |
#./getusers.sh <TOKEN> <GROUP ID> | |
# | |
i=1 | |
rm users ids final | |
while [[ $i -ne 10 ]] | |
do | |
curl -s --header "PRIVATE-TOKEN: $1" "https://gitlab.com/api/v4/groups/$2/projects?simple=true&order_by=last_activity_at&pagination=keyset&per_page=100&page=$i" | jq -r '.[]|.id' > ids | |
while read -r 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
#this script transfers log files from s3 bucket to desired remote server | |
DIR = '~/var/logs' | |
COPIED_TO = '' | |
ssh remote_user@<IP> find $DIR -maxdepth <max depth here> -mtime -$1 -mtime +$2 -type f > loglist.txt | |
while read -r line | |
do | |
rsync -chavzP --stats [email protected]:$line $COPIED_TO | |
done < loglist.txt | |
aws s3 cp $COPIED_TO s3://bucket/ --recursive \ |
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/python | |
import requests | |
import sys | |
import json | |
def getlist(token, page_no = 10): | |
group_id = "" | |
data = "" | |
data_json = [] | |
data_list = [] |
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/env bash | |
set -e | |
cleanup() { | |
rm -f "$iam_output_file" "$jq_output_file" | |
} | |
trap 'cleanup' 0 1 2 15 # cleanup tmp files in case script ends upbruptly. | |
usage() { # Function: Print a help message |
NewerOlder