Skip to content

Instantly share code, notes, and snippets.

@moinsam
moinsam / speedtest_report.sh
Created July 9, 2024 04:40
speedtest_report.sh
#!/bin/bash
# Define log file
LOGFILE="$HOME/speedtest_report.log"
# Ensure the speedtest-cli Python module is installed
pip3 install speedtest-cli --user
# Get the public IP address
PUBLIC_IP=$(curl -s https://api.ipify.org)
@moinsam
moinsam / markdown-cheatsheet.md
Created May 8, 2023 05:32 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet.
#!/usr/bin/env bash
# Step 1 — Installing Docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
declare -a ipAddress
x=0
for((i = 10; i <= 20; i++)) {
ipAddress[$x]="hostname-${i}.end.local"
((x=x+1))
}
for ip in "${ipAddress[@]}"; do
printf "$ip %s\\n" $(dig +short "$ip")
done
@moinsam
moinsam / .bash_profile
Created June 12, 2018 00:28
Bash profile for multiple java
export JAVA_6_HOME=$(/usr/libexec/java_home -v1.6)
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_9_HOME=$(/usr/libexec/java_home -v9)
export JAVA_10_HOME=$(/usr/libexec/java_home -v10)
alias java6='export JAVA_HOME=$JAVA_6_HOME'
alias java7='export JAVA_HOME=$JAVA_7_HOME'
alias java8='export JAVA_HOME=$JAVA_8_HOME'
alias java9='export JAVA_HOME=$JAVA_9_HOME'
@moinsam
moinsam / svnbackup.bat
Created June 16, 2017 11:29
this sript could be used to migrate svn repo from windows to aws s3 bucket
set path="C:\Program Files\VisualSVN Server\bin"
set REPO=c:\Repositories
for /d %%a in (%REPO%\*) do (
svnadmin hotcopy %%~a c:\svn-backup\temp\%%~nxa
"C:\Program Files\SprightlySoft\S3 Sync\S3Sync.exe" -AWSAccessKeyId AWS_ACCESS_KEY_ID -AWSSecretAccessKey AWS_SECRET_KEY -LicenseKey LICENSE_KEY -SyncDirection upload -LocalFolderPath "c:\svn-backup\temp" -bucketName BUCKET_NAME -S3FolderKeyName "Repositories/"
)
rem rd c:\svn-backup\temp\%repoName% /q /s

Uninstall MySql on a Mac OS X—————————————————————————————
Table of Contents [hide]

    Summary
    Symptom
    Resolution

Summary

To completely uninstall MySql OS X it is neccessary to remove numerous files.

@moinsam
moinsam / Gruntfile-Profiling.js
Created December 6, 2016 08:26
Gruntfile for profileing the project building
module.exports = function (grunt) {
// ignore other code only the related code to profile your build is there
grunt.loadNpmTasks('grunt-ng-constant');
// Define the configuration for all the tasks
grunt.initConfig({
// irrevalant code omitted
ngconstant: {
options: {
{
"name": "PROJECT_NAME",
"version": "PROJECT_VERSION",
"repo": "ECR_REPO_ENDPOINT",
"region": "ECR_REGION"
}
@moinsam
moinsam / docker-build.sh
Created December 6, 2016 06:35
Bash Script to build and push Docker image into ECR
#!/bin/bash
if [ $# -eq 0 ]; then
echo "No arguments provided"
exit 1
fi
if [[ -z $2 ]]; then
echo ---------------Node-----------------