This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
import argparse | |
import json | |
import re | |
from datetime import datetime | |
from bs4 import BeautifulSoup | |
def fetch_or_load_html(url, cache_file='coolpc_cache.html', force_refresh=False): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MongoDB Refactored Copy Script with Modular Functions and Index Copying | |
// This script copies all collections and their indexes from a source database to a target database without using mongodump. | |
// === Configuration === | |
// Source MongoDB connection details | |
const sourceConfig = { | |
host: "source_host", // e.g., "localhost" | |
port: 27017, // e.g., 27017 | |
username: "sourceUser", // Source DB username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import base64 | |
import zipfile | |
import os | |
def convert_exe_to_base64_and_zip(input_file, output_path): | |
"""Converts an EXE file to Base64, zips the encoded content, and renames the archive to .b64.zip.""" | |
with open(input_file, 'rb') as file: | |
binary_data = file.read() | |
base64_encoded_data = base64.b64encode(binary_data).decode('utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$#" -eq 0 ]; then | |
targets="70 71 79 91 92 93 94" | |
else | |
targets=$* | |
fi | |
echo -e "Targets to scan:\n $targets" | |
in_use=() | |
for suffix in $targets; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.collection.aggregate([ | |
{ | |
$addFields: { | |
nonEmptyValues: { | |
$filter: { | |
input: { $objectToArray: "$Status" }, | |
as: "status", | |
cond: { $ne: ["$$status.v.value", ""] } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tarfile | |
import subprocess | |
import json | |
import sys | |
image = sys.argv[1] | |
# Create a dictionary for the image manifest | |
manifest_dict = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Minimize current window | |
xdotool windowminimize $(xdotool getactivewindow) | |
# Make current window always on top | |
wmctrl -r :ACTIVE: -b toggle,above | |
# Undo aways-on-top window | |
wmctrl -r :ACTIVE: -b remove,above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep_function_names () { | |
if [ -e "$1" ]; then | |
grep -E '^function' $1| awk '{print $2}' | sed -r 's/\(|\)|\{|\}//g' | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2019-2020 by Pulse Secure, LLC. All rights reserved | |
HOMEDIR=$HOME | |
INSTALLDIR=/usr/local/pulse | |
PULSEDIR=$HOME/.pulse_secure/pulse | |
PULSECERTDIR=$PULSEDIR/certificates | |
SVCNAME=pulsesvc | |
UTILNAME=pulseutil |
NewerOlder