Skip to content

Instantly share code, notes, and snippets.

View sullemanhossam's full-sized avatar

sullemanhossam

View GitHub Profile
export default {
async fetch(request:any, env:any) {
const url = new URL(request.url);
const key = url.pathname.slice(1);
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "PUT, GET, DELETE, OPTIONS",
"Access-Control-Allow-Headers": "*"
};
use salvo::oapi::{ToParameters, ToSchema};
use serde::Deserialize;
use crate::CONN;
use rusqlite::{Result};
use tokio::task;
#[derive(Deserialize, ToParameters, Debug)]
pub struct Event {
pub(crate) uid: String,
pub(crate) title: String,
version: "3.5"
services:
postgres:
container_name: postgres_container
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
PGDATA: /data/postgres
package cronJob
import (
"fmt"
"log"
"network-chesswork/mac"
"time"
)
func FindConnectedMacAddresses(iface string) error {
package mac
import (
"fmt"
"network-chesswork/utilities"
"time"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
package utilities
import (
"fmt"
"os"
)
func FilePathValidity(path string) error {
// Check if the script path is valid
info, err := os.Stat(path)
package utilities
import (
"fmt"
"os"
"os/exec"
)
// / RunScript executes a bash script located at the given path and returns whether it was successful and any error encountered.
func RunScript(scriptPath string, props map[string]string) (bool, error) {
package mac
import (
"fmt"
"network-chesswork/utilities"
)
// Sniff performs a sniffing operation based on the provided range.
func Sniff(interfaceRange string) error {
if interfaceRange == "" {
package cronJob
import (
"fmt"
"network-chesswork/mac"
)
func FindConnectedMacAddresses(interfaceRange string) error {
err := mac.Sniff(interfaceRange)
package main
import (
"flag"
"fmt"
"log"
"network-chesswork/cronJob"
"network-chesswork/info" // Assuming this is the correct package path
"github.com/robfig/cron/v3" // Updated import path for the robfig/cron package