Skip to content

Instantly share code, notes, and snippets.

View Sy3Omda's full-sized avatar
🎯
Focusing

Emad Youssef Sy3Omda

🎯
Focusing
View GitHub Profile
Get-ChildItem -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } | ForEach-Object { $_ } ; Get-ChildItem -Recurse -File -Include *.zip | ForEach-Object { $zip = $_.FullName; Expand-Archive -Path $zip -DestinationPath "temp_$($_.BaseName)" -Force; Get-ChildItem -Path "temp_$($_.BaseName)" -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } ; Remove-Item "temp_$($_.BaseName)" -Recurse -Force }
@Sy3Omda
Sy3Omda / Robocopy_File_Transfer_Commands.md
Last active April 25, 2025 18:15
Robocopy commands for file transfer: one with admin access (/COPYALL) and one without (/COPY:DAT). Includes retry, verbose logging, progress, and desktop log output.

With Administrative Access

robocopy \\source_server\path \\destination_server\share\path /E /COPYALL /ZB /R:5 /W:10 /J /V /ETA /TEE /LOG+:%USERPROFILE%\Desktop\robocopy_log.txt

Without Administrative Access

robocopy \\source_server\path \\destination_server\share\path /E /COPY:DAT /R:5 /W:10 /J /V /ETA /TEE /LOG+:%USERPROFILE%\Desktop\robocopy_log.txt
@Sy3Omda
Sy3Omda / Monitor_Network_Connections.md
Created February 5, 2025 19:45
Monitor Network Connections in different OS

Windows

while($true) {
    Get-Process ollama | ForEach-Object { 
        $id = $_.Id
        Write-Host "`nConnections for Ollama process $id" -ForegroundColor Green
        Get-NetTCPConnection | Where-Object OwningProcess -eq $id | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State 
    }
    Start-Sleep -Seconds 2
    Clear-Host

Create a Systemd Service File:

sudo nano /etc/systemd/system/vboxconfig.service
[Unit]
Description=VirtualBox Kernel Modules Setup
After=network.target

[Service]
@Sy3Omda
Sy3Omda / start_https_server.sh
Created September 25, 2024 19:28
self-signed certificate with python http.server
#!/bin/bash
CERT_FILE="localhost.pem"
cleanup() {
rm -f "$CERT_FILE"
exit 0
}
trap cleanup SIGINT
@Sy3Omda
Sy3Omda / choco-install.bat
Created August 3, 2024 17:08
Official Installation of chocolatey package by cmd
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
@Sy3Omda
Sy3Omda / install_docker_debian.sh
Last active August 3, 2024 17:10
bash script to install docker in debian
#!/usr/bin/env bash
show_msg () {
echo -e '\e[32m'$1'\e[0m'
}
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
# set static IP in Ubuntu Server
network:
version: 2
renderer: networkd
ethernets:
ens33:
addresses:
- 192.168.1.100/24
routes:
- to: default
@Sy3Omda
Sy3Omda / install_docker_ubuntu.sh
Last active August 3, 2024 17:12
bash script to install docker in ubuntu
#!/usr/bin/env bash
show_msg () {
echo -e '\e[32m'$1'\e[0m'
}
show_msg "\n Adding docker keyring"
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
@Sy3Omda
Sy3Omda / emojis.sh
Created June 8, 2023 08:23 — forked from BuonOmo/emojis.sh
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=πŸ˜€
emoji_grinning_face_with_big_eyes=πŸ˜ƒ
emoji_grinning_face_with_smiling_eyes=πŸ˜„
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=πŸ˜†
emoji_grinning_face_with_sweat=πŸ˜…
emoji_rolling_on_the_floor_laughing=🀣
emoji_face_with_tears_of_joy=πŸ˜‚
emoji_slightly_smiling_face=πŸ™‚