Skip to content

Instantly share code, notes, and snippets.

View greenido's full-sized avatar
🏃‍♂️
Running with a big smile

Ido Green greenido

🏃‍♂️
Running with a big smile
View GitHub Profile
// Find all buttons with data-testid="job-artifacts-delete-button"
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// Function to click on the second button within the pop-up
const clickSecondButtonInPopup = async () => {
const secondButton = document.querySelector('.btn.js-modal-action-primary.btn-danger.btn-md.gl-button');
// If the second button is found, click on it
if (secondButton) {
secondButton.click();
} else {
@greenido
greenido / maintenance.sh
Created August 2, 2023 22:52
A shell script to automate system monitoring, maintenance and email you the results
#!/bin/bash
# System Maintenance Script
# Create log file
log=/var/log/maintenance.log
# Print start status
echo "$(date) - Starting system maintenance" >> $log
@greenido
greenido / remoteCopy.sh
Created August 2, 2023 22:00
A shell script that accesses a server over SSH and copies a specific directory
#!/bin/bash 
# Set the variables. 
server_ip="192.168.1.100" 
username="user" 
password="passwd" 
source_directory="/home/user/my_directory" 
destination_directory="/opt/my_directory" 
# Connect to the server. 
@greenido
greenido / backup.sh
Created August 2, 2023 21:59
This bash script will back up all the files in the current directory to a .tar.gz file. 
#!/bin/bash 
# This script will back up all the files in the current directory to a .tar.gz file. 
# Get the current date and time. 
date +"%Y-%m-%d_%H:%M:%S" 
# Create a backup file. 
backup_file="backup_$(date +"%Y-%m-%d_%H:%M:%S").tar.gz" 
# Tar up all of the files in the current directory. 
#!/usr/bin/env zx
await $`cat package.json | grep name`
let branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`
await Promise.all([
$`sleep 1; echo 1`,
$`sleep 2; echo 2`,
@greenido
greenido / pushToArtifactory.ts
Created July 31, 2023 19:11
Push you LLM to JFrog Artifactory
import axios from 'axios';
import fs from 'fs';
// Artifactory configuration
const ARTIFACTORY_URL = 'https://your-artifactory-url.com';
const ARTIFACTORY_REPO = 'your-repo-name';
const ARTIFACTORY_USERNAME = 'your-username';
const ARTIFACTORY_API_KEY = 'your-api-key';
// LLM model file path
@greenido
greenido / LLM_2_Artifactory.py
Created July 31, 2023 18:22
A script to push a new LLM (Large Language Model) model to JFrog Artifactory (under 30 lines of code :)
import requests
# Artifactory configuration - Change it to your own settings
ARTIFACTORY_URL = 'https://your-artifactory-url.com'
ARTIFACTORY_REPO = 'your-repo-name'
ARTIFACTORY_USERNAME = 'your-username'
ARTIFACTORY_API_KEY = 'your-api-key'
# LLM model file path
LLM_MODEL_FILE = 'path/to/your/llm_model.tar.gz'
@greenido
greenido / AI_LLM_Research_Stuff.md
Last active August 5, 2023 00:30
Some notes around LLMs , local LLM , fine tuning etc'
import { SkyMass } from "@skymass/skymass"; // "@skymass/skymass": "^0.3.7"
import "dotenv/config";
import pgPromise from "pg-promise";
const db = await initDB(); // pgp(process.env["CONNECTION_DB"]);
const sm = new SkyMass({ key: process.env["SKYMASS_KEY"] });
//
// function to initialize the database - Some random names, numbers and other stuff so it will be a 'full table'
@greenido
greenido / QA.java
Created April 12, 2023 04:28
This program asks the user for their name, age, and favorite color. It then prints a report to the console.
import java.util.Scanner;
/**
* This program asks the user for their name, age, and favorite color.
* It then prints a report to the console.
*/
public class QA {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);