Skip to content

Instantly share code, notes, and snippets.

"""
NOTE: make sure to install:
pip install Pillow google-genai loguru
"""
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
import os
@mccun934
mccun934 / agent loop
Created March 10, 2025 12:16 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
1. # create new .py file with code found below
2. # install ollama
3. # install model you want “ollama run mistral”
4. conda create -n autogen python=3.11
5. conda activate autogen
6. which python
7. python -m pip install pyautogen
7. ollama run mistral
8. ollama run codellama
9. # open new terminal
@mccun934
mccun934 / scaling.md
Created October 30, 2020 14:36 — forked from adamruzicka/scaling.md
Dynflow workers scaling

Intro

Out of the box, foreman ships with orchestrator and a single worker If you have Katello, you will get an additional worker for processing of the host queue

root@modest-gator:~# ls -l /etc/foreman/dynflow/
total 1
-rw-r--r--. 1 root foreman 51 May 14 07:35 orchestrator.yml
-rw-r--r--. 1 root foreman 59 May 14 07:35 worker.yml
#!/bin/bash
echo "Importing Subscription Pools from Candlepin."
echo '
namespace :katello do
task :import_subscriptions => ["environment"] do
User.current = User.anonymous_api_admin
puts _("Importing Subscriptions")
Katello::Subscription.import_all
@mccun934
mccun934 / deleted_puppet_envs65-later.md
Last active February 1, 2023 19:35 — forked from jlsherrill/deleted_puppet_envs.md
recover from deleted puppet environments from 6.5 or later

when publishing a content view if you get:

Validation failed: Puppet environment can't be blank

or

ActiveRecord::RecordInvalid: Validation failed: Name has already been taken
namespace :taskbench do
desc <<~END_DESC
Loads up some tasks
END_DESC
def parallelize(param_lists)
max_number_of_forks ||= ENV['forks'].to_i || 10
page = 0
page_size = param_lists.length/max_number_of_forks
@mccun934
mccun934 / mongodb_collection_sizes.js
Last active August 13, 2018 17:50 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
function getReadableFileSizeString(fileSizeInBytes) {
var i = -1;
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
# EG : ALTER USER Postgres WITH PASSWORD '<newpassword>';
CP_PASS=`grep jpa.config.hibernate.connection.password /etc/candlepin/candlepin.conf | awk -F= '{print $2}'`
F_PASS=`grep password /etc/foreman/database.yml | awk -F: '{print $2}' | sed 's/"//g'`
echo "ALTER USER candlepin WITH PASSWORD '$CP_PASS';" | sudo -u postgres psql
echo "ALTER USER foreman WITH PASSWORD '$F_PASS';" | sudo -u postgres psql
@mccun934
mccun934 / sat-62-certs-regenerate.sh
Last active February 28, 2018 20:15
6.2 Certs Reset Regenerate
rm -rfv /etc/pki/katello{,.bak}
rm -rfv /etc/pki/katello-certs-tools{,.bak}
rm -rfv /etc/candlepin/certs/amqp{,.bak}
rm -rfv /etc/foreman-proxy/*ssl*
rm -rfv /etc/foreman/old-certs
rm -rfv /etc/foreman/*.pem
rm -rfv /var/lib/puppet/ssl
rm -rfv /root/ssl-build
satellite-installer --scenario satellite -v --certs-regenerate-ca=true --certs-regenerate=true