Skip to content

Instantly share code, notes, and snippets.

@scyto
scyto / proxmox.md
Last active April 20, 2024 00:37
proxmox cluster proof of concept

ProxMox Cluster - Soup-to-Nutz

aka what i did to get from nothing to done.

note: these are designed to be primarily a re-install guide for myself (writing things down helps me memorize the knowledge), as such don't take any of this on blind faith - some areas are well tested and the docs are very robust, some items, less so). YMMV

Purpose of Proxmox cluster project

Required Outomces of cluster project

@aamiaa
aamiaa / CompleteMokokoQuest.md
Last active April 20, 2024 00:32
Complete Discord Mokoko Quest

Complete Discord Mokoko Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:31
ENVIAR DADOS PARA O CAMPO DO FORMULÁRIO
<?php
$objeto = new stdClass();
$objeto->nome = 'FABRICIO';
$objeto->celular = '(83) 98655-6461';
$objeto->idade = '34';
TForm::sendData(self::$formName, $objeto);
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:31
ALTERAR O REGISTRO
<?php
$id = 1;
$cliente = Cliente::find($id);
if($cliente)
{
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:29
CONTAR O NÚMERO DE REGISTROS DE UMA TABELA
<?php
# COM FILTRO
$qtd_produtos = Produto::where('grupo', '=', 'BEBIDAS')->count();
# SEM FILTRO, TODOS OS REGISTROS
$qtd_produtos = Produto::count();
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:28
PEGAR O LOGIN DO USUÁRIO LOGADO
<?php
$login_usuario = TSession::getValue('login');
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:28
PEGAR O NOME DO USUÁRIO LOGADO
<?php
$nome_usuario = TSession::getValue('username');
@Kautenja
Kautenja / tar-progress.md
Last active April 20, 2024 00:28
one-liners for using tar with gzip and pv for a progress bar

Compress

tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>

where:

  • `` is the root-mounted (i.e. starts with /) path to the files
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:27
BUSCAR O ENDEREÇO PELO CEP
<?php
ini_set('display_errors',0);
class PessoaForm extends TPage
{
public static function onCEP($param = null)
{
try
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:25
DEFINE MÁSCARA NO CAMPO
<?php
// COM true, IRÁ SALVAR SEM A MÁSCARA DO CAMPO
$telefone->setMask('(99) 9999-9999', true);
TEntry::changeMask(self::$formName, 'cpf', '999.999.999-99');
TEntry::changeMask(self::$formName, 'cnpj', '999.999.999-99');