Author: wbjuba8jii0b

  • aio-votifier

    Aio-Votifier Code Quality PYPI Version PYPI Downloads Views

    An asynchronous MInecraft server votifier client in Python

    Example Usage:

    from aiovotifier import VotifierClient
    import asyncio
    
    async def main():
        client = VotifierClient("127.0.0.1", 8192, "testservicename", "token/rsa key")
        
        # VotifierClient.vote(...) automatically determines the protocol and key format
        await client.vote("username", "user address")
        await client.vote("user2")
    
        await client.v1_vote("username", "user address")  # only supports v1 protocol
        await client.nu_vote("username", "user address")  # only supports NuVotifier/v2 protocol
    
    asyncio.run(main())

    Documentation

    class aiovotifier.VotifierClient(host: str, port: int, service_name: str, secret: str)

    • Arguments:
      • host: strThe hostname or IP of the votifier server
      • port: intThe port of the votifier server, commonly 8192
      • service_name: strThe name of the service that sends the vote
      • secret: strThe public RSA key or the token found in config.yml
    • Methods:
      • vote(username: str, user_address: str = "127.0.0.1")sends a vote to the votifier server, automatically detects and handles the protocol and type of secret
      • v1_vote(username: str, user_address: str = "127.0.0.1")sends a Votifier v1 vote to a votifier v1 server
      • nu_vote(username: str, user_address: str = "127.0.0.1") -> dictsends a NuVotifier / v2 vote to a NuVotifier server, returns the response from the server

    class aiovotifier.VotifierHeader(header: bytes, version: str, token: str = None)

    • Arguments:
      • header: bytesThe header received from the votifier server
      • version: strThe version of the votifier server
      • challenge: str = NoneThe challenge, included only if the votifier server is v2/NuVotifier
    • Methods:
      • @classmethod parse(header: bytes)Returns a new VotifierHeader, parsed from the input bytes

    function aiovotifier.votifier_v1_vote(r: asyncio.StreamReader, w: asyncio.StreamWriter, service_name: str, username: str, user_address: str, key: cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey)

    • Sends a Votifier v1 vote to a Votifier v1 server

    function aiovotifier.nuvotifier_vote(r: asyncio.StreamReader, w: asyncio.StreamWriter, service_name: str, username: str, user_address: str, token: str, challenge: str) -> dict

    • Sends a NuVotifier / v2 vote to a NuVotifier server

    exception aiovotifier.VotifierError

    • Base class that all votifier exceptions derive from

    exception aiovotifier.VotifierHeaderError

    • Raised when the header from the votifier server is invalid

    exception aiovotifier.UnsupportedVersionError

    • Raised when the votifier version is unsupported

    exception aiovotifier.NuVotifierResponseError

    • Raised when the response from the votifier server contains a status that is not OK

    Credits

    aiovotifier was based off the code and documentation below

    Visit original content creator repository https://github.com/Iapetus-11/aio-votifier
  • HotSites

    ReadMe HotSites
    
    These are projects that had the objective of dissemination and creation to highlight an action of communication and timely marketing for sales of products services in the market. Real estate Loteamento Terras de San Francisco, Restaurants Oppadak, Lines of Biscoito Pelaggio.
    
    Using: HTML5, CSS3, Sass, Grunt, Joomla Content Management System. With components: Jquery, Jquery Zoom.js, Media queries responsive.
    
    Can be used with a local served xampp, mamp or of your preference. given start in Apache and MySQL. create a database of in admin, phpmyadmin by saofrancisco name.
    
    In the configuration.php put the path of the folder and put the name of the bank
    public $ db = 'saofrancisco';
    
    public $ log_path = 'C:\\xampp\\htdocs\\lands-saofrancisco\\site / logs';
    public $ tmp_path = 'C:\\xampp\\ htdocs\\lands-saofrancisco\\site / tmp';
    
    ReadMe Portuquês
    São projetos que teve o objetivo de divulgação e criação para destacar uma ação de comunicação e marketing pontual para vendas de produtos serviços no mercado.Imobiliario Loteamento Terras de São Francisco, Restaurantes Oppadak, Linhas de Biscoito Pelaggio .
    
    Utilizando: HTML5, CSS3, Sass, Grunt,Sistema de Gerenciamento de Conteúdo Joomla. Com components: Jquery, Jquery Zoom.js, Media queries responsive.
    
    Podendo ser ultilizado com um servido local xampp, mamp ou de sua preferencia. dado start no Apache e no MySQL . criar um banco de dados de no admin, phpmyadmin de nome saofrancisco.
    
    No configuration.php  colocar o caminho da pasta e colocar o nome do banco
    public $db = 'saofrancisco';
    
    public $log_path = 'C:\\xampp\\htdocs\\terras-saofrancisco\\site/logs';
    public $tmp_path = 'C:\\xampp\\htdocs\\terras-saofrancisco\\site/tmp';
    
    
    

    Visit original content creator repository
    https://github.com/haroldo78/HotSites

  • Dotfiles

    Dotfiles

    symlink-free dotfiles using the $HOME as the git work-tree technique

    Used daily on macOS & BluefinDX/Bazzite/BazziteDX Fedora Linux systems.

    Contents

    Quickstart

    1. Clone the bare repository (this stores the Git history without checking out files yet):

      git clone --bare https://github.com/jthegedus/dotfiles.git "$HOME/.dotfiles.git"
    2. Define a temporary alias for interacting with the dotfiles repo:

      alias dotfiles='git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME"'
    3. Attempt to checkout the files:

      dotfiles checkout
    4. Handle Conflicts: If the checkout command fails due to existing files you can perform one of two actions:

      • a) Backup existing files and replace (recommended):

         # eg: backup the existing .config directory and git checkout
         mv ~/.config ~/.config.bak
         dotfiles checkout

        Repeat the above for any other reported conflicting folders/files.

      • b) Overwrite existing files with force checkout:
         dotfiles checkout -f
    5. Configure the repository to ignore other untracked files in $HOME:

      dotfiles config --local status.showUntrackedFiles no

    This creates the following files in your $HOME directory:

    # in $HOME
    .config/**      <-- configuration files
    .dotfiles/      <-- template files for this repo
    .dotfiles.git/  <-- .git dir for this repo
    .gitconfig      <-- core git config file
    .gitconfig.proj <-- created from .dotfiles/*.template
    README.md       <-- this repo README
    .zshenv         <-- tell ZSH to look at ~/.config/zsh/*

    Manual post-clone steps

    Configure Git

    • Copy the template cp ~/.dotfiles/.gitconfig.project.template ~/.gitconfig.proj
    • Fill out the name and email properties in ~/.gitconfig.proj
    • If you do NOT wish to use SSH with Git then:
      • remove the gpg, commit, tag, and user sections from the file
    • If you wish to use SSH with Git then:
      • fill out the signingkey properties in ~/.gitconfig.proj
      • Create and Store an SSH key and use for Authentication/Commit-Signing in GitHub
      • I recommend using BitWarden or an equivalent as an SSH Agent for secure storage and ease of use.

    Install Tools

    Install tools in .config/brewfile/Brewfile* using Homebrew and Homebrew File:

    • brew install rcmdnk/file/brew-file
    • brew file install

    Longstart

    • Fork this repository
    • Modify the contents using the in-browser GitHub edit & commit capabilities
    • Remove the SSH git configuration if you do not wish to use SSH
    • Clone the repository to your machine from your own Fork
    • Follow the above Manual post-clone steps instructions

    Tips

    • I recommend using Fish over ZSH. ZSH configuration is here for convenience but I am considering dropping maintenance of it.
    • Fork and modify this repository instead of cloning it directly.
      • Files that may require modification are:
        • .zshenv
        • .config/brewfile/Brewfile*
    • Instead of using branching codepaths in your scripts for system-specific configurations you could use git branches to manage a copy for each system, with common/shared configuration in the master branch.
      • You would have to merge the common/shared configuration into the other branches on change.

    Tools

    I use Development Containers in most projects to manage project-specific dependencies. This keeps my OS installation relatively clean. Since devcontainers can mount your home directory, this repository contains some configuration files for tooling I commonly use within devcontainers that may not appear on my machine and therefore Brewfile.

    The list of tools I use as a base on each system/OS are:

    Change the Shell

    Use the following tools to change the shell on most Unix systems:

    • chsh -s $(which <DESIRED_SHELL>) $USER
    • sudo usermod --shell $(which <DESIRED_SHELL) $USER (when chsh is not available)

    Git Conditional Configuration

    I use the .gitconfig conditional includeIf directive to manage per-project Git settings in a separate configuration file to the ones committed to this repository (see the template in .dotfiles/.gitconfig.project.template directory for an example).

    This is useful to manage different usernames, emails or authentication settings per project.

    The includeIf directive allows for the following conditionals:

    • gitdir:<pattern>: Matches if the Git directory path matches the pattern, useful for applying settings to projects in specific locations (e.g., ~/work/).
    • onbranch:<branch-name-pattern>: Matches if the current branch name matches the pattern, useful for branch-specific workflows or settings.
    • hasconfig:remote.<name>.url:<pattern>: Matches if a remote’s URL matches the pattern, useful for loading different user configs for work vs. personal projects or different Git platforms.

    See the documentation for full explanations – https://git-scm.com/docs/git-config#_conditional_includes

    As an example, this configuration applies the same config for remotes using GitHub via SSH & HTTPS, with another config for a singular organisation remote on BitBucket:

    # git settings - GitHub SSH & HTTPS
    [includeIf "hasconfig:remote.*.url:https://github.com/**"]
    	path = ~/.gitconfig.proj
    [includeIf "hasconfig:remote.*.url:git@github.com:**"]
    	path = ~/.gitconfig.proj
    
    # git settings - project specific SSH
    #    NOTE: ensure this does not overlap with any other includeIf conditions
    [includeIf "hasconfig:remote.*.url:git@bitbucket.org:<organisation_name>/**"]
    	path = ~/<org_name>/.gitconfig.proj_<project_name>

    This includes the specified configuration file if the repository you are running git commands against ( where the .git directory is) matches the provided pattern.

    Creating your own git work-tree dotfiles repository

    Here is a quick guide to creating your own bare repository for dotfiles using the $HOME as the git work-tree technique:

    • create a bare repository
    • set a temporary alias to use the bare repository (you should add this alias to your shell config as well for future use)
    • set the repo to ignore all untracked files (using our alias “dotfiles”)
    • set the remote origin to your GitHub (or other) repository

    git init --bare $HOME/.dotfiles.git
    alias dotfiles='git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME'
    dotfiles config --local status.showUntrackedFiles no
    dotfiles remote add origin git@github.com:<username>/<repo>.git

    Now add any of your existing .config files, track with git & push:

    cd $HOME
    dotfiles add .config/starship.toml
    dotfiles status
    dotfiles commit -m "feat: capture starship configuration"
    dotfiles push

    For more examples and inspiration see the HackerNews post where I learnt about this technique.

    NB: The dotfiles alias is a temporary alias for the current shell session. I include it in my Fish & ZSH configuration files in this repository as a permanent way to quickly interact with my dotfiles repository.

    NB: Even though all files are untracked thanks to the status.showUntrackedFiles no setting, I still recommend using .gitignore files when the configuration you wish to include is in a directory with other files you do not wish to include. This is purely a precautionary measure to avoid accidents. Though allow-listing files in .gitignore is a recommended practice.

    Licence

    Zero-Clause BSD
    =============
    
    Permission to use, copy, modify, and/or distribute this software for
    any purpose with or without fee is hereby granted.
    
    THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
    WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
    FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
    OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    

    Visit original content creator repository
    https://github.com/jthegedus/dotfiles

  • Lizard

    Lizard

    Lizard is a lightweight wrapper on top of Bun, a fast all-in-one JavaScript runtime. This project provides a simple and efficient way to create web applications with minimal setup.

    Features

    • Fast and Lightweight: Built on Bun, ensuring high performance.
    • Simple Routing: Define routes easily with support for dynamic parameters.
    • Middleware Support: Add middleware functions to handle requests.
    • TypeScript Support: Written in TypeScript for type safety and better development experience.

    Installation

    To install dependencies, run:

    bun install

    Running the Application

    To start the application, run:

    bun run index.ts

    The server will start on port 3000 by default.

    Project Structure

    ├── .gitignore
    ├── bun.lockb
    ├── index.ts
    ├── lizard.ts
    ├── package.json
    ├── README.md
    ├── tsconfig.json
    ├── types.ts
    ├── utils.test.ts
    └── utils.ts
    
    • index.ts: Entry point of the application.
    • lizard.ts: Core framework implementation.
    • types.ts: Type definitions for the framework.
    • utils.ts: Utility functions used by the framework.
    • utils.test.ts: Unit tests for utility functions.

    Example Usage

    Here is an example of how to define routes in your application:

    import Lizard from "./lizard";
    import type { Middleware } from "./types";
    
    const app = Lizard.create();
    
    // Global middleware to log requests
    const loggerMiddleware: Middleware = async (event, next) => {
    	console.log(`Request: ${event.method} ${event.url}`);
    	return next();
    };
    
    // Global middleware to add a custom header
    const headerMiddleware: Middleware = async (event, next) => {
    	event.response.headers.set('X-Custom-Header', 'Lizard');
    	return next();
    };
    
    // Apply global middlewares
    app.use(loggerMiddleware);
    app.use(headerMiddleware);
    
    app.get("https://github.com/", async (event) => {
    	return event.response.send("Hello, World!");
    });
    
    app.get('/home', async (event) => {
    	return event.response.send("Home Page");
    });
    
    app.get('/home/:id', async (event) => {
    	return event.response.send("Home Page" + event.params?.id);
    });
    
    app.get('/home/:id', async (event) => {
    	return event.response.send(`User ${event.params?.id}`);
    });
    
    app.get('/home/:id', async (event) => {
    	return event.response.send(`User ${event.params?.id}`);
    });
    
    app.get('/home/:id/profile', async (event) => {
    	return event.response.send(`User ${event.params?.id} Profile`);
    });
    
    app.post('/user', async (event) => {
    	return event.response.send("User Created");
    });
    
    app.put('/user/:id', async (event) => {
    	return event.response.send(`User ${event.params?.id} Updated`);
    });
    
    app.del('/user/:id', async (event) => {
    	return event.response.send(`User ${event.params?.id} Deleted`);
    });
    
    
    app.listen(3000);

    In this example, the middleware sets a user object in the event.locals property. The /profile route then accesses this local variable and returns the user’s name in the response.

    License

    This project is licensed under the MIT License.

    Visit original content creator repository
    https://github.com/johndavedecano/lizard