Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile
## Run as sudo
apt install xrdp xorgxrdp -y
sudo service xrdp start
echo "mate-session" > /home/mint/.xsession
## Install sound support form xrdp
## When the software sources opens, enable "Source Code Respositores"
class Node{
constructor(value, next){
this.value = value;
this.next = null;
}
}
class LinkedList{
constructor(...items){
'use strict';
const { Model } = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class AuthToken extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
@wmantly
wmantly / .js
Created December 31, 2023 06:27
Get rid of `../` from `require()`
const Module = require('module');
const original_resolveFilename = Module._resolveFilename;
Module._resolveFilename = function(...args){
args[0] = args[0].startsWith('>') ? args[0].replace('>', __dirname) : args[0];
return original_resolveFilename(...args);
};
@wmantly
wmantly / asyncWhenReady.js
Created October 8, 2023 00:29
A JS async generator function that manages concurrent execution of promises and yields their results or errors.
/**
* A generator function that manages concurrent execution of promises and yields their results or errors.
* @param {Function} promiseFactory - A function that returns a promise when called.
* @param {number} want - The total number of promises to execute.
* @param {number} delay - The delay (in milliseconds) to wait when reaching the concurrency limit.
* @param {Array} ...args - Additional arguments to pass to the promiseFactory function.
* @yields {Array} - Yields an array containing either an error or the result of each promise.
*/
async function* whenReady(promiseFunc, want, delay, ...args) {
let working = 0; // Number of promises currently executing.
#!/usr/bin/env python3
import re, os
from subprocess import getoutput
keys = [
"ECC corrected fast",
"ECC corrected delayed",
"ECC reread/rewrites",
"Total errors corrected",
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.5.1
!!################################
!!Script ran on: Mon Oct 24 19:23:47 UTC 2022
!!Linux Distribution
!!------------------
  • ingnore current wife network
iwgetid --ap --raw >> /etc/theta_wg/ignore.txt
  • Download the tray icone
wget https://dashboard.snapcraft.io/site_media/appmedia/2018/11/unnamed.png -O /root/wg.png
#/bin/bash
PASSWORD='ilo password'
USERNAME="william"
ILOIP="192.168.1.45"
SPEED="100"
sshpass -p "$PASSWORD" ssh $USERNAME@$ILOIP -o KexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc "fan p 0 max $SPEED"
sshpass -p "$PASSWORD" ssh $USERNAME@$ILOIP -o KexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc "fan p 1 max $SPEED"
sshpass -p "$PASSWORD" ssh $USERNAME@$ILOIP -o KexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc "fan p 2 max $SPEED"
🖥️ dl380-0 📁 ~ 🗓 Tue Nov 02
🕘 09:41 PM root# cat /etc/network/interfaces
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network