Author: ljew3oeiv4gi

  • sublime-splunk-conf-highlighting

    Sublime Text syntax highlighting for .conf files

    Build Status

    Sublime Text is awesome! But, there’s no great way to get syntax highlighting for a Splunk .conf file… until now!

    It works with Sublime Text 2 & 3!

    Before

    before

    After

    after

    Installation

    • Install it from Package Control – search for Splunk Conf File Syntax Highlighting

    Manual Installation

    • Clone the repo
    • cd sublime-splunk-conf-highlighting

    Sublime Text 2

    • cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/user/splunk-conf.tmLanguage

    Sublime Text 3

    • cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/user/splunk-conf.tmLanguage

    Patterns

    Patterns are used to identify some part of a file.

    Patterns used by this package:

    • ^# DO NOT EDIT THIS FILE\\!$ – marks any lines as invalid if they are # DO NOT EDIT THIS FILE!
    • ^#.*$ – marks any lines that start with # as a comment
    • ^\\[.*\\]$ – marks any line starting with [ and ending with ] as a stanza
    • ^[\\w+\\.\\-\\:]+ – marks the beginning of a line as a conf key; defined by any whitespace, alphanumeric, - or : characters
    • = – marks any = as an equals sign

    Patterns have 3 main attributes:

    • match (or, begin and end): regex patterns
    • name: a TextMate language grammar group, comment.line for an inline comment
    • comment: a comment about the pattern

    Resources

    Development Notes

    There are 2 important files here:

    • splunk-conf.YAML-tmLanguage – The AAAPackageDev package compiles this to the following, this YAML file is much easier to use

    • splunk-conf.tmLanguage – This is a TextMate language definition file in XML format. SublimeText uses this format, it’s a necessary evil.

    • Install package control if you haven’t already

    • cmd + shift + P (Mac) or ctrl + shift + P (Windows)

      • Install package
      • AAAPackageDev
    • Open splunk-conf.YAML-tmLanguage

    • cmd + B should update splunk-conf.tmLanguage, make a small change and see if it worked. If not, play with your build system settings under Tools -> Build System

    • During development you’ll need to constantly copy the splunk-conf.tmLanguage into your Sublime Text package folder, like so: cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/user/splunk-conf.tmLanguage

    • If something doesn’t seem to update, quit & reopen Sublime Text and it should work.

    Visit original content creator repository https://github.com/shakeelmohamed/sublime-splunk-conf-highlighting
  • text-io

    PRs Welcome License Build Status

    Text-IO

    Text-IO is a library for creating Java console applications. It can be used in applications that need to read interactive input from the user.

    Features

    • supports reading values with various data types.
    • allows masking the input when reading sensitive data.
    • allows selecting a value from a list.
    • allows to specify constraints on the input values (format patterns, value ranges, length constraints etc.).
    • provides different terminal implementations and offers a Service Provider Interface (SPI) for configuring additional text terminals.

    By default, Text-IO tries to use text terminals backed by java.io.Console. If no console device is present (which may happen, for example, when running the application in your IDE), a Swing-based terminal is used instead.

    Example

    TextIO textIO = TextIoFactory.getTextIO();
    
    String user = textIO.newStringInputReader()
            .withDefaultValue("admin")
            .read("Username");
    
    String password = textIO.newStringInputReader()
            .withMinLength(6)
            .withInputMasking(true)
            .read("Password");
    
    int age = textIO.newIntInputReader()
            .withMinVal(13)
            .read("Age");
    
    Month month = textIO.newEnumInputReader(Month.class)
            .read("What month were you born in?");
    
    TextTerminal terminal = textIO.getTextTerminal();
    terminal.printf("\nUser %s is %d years old, was born in %s and has the password %s.\n",
            user, age, month, password);
    

    Click on the image below to see the output of the above example in a Swing-based terminal.

    You can also use a web-based terminal, which allows you to access your application via a browser, as shown in the image below.

    Useful links

    Text-IO is available in Maven Central and JCenter.

    Visit original content creator repository https://github.com/beryx/text-io
  • sskit

    SSKit (SnapShot Kit)

    KISS tools for make snapshots in a Btrfs filesystem.

    SSKit is made up of several small programs that work together, functioning
    as one. Currently:

    • sskd: Daemon for making snapshots.
    • ssmk: Makes snapshots only if necessary.
    • sscl: Clean snapshots when is necessary.

    Additionally, it also integrates the following tools:

    • ssct: Shows Creation time and Changed time of a snapshot.
    • ssst: Shows some statics of interest. (Not implemented yet)
    • ssgui: Graphic user interface. (Not implemented yet)

    Basic operation

    On startup sskd loads /etc/sstab into memory and creates snapshots, that are
    stored in the specified pool directory.

    Example of /etc/sstab

    # subvolume    pool               frequency    quota
    
    /              /backup/root/boot  0            30
    /              /backup/root/diary 1d           30
    /home          /backup/home/30m   30m          20
    

    In every execution loop, if more time than indicated by the frequency has
    passed, a new snapshot of the subvolume will be created inside of its own
    pool, until reach the quota, and then, when quota were overpassed, it will
    deletes the oldest snapshot until fit to the quota.

    sskd

    Is the daemon. Loads /etc/sstab into memory and runs first ssmk and then
    sscl for each line.

    ssmk

    Creates a snapshot of the subvolume in the specified directory, only if the
    minimum frequency time is met. And only if there have been changes. The
    snapshot name is automatically set in the format +%Y-%m-%d_%H-%M-%S.

    sscl

    Delete the oldest snapshots until the quota is met.

    ssct

    Shows when subvolume was created and when an inode in the subvolume was last
    change.

    ssst

    Show snapshot statistics (Not implemented yet).


    TODO

    • System calls.

    See changelog

    Visit original content creator repository
    https://github.com/mdomlop/sskit

  • Using ESP32S3 as a HID device.

    Using ESP32S3 as a HID device.

    This project enables communication between an ESP32-S3 board and a connected BLE device. The ESP32-S3 board acts as a BLE/Web server, receiving commands from the connected device and performing specific actions based on the received commands. Additionally, it functions as an HID, allowing it to act as a keyboard and execute commands on the CMD or run applications.

    Prerequisites

    • Arduino IDE
    • ESP32-S3 board
    • BLE device (e.g., smartphone, tablet)

    Getting Started

    1. Install the necessary libraries:

      • BLEDevice
      • BLEServer
      • BLEUtils
      • USB
      • USBHIDKeyboard
      • WiFi
      • esp_now
    2. Upload the code to your ESP32-S3 board using the Arduino IDE.

    3. Connect your ESP32-S3 board to a power source.

    4. Scan for available Bluetooth devices on your BLE device (e.g., smartphone or tablet), or use web portal (localhost)

    5. Connect to the ESP32-S3 BLE device from your BLE device.

    6. Send commands to the ESP32-S3 BLE device using the connected BLE device (or use ip address assigned to esp32s3 for web base keyboard). Supported commands include:

      • “test” – Print a defined word to the serial monitor.
      • “#run_[command]” – Execute a command on the ESP32-S3 board.
      • “#cmd_[command]” – Execute a command in the Windows command prompt.
      • Other keywords and string will be send as it is to usb connected device.
    7. The ESP32-S3 board will perform the specified actions based on the received commands. It can act as an HID and execute commands on the CMD or run applications.

    Troubleshooting

    If you encounter any issues or errors, please refer to the documentation or seek support from the ESP32-S3 and BLE community.

    Note: I implementing new functionalities in this project, so this readme file might be outdated, so you better check completed issues labled with feature to know the latest implemented feature.

    Visit original content creator repository
    https://github.com/mhamidjamil/ESP32-S3_work