Skip to content

Instantly share code, notes, and snippets.

View ilovefreesw's full-sized avatar
🎯
Focusing

Laxman ilovefreesw

🎯
Focusing
View GitHub Profile
@ilovefreesw
ilovefreesw / gist:cf66d97e56d2a7081d95a85715c46172
Created May 19, 2022 04:52
Here is a batch script to bulk split GIF files into their corresponding frames in JPG format. Based on FFmpeg. So make sure that FFmpeg command is available.
forfiles /s /m *.gif /c "cmd /c mkdir @FNAME && ffmpeg -i "@FILE" @FNAME/output_%%04d.jpg"
@ilovefreesw
ilovefreesw / gAdsDownload.py
Created May 28, 2022 07:06
A simple script to get all Google Ads from Google Search results directly. Downloads ad title, link, and description.
from bs4 import BeautifulSoup
import requests, csv
import lxml
from requests.structures import CaseInsensitiveDict
ads = []
key = input("Enter a keyword/domain/brand: ")
headers = CaseInsensitiveDict()
headers["authority"] = "www.google.com"
@ilovefreesw
ilovefreesw / AMPTools-Gen.py
Created August 8, 2022 04:31
AMPTools-Gen is basically a Python script that you can use to instantly generate AMP code from any HTML.
#!/usr/bin/python3
import argparse
from amp_tools import TransformHtmlToAmp
import codecs
arg_parser = argparse.ArgumentParser( description = "Copy source_file as target_file." )
arg_parser.add_argument( "source_file" )
arg_parser.add_argument( "target_file" )
arguments = arg_parser.parse_args()
@ilovefreesw
ilovefreesw / PS command
Created December 30, 2022 07:40
A PowerShell script to automatically backup Windows Event Logs. Add it to Windows Task Scheduler using the Command Below.
$trigger=New-JobTrigger -Weekly -At "7:00AM" -DaysOfWeek "Monday"
$action="PowerShell.exe -ExecutionPolicy ByPass -File D:\Logs\export-logs.ps1"
$sb=[Scriptblock]::Create($action)
Register-ScheduledJob -Name "Export Logs" -ScriptBlock $sb -Trigger $trigger
@ilovefreesw
ilovefreesw / swp_create.sh
Created November 14, 2024 11:15
A bash script to create a swap space on a server in one go. Takes swap size and swappiness value as input parameters. Run it as root.
#!/bin/bash
# Prompt the user for swap size and swappiness
read -p "Enter the swap size (e.g., 4G, 2G): " swap_size
read -p "Enter the swappiness value (0-100): " swappiness
# Create the swap file with the specified size
fallocate -l "$swap_size" /swapfile
# Set permissions on the swap file
@ilovefreesw
ilovefreesw / mysql_installer.sh
Created November 15, 2024 06:00
A shell script to install MySQL server on Ubuntu VPS with specified user and password.
#!/bin/bash
# Check if MySQL is already installed
if ! command -v mysql &> /dev/null; then
echo "MySQL is not installed. Installing MySQL Server..."
apt update
apt install -y mysql-server
else
echo "MySQL is already installed."
fi
import io
from typing import Any, Dict, List
import moviepy.editor as mp
import numpy as np
import streamlit as st
import torch
import torchaudio
import torchaudio.transforms as T
from streamlit_mic_recorder import mic_recorder