Category: Blog

  • nlw2-web


    Musify


    ๐Ÿ’ป Access to Front end here | ๐Ÿ–ฅ Access to Back end here |

    ๐Ÿ’ก About the project

    Project created at the Next Level Week, promoted by Rocket Seat, the initial project was called Proffy and the aim was to create a platform for students to find teachers for a variety of subjects.

    In my project I made Musify, with the specific goal of connecting instruments teachers and students.

    The original design provided by RocketSeat was changed to follow the Spotify color pallete.

    ๐Ÿš€ Programming Languages

    • ReactJS
    • TypeScript
    • HTML5 e CSS3
    • NodeJS

    ๐Ÿ“ฅ How to Run this project on your PC

    • Clone the web repo: git clone https://github.com/flavioccf/nlw2-web.git
    • Clone the server repo: git clone https://github.com/flavioccf/nlw2-server.git

    In both projects you need to go to the folder and run:

    • Dependencies installation: yarn install
    • Run application: yarn start

    The server repo has both SQLite and PostgreSQL configs, those are split in two different branches.

    ๐Ÿ“• License

    All of the files here inclued are under MIT License.
    Made with โค by Flavio Carvalho

    This readme was based on DXWebster repo of the same project

    Visit original content creator repository https://github.com/flavioccf/nlw2-web
  • python-twentemilieu

    Python: Twente Milieu

    GitHub Release Python Versions Project Stage Project Maintenance License

    Build Status Code Coverage Quality Gate Status Open in Dev Containers

    Sponsor Frenck via GitHub Sponsors

    Support Frenck on Patreon

    Asynchronous Python client for the Twente Milieu API.

    About

    This package allows you to request waste pickup days from Twente Milieu programmatically. It is mainly created to allow third-party programs to use or respond to this data.

    An excellent example of this might be Home Assistant, which allows you to write automations, e.g., play a Google Home announcement in the morning when it is trash pickup day.

    Installation

    pip install twentemilieu

    Usage

    import asyncio
    
    from twentemilieu import TwenteMilieu, WasteType
    
    
    async def main() -> None:
        """Show example on stats from Twente Milieu."""
        async with TwenteMilieu(post_code="1234AB", house_number=1) as twente:
            unique_id = await twente.unique_id()
            print("Unique Address ID:", unique_id)
            pickups = await twente.update()
            print("Next pickup for Non-recyclable:", pickup.get(WasteType.NON_RECYCLABLE))
    
    
    if __name__ == "__main__":
        asyncio.run(main())

    Changelog & Releases

    This repository keeps a change log using GitHub’s releases functionality. The format of the log is based on Keep a Changelog.

    Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

    • MAJOR: Incompatible or major changes.
    • MINOR: Backwards-compatible new features and enhancements.
    • PATCH: Backwards-compatible bugfixes and package updates.

    Contributing

    This is an active open-source project. We are always open to people who want to use the code or contribute to it.

    We’ve set up a separate document for our contribution guidelines.

    Thank you for being involved! ๐Ÿ˜

    Setting up development environment

    The easiest way to start, is by opening a CodeSpace here on GitHub, or by using the Dev Container feature of Visual Studio Code.

    Open in Dev Containers

    This Python project is fully managed using the Poetry dependency manager. But also relies on the use of NodeJS for certain checks during development.

    You need at least:

    • Python 3.11+
    • Poetry
    • NodeJS 20+ (including NPM)

    To install all packages, including all development requirements:

    npm install
    poetry install

    As this repository uses the pre-commit framework, all changes are linted and tested with each commit. You can run all checks and tests manually, using the following command:

    poetry run pre-commit run --all-files

    To run just the Python tests:

    poetry run pytest

    Authors & contributors

    The original setup of this repository is by Franck Nijhof.

    For a full list of all authors and contributors, check the contributor’s page.

    License

    MIT License

    Copyright (c) 2019-2025 Franck Nijhof

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Visit original content creator repository https://github.com/frenck/python-twentemilieu
  • 90sify—chromeExtension

    90sify

    90sify is the ultimate time machine for your browsing experience! With just one click, transform any modern website into a pixelated, retro masterpiece that would make any web designer from the 90s proud.

    But that’s not all – we’ve also included a unique AOL search feature that will take you back to the glory days of dial-up internet. Simply highlight any text on a website and click the AOL search button to be transported to an AOL search page with your query. Talk about a blast from the past!

    Features

    • 90s web design: The extension transforms modern websites to look like they’re from the 90s with pixelated graphics and bright colors.
    • AOL search: Highlight any text on the website and click the AOL search button to be redirected to an AOL search page with your query.
    • Easy to use: Simply install the extension, activate it on any website, and start experiencing the 90s internet all over again.

    Installation

    Get ready to take a trip down memory lane with just a few simple steps:

    1. Clone this repository to your local machine.
    2. Open Google Chrome and navigate to the “Extensions” page (chrome://extensions/).
    3. Enable “Developer mode” in the top right corner of the page.
    4. Click “Load unpacked” and select the folder where you cloned the repository.
    5. The extension should now be installed and ready to use.

    Usage

    Get ready to go back in time with just one click! To use the extension, simply activate it on any website by clicking the 90sify icon in your browser toolbar. The website will instantly be transformed to look like a 90s version of itself, complete with pixelated graphics and bright colors.

    To use the AOL search feature, simply highlight any text on the website and click the AOL search button that appears. You’ll be transported back to the days of dial-up internet in no time!

    Contributions

    We welcome contributions from anyone who wants to help make 90sify even more awesome! If you find a bug or have a feature request, please create an issue or submit a pull request.

    License

    This project is licensed under the MIT License – see the LICENSE file for details.

    Visit original content creator repository
    https://github.com/junaid-ahmed7/90sify—chromeExtension

  • nodejs-express-mongoose-typescript-boilerplate

    Express Typescript Mongoose Boilerplate

    travis Coverage Status PR
    A boilerplate/starter project for quickly building RESTful APIs using Node.js, Express, and Mongoose.

    The app comes with many built-in features, such as authentication using JWT, request validation, unit and integration tests, etc.

    Quick Start

    Clone project to create your project, simply run:

    git clone https://github.com/MrBrown6210/nodejs-express-mongoose-typescript-boilerplate.git <project-name>

    Set the environment variables: (You can see all environment keys at src/config/config)

    cp .env.example .env

    Start services

    docker compose up

    Feature

    • NoSQL database: MongoDB object data modeling using Mongoose
    • Authentication and authorization: using passport
    • Logging: using winston and morgan
    • Testing: unit and integration tests using Jest
    • Error handling: centralized error handling mechanism
    • Dependency management: with Yarn
    • Environment variables: using dotenv
    • Security: set security HTTP headers using helmet
    • Compression: gzip compression with compression
    • Git hooks: with husky and lint-staged
    • Linting: with ESLint and Prettier (fixing)
    • Editor config: consistent editor configuration using EditorConfig
    • API Documentation: auto-generate by Swagger

    Commands

    Running locally (require to setup database):

    yarn dev

    Running with docker-compose

    docker compose up

    Down the docker-compose services

    docker compose down

    building:

    yarn build

    Running production (require building step):

    yarn start

    Testing:

    # run all unit tests
    yarn test
    
    # run all unit tests in watch mode
    yarn test:watch
    
    # run unit tests coverage
    yarn test:coverage
    
    # run all e2e tests
    yarn test:e2e
    
    # run all e2e tests in watch mode
    yarn test:e2e:watch

    Enviroment Variable

    The environment variables can be found and modified in the .env file. They come with these default values:

    # Port number
    APP_PORT=9000
    
    # Prefix app path
    APP_PREFIX_PATH=/
    
    # JWT
    # JWT Secret
    JWT_SECRET=somerandomkeyherena
    # JWT Expire
    JWT_EXPIRE=1y
    
    
    # Database config
    DB_SERVER=mongodb://root:example@localhost:27017
    DB_NAME=core

    Project Structure

    This project don’t have controllers and services folders because we want to minimalized. If you want them, you can create it

    src\
     |--config\         # Environment variables and configuration related things
     |--middlewares\    # Custom express middlewares
     |--models\         # Mongoose models (data layer)
     |--routes\         # Routes
     |--utils\          # Utility classes and functions
     |--app.js          # Express app
     |--index.js        # App entry point

    Error handling

    The app has a centralized error handling mechanism.

    Routes should try to catch the errors and forward them to the error handling middleware (by calling next(e)).

    router.post('/login', async (req, res, next) => {
      try {
        const { email, password } = req.body
        const user = await User.findOne({ email })
        if (!user || !user.validPassword(password))
          throw new ApiError(httpStatus.UNPROCESSABLE_ENTITY, 'Invalid email or password')
        res.json(user.toAuthJSON())
      } catch (e) {
        next(e)
      }
    })

    The error handling middleware sends an error response, which has the following format:

    {
      "code": 401,
      "message": "Invalid email or password"
    }

    When running in development mode, the error response also contains the error stack.

    Authentication

    To require authentication for certain routes, you can use the authenticate from passportjs

    router.post("https://github.com/", authenticate(['jwt'], { session: false }), async (req, res, next) => {
      try {
        const store = new Store(req.body.store)
        await store.save()
        res.json(store)
      } catch (e) {
        next(e)
      }
    })

    Logging

    Import the logger from src/config/logger.ts. It is using the Winston logging library.

    Logging should be done according to the following severity levels (ascending order from most important to least important):

    import logger from '@/config/logger'
    
    logger.error('message') // level 0
    logger.warn('message') // level 1
    logger.info('message') // level 2
    logger.http('message') // level 3
    logger.verbose('message') // level 4
    logger.debug('message') // level 5

    In production mode, only info, warn, and error logs will be printed to the console.

    Linting

    Linting is done using ESLint and Prettier.

    In this app, ESLint is configured to follow the Airbnb JavaScript style guide with some modifications. It also extends eslint-config-prettier to turn off all rules that are unnecessary or might conflict with Prettier.

    To modify the ESLint configuration, update the .eslintrc.json file. To modify the Prettier configuration, update the .prettierrc.json file.

    To prevent a certain file or directory from being linted, add it to .eslintignore and .prettierignore.

    To maintain a consistent coding style across different IDEs, the project contains .editorconfig

    API Documentation

    When running the server, you can visit at /api-docs (only dev environment)

    Contributing

    Contributions are welcome! Please check out the contributing guide.

    Inspirations

    License

    MIT

    Visit original content creator repository https://github.com/MrBrown6210/nodejs-express-mongoose-typescript-boilerplate
  • SnakeGame

    ๐Ÿ Snake Game

    A classic Snake Game built with Java, where players control a growing snake to eat food and avoid collisions, designed with simple yet engaging gameplay.

    Java Swing

    โ„น๏ธ About

    A nostalgic recreation of the Snake Game, developed using Java and Swing, where you control the snake’s movement, aiming to eat the food while avoiding collisions with the walls or the snake’s body.

    ๐Ÿš€ Features

    • ๐Ÿ•น๏ธ Classic Snake Game: Move the snake to eat food and grow longer.
    • ๐ŸŽจ Graphical User Interface (GUI): Simple and user-friendly design using Java Swing.
    • โฑ๏ธ Dynamic gameplay: The snake speeds up as it grows.
    • ๐Ÿ’ฅ Collision detection: Game ends when the snake collides with itself or the walls.

    ๐Ÿ“ฆ Installation

    1. Clone the Repository

    git clone https://github.com/DikshitaDas/SnakeGame.git
    cd SnakeGame

    2. Compile and Run the Game

    javac SnakeGame.java
    java SnakeGame

    ๐Ÿ›  Technologies Used

    Technology Logo
    Java Java
    Swing Swing

    ๐Ÿค Contributing

    Contributions are welcome! Here’s how you can contribute:

    1. Fork the repository ๐Ÿด
    2. Create a new branch (git checkout -b feature/amazing-feature) ๐Ÿšง
    3. Commit your changes (git commit -m 'Add a new feature') ๐Ÿ“
    4. Push to the branch (git push origin feature/amazing-feature) ๐Ÿ“ค
    5. Open a pull request ๐Ÿ“ฌ

    ๐Ÿ“„ License

    This project is licensed under the MIT License. See the LICENSE file for details. ๐Ÿ“ƒ

    Visit original content creator repository https://github.com/DikshitaDas/SnakeGame
  • covid-19-vaccine-slot

    Getting Started with Create React App

    This project was bootstrapped with Create React App.

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in the browser.

    The page will reload if you make edits.
    You will also see any lint errors in the console.

    npm test

    Launches the test runner in the interactive watch mode.
    See the section about running tests for more information.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    npm run eject

    Note: this is a one-way operation. Once you eject, you canโ€™t go back!

    If you arenโ€™t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point youโ€™re on your own.

    You donโ€™t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldnโ€™t feel obligated to use this feature. However we understand that this tool wouldnโ€™t be useful if you couldnโ€™t customize it when you are ready for it.

    Learn More

    You can learn more in the Create React App documentation.

    To learn React, check out the React documentation.

    Code Splitting

    This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

    Analyzing the Bundle Size

    This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

    Making a Progressive Web App

    This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

    Advanced Configuration

    This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

    Deployment

    This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

    npm run build fails to minify

    This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

    Visit original content creator repository
    https://github.com/imakepossible/covid-19-vaccine-slot

  • vue-monthly-picker

    vue-monthly-picker

    Vue Monthly Picker Components

    npm version CircleCI

    Checkout demo at https://ittus.github.io/vue-monthly-picker/

    Support

    Buy Me A Coffee

    Install

    npm install vue-monthly-picker --save
    
    import VueMonthlyPicker from 'vue-monthly-picker'
    Vue.component('my-component', {
        components: {
            VueMonthlyPicker
        }
    });

    Usage

    <vue-monthly-picker
     v-model="selectedMonth">
    </vue-monthly-picker>

    Note: v-model binding value need to be a moment object

    Available props

    Prop Type Default Description
    disabled Boolean false Enable/disable component
    monthLabels Array ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] Customize month labels
    placeHolder String Place holder when value is null
    min moment null Minimum time to select
    max moment null Maximum time to select
    dateFormat String YYYY/MM Display format.
    value moment null Moment value of selected month and year
    alignment String left Alignment of input value, possible value: left, right, center
    selectedBackgroundColor String #007bff Background color of selected value. It can be HTML color name (red, green, blue) or hexa color code (#00FF00, #0000FF)
    clearOption Boolean true Show/Hide clear option
    inputClass String input Customize css class for visible element

    Events

    Event Params Description
    selected selected month in moment A month has been selected

    Build Setup

    # install dependencies
    npm install
    
    # serve with hot reload at localhost:8080
    npm run dev
    
    # build for production with minification
    npm run build
    
    # run all tests
    npm run test
    Visit original content creator repository https://github.com/ittus/vue-monthly-picker
  • Winshark

    Winshark

    Wireshark plugin to work with Event Tracing for Windows

    Microsoft Message Analyzer is being retired and its download packages were removed from microsoft.com sites on November 25 2019. Wireshark have built a huge library of network protocol dissectors. The best tool for Windows would be one that can gather and mix all type of logs…

    Welcome Winshark!!!

    Winshark is based on a libpcap backend to capture ETW (Event tracing for Windows), and a generator that will produce all dissectors for known ETW providers on your machine. We’ve added Tracelogging support to cover almost all log techniques on the Windows Operating System.

    With Winshark and the power of Windows, we can now capture Network and Event Logs in the same tool. Windows exposes a lot of ETW providers, in particular one for network capture ๐Ÿ˜‰ No more need for an external NDIS driver.

    This is a huge improvement in terms of use:

    • Enable to mix all kind of events (system and network)
    • Enable to use Wireshark filtering on event log
    • Enable to track network and system logs by Process ID!!!
    • Enable to capture Windows log and network trace into an unique pcap file!!!
    • Capture NamedPipe through NpEtw file system filter driver

    If you want to:

    Install

    Please install Wireshark before. Then just install Winshark.

    Currently, you have to ask Wireshark to interpret the DLT_USER 147 as ETW. This is because you have not yet a true value from libpcap for our new Data Link. We issued a pull request to have a dedicated DLT value; it is still pending. To do that you have to open Preferences tab under the Edit panel. Select DLT_USER under Protocols and Edit the encapsulations table:

    DLT_USER configuration

    And set winshark for DLT = 147 :

    DLT 147 set to ETW protocol

    Enjoy!

    Build

    Winshark is powered by cmake:

    git clone https://github.com/airbus-cert/winshark --recursive
    mkdir build_winshark
    cd build_winshark
    cmake ..\Winshark
    cmake --build . --target package --config release
    

    How does it work

    To better understand how Winshark works, we need to understand how ETW works first.

    ETW is splitted into three parts:

    • A Provider that will emit log and identified by unique ID
    • A Session that will mix one or more providers
    • A Consumer that will read logs emitted by a session

    Provider

    There is a lot of different kinds of providers. The most common, and usable, are registred providers. A registred provider, or a manifest-based provider, is recorded under the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers. This makes the link between a provider ID and a dll. The manifest is encompassed into the associated dll into a resource name WEVT_TEMPLATE.

    You can list all providers registred on your machine using logman:

    logman query providers
    

    You can also list all providers bound by a particular process:

    logman query providers -pid 1234
    

    Some of them could appears without name; these kinds of provider can produce WPP or TraceLogging logs.

    Session

    Sessions are created to collect logs from more than one provider. You can create your own session using logman:

    logman start Mysession -p "Microsoft-Windows-RemoteDesktopServices-RdpCoreTS" -ets -rt
    logman update MySession -p "Microsoft-Windows-NDIS-PacketCapture" -ets -rt
    

    You can list all active sessions from an admin command line:

    logman query -ets
    
    Data Collector Set                      Type                          Status
    -------------------------------------------------------------------------------
    ...
    EventLog-Application                    Trace                         Running
    EventLog-Microsoft-Windows-Sysmon-Operational Trace                         Running
    EventLog-System                         Trace                         Running
    ...
    The command completed successfully.
    

    You can see here some interesting session use by the event logger to capture logs from Application and System sessions and from Sysmon.

    Consumer

    A consumer is a simple program that will read logs from a session. Well-known consumers are:

    • Event Logger
    • logman
    • netsh
    • tracert

    And now Winshark!!! Winshark is a simple ETW consumer. The real underlying consumer is libpcap, (wpcap.dll for Windows) which is used by dumpcap.exe which is the process in charge of packet capture.

    Wireshark

    Wireshark is split in three parts (yes, him too):

    • Wireshark.exe which is in charge of parsing and dissecting protocols
    • dumpcap.exe which is in charge of capturing packets
    • libpcap (wpcap.dll) which is in charge of interfacing between dumpcap.exe and the Operating System

    Winshark takes place in the first and last parts. It implements a backend for libpcap to capture ETW events. Winshark works on ETW sessions, this is why you can select an ETW session in place of Network interface at the start of capture. Then Winshark generates lua dissectors for each manifest-based provider registred on your computer, during the installation step. Winshark is also able to parse tracelogging-based providers.

    Capture network traffic

    To capture network traffic using Winshark, you can use two simple ways:

    pktmon (Packet Monitor)

    pktmon is an in-box, cross-component network diagnostics tool for Windows. It can be used for packet capture, packet drop detection, packet filtering and counting (supported from RS5)

    (https://docs.microsoft.com/en-us/windows-server/networking/technologies/pktmon/pktmon)

    pktmon start -c -m real-mode
    

    you can run pktmon -h for more options (as admin)

    For instance: Add a filter for packets

    pktmon filter add -t icmp
    pktmon filter add -t tcp -p 80
    

    Then launch Wireshark with administrator privileges and select Pktmon interface: ETW interface selection

    That will start the packet capture:

    ETW packet capture

    netsh trace

    netsh.exe trace start capture=yes report=no correlation=no
    

    And then create an ETW session associated with the Microsoft-Windows-NDIS-PacketCapture provider:

    logman start Winshark-PacketCapture -p "Microsoft-Windows-NDIS-PacketCapture" -rt -ets
    

    Then launch Wireshark with administrator privileges and select Winshark-PacketCapture interface:

    ETW interface selection

    That will start the packet capture:

    ETW packet capture

    Filtering on process ID

    ETW marks each packet with a header that sets some metadata about the sender. One of these is the Process ID of the emitter. This is a huge improvement from a classic packet capture from an NDIS driver. Simply fill the filter field of Wireshark with the following expression:

    winshark.header.ProcessId == 1234
    

    ETW packet capture

    Capturing NamedPipe

    @kobykahane provide a file system filter driver that emit an ETW for every action perform on a NamedPipe.

    Install

    • Pass driver signing check in test mode
    bcdedit /set testsigning on
    
    • Install NpEtwSetup.msi
    • Reboot
    • Update Winshark dissector by double clicking C:\Program Files\Wireshark\WinsharkUpdate.bat with Admin rights

    Capture

    • Open a cmd.exe in Admin mode
    • Start the driver
    sc start NpEtw
    
    • Create an ETW Session
    logman start namedpipe -p NpEtw -ets -rt
    
    • Start Wireshark and select the namedpipe session. Enjoy!

    ETW namedpipe capture

    SSTIC (Symposium sur la sรฉcuritรฉ des technologies de l’information et des communications)

    This project is part of a presentation made for SSTIC

    Visit original content creator repository https://github.com/airbus-cert/Winshark
  • Winshark

    Winshark

    Wireshark plugin to work with Event Tracing for Windows

    Microsoft Message Analyzer is being retired and its download packages were removed from microsoft.com sites on November 25 2019. Wireshark have built a huge library of network protocol dissectors. The best tool for Windows would be one that can gather and mix all type of logs…

    Welcome Winshark!!!

    Winshark is based on a libpcap backend to capture ETW (Event tracing for Windows), and a generator that will produce all dissectors for known ETW providers on your machine. We’ve added Tracelogging support to cover almost all log techniques on the Windows Operating System.

    With Winshark and the power of Windows, we can now capture Network and Event Logs in the same tool. Windows exposes a lot of ETW providers, in particular one for network capture ๐Ÿ˜‰ No more need for an external NDIS driver.

    This is a huge improvement in terms of use:

    • Enable to mix all kind of events (system and network)
    • Enable to use Wireshark filtering on event log
    • Enable to track network and system logs by Process ID!!!
    • Enable to capture Windows log and network trace into an unique pcap file!!!
    • Capture NamedPipe through NpEtw file system filter driver

    If you want to:

    Install

    Please install Wireshark before. Then just install Winshark.

    Currently, you have to ask Wireshark to interpret the DLT_USER 147 as ETW. This is because you have not yet a true value from libpcap for our new Data Link. We issued a pull request to have a dedicated DLT value; it is still pending. To do that you have to open Preferences tab under the Edit panel. Select DLT_USER under Protocols and Edit the encapsulations table:

    DLT_USER configuration

    And set winshark for DLT = 147 :

    DLT 147 set to ETW protocol

    Enjoy!

    Build

    Winshark is powered by cmake:

    git clone https://github.com/airbus-cert/winshark --recursive
    mkdir build_winshark
    cd build_winshark
    cmake ..\Winshark
    cmake --build . --target package --config release
    

    How does it work

    To better understand how Winshark works, we need to understand how ETW works first.

    ETW is splitted into three parts:

    • A Provider that will emit log and identified by unique ID
    • A Session that will mix one or more providers
    • A Consumer that will read logs emitted by a session

    Provider

    There is a lot of different kinds of providers. The most common, and usable, are registred providers. A registred provider, or a manifest-based provider, is recorded under the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers. This makes the link between a provider ID and a dll. The manifest is encompassed into the associated dll into a resource name WEVT_TEMPLATE.

    You can list all providers registred on your machine using logman:

    logman query providers
    

    You can also list all providers bound by a particular process:

    logman query providers -pid 1234
    

    Some of them could appears without name; these kinds of provider can produce WPP or TraceLogging logs.

    Session

    Sessions are created to collect logs from more than one provider. You can create your own session using logman:

    logman start Mysession -p "Microsoft-Windows-RemoteDesktopServices-RdpCoreTS" -ets -rt
    logman update MySession -p "Microsoft-Windows-NDIS-PacketCapture" -ets -rt
    

    You can list all active sessions from an admin command line:

    logman query -ets
    
    Data Collector Set                      Type                          Status
    -------------------------------------------------------------------------------
    ...
    EventLog-Application                    Trace                         Running
    EventLog-Microsoft-Windows-Sysmon-Operational Trace                         Running
    EventLog-System                         Trace                         Running
    ...
    The command completed successfully.
    

    You can see here some interesting session use by the event logger to capture logs from Application and System sessions and from Sysmon.

    Consumer

    A consumer is a simple program that will read logs from a session. Well-known consumers are:

    • Event Logger
    • logman
    • netsh
    • tracert

    And now Winshark!!! Winshark is a simple ETW consumer. The real underlying consumer is libpcap, (wpcap.dll for Windows) which is used by dumpcap.exe which is the process in charge of packet capture.

    Wireshark

    Wireshark is split in three parts (yes, him too):

    • Wireshark.exe which is in charge of parsing and dissecting protocols
    • dumpcap.exe which is in charge of capturing packets
    • libpcap (wpcap.dll) which is in charge of interfacing between dumpcap.exe and the Operating System

    Winshark takes place in the first and last parts. It implements a backend for libpcap to capture ETW events. Winshark works on ETW sessions, this is why you can select an ETW session in place of Network interface at the start of capture. Then Winshark generates lua dissectors for each manifest-based provider registred on your computer, during the installation step. Winshark is also able to parse tracelogging-based providers.

    Capture network traffic

    To capture network traffic using Winshark, you can use two simple ways:

    pktmon (Packet Monitor)

    pktmon is an in-box, cross-component network diagnostics tool for Windows. It can be used for packet capture, packet drop detection, packet filtering and counting (supported from RS5)

    (https://docs.microsoft.com/en-us/windows-server/networking/technologies/pktmon/pktmon)

    pktmon start -c -m real-mode
    

    you can run pktmon -h for more options (as admin)

    For instance: Add a filter for packets

    pktmon filter add -t icmp
    pktmon filter add -t tcp -p 80
    

    Then launch Wireshark with administrator privileges and select Pktmon interface: ETW interface selection

    That will start the packet capture:

    ETW packet capture

    netsh trace

    netsh.exe trace start capture=yes report=no correlation=no
    

    And then create an ETW session associated with the Microsoft-Windows-NDIS-PacketCapture provider:

    logman start Winshark-PacketCapture -p "Microsoft-Windows-NDIS-PacketCapture" -rt -ets
    

    Then launch Wireshark with administrator privileges and select Winshark-PacketCapture interface:

    ETW interface selection

    That will start the packet capture:

    ETW packet capture

    Filtering on process ID

    ETW marks each packet with a header that sets some metadata about the sender. One of these is the Process ID of the emitter. This is a huge improvement from a classic packet capture from an NDIS driver. Simply fill the filter field of Wireshark with the following expression:

    winshark.header.ProcessId == 1234
    

    ETW packet capture

    Capturing NamedPipe

    @kobykahane provide a file system filter driver that emit an ETW for every action perform on a NamedPipe.

    Install

    • Pass driver signing check in test mode
    bcdedit /set testsigning on
    
    • Install NpEtwSetup.msi
    • Reboot
    • Update Winshark dissector by double clicking C:\Program Files\Wireshark\WinsharkUpdate.bat with Admin rights

    Capture

    • Open a cmd.exe in Admin mode
    • Start the driver
    sc start NpEtw
    
    • Create an ETW Session
    logman start namedpipe -p NpEtw -ets -rt
    
    • Start Wireshark and select the namedpipe session. Enjoy!

    ETW namedpipe capture

    SSTIC (Symposium sur la sรฉcuritรฉ des technologies de l’information et des communications)

    This project is part of a presentation made for SSTIC

    Visit original content creator repository https://github.com/airbus-cert/Winshark
  • docker-gunbot

    Gunbot Docker Edition for Synology NAS (Binance, Kucoin)

    GitHub stars GitHub forks GitHub issues Docker Pulls Docker Stars GitHub last commit Build and Push Docker image

    โœ… Compatible with Gunbot version: Gunbot v30.4.3 https://gunthy.org/downloads/

    โœ… Compatible with Synology DSM6.0, DSM7.0 (both on DS1019+)

    ๐Ÿ†˜ Help and support via magicdude4eva/docker-gunbot

    Although this Docker Image has been tested on a Synology NAS, it will work essentially in any Docker-environment with the adjustment of the mount-point needed. I have provided a base-configuration under /config/ which I suggest you read and adjust. If you use the autoconfig (please read the /config/autoconfig-instructions.txt before enabling) provided, and once you have added your Binance credentials, the BOT will start trading.

    ๐Ÿšธ The provided config contains a Autoconfig using a Stepgrid trading algorithm with the base of BTC, trading 8 pairs. This works at the moment extremely well for at the current market (August 2021) with returns of 1-8% per trade and trading between 20-50 times per day on Binance. Do read the /config/autoconfig-instructions.txt and only change what is allowed. Alternatively, use the standard Gunbot install and use an algorithm you understand / are comfortable with.

    ๐Ÿ˜ญ Do not come crying to me if you lost your house and your wife left you because you traded away your savings. Be responsible and only trade what you are prepared to lose. I am not a financial advisor, and will not help you with your financial troubles.

    Detailed Gunbot documentation and support is available via https://wiki.gunthy.org/

    Gunbot Docker File
    Gunbot Trading Console via Webview


    paypal ๐Ÿบ Please support me: Although all my software is free, it is always appreciated if you can support my efforts on Github with a contribution via Paypal – this allows me to write cool projects like this in my personal time and hopefully help you or your business.


    I am a Gunbot Reseller and Binance Affiliate

    You need at least a “Gunbot Standard” License to trade on Binance and use the provided autoconfig tool which automatically trades BTC-ALT coins for you. I am an offical Gunbot Reseller and you can purchase a license straight from the links below or via gunbot.at:

    Gunbot Edition Price Link
    Gunbot Standard $ 199,00 gunbot/promoStandard
    Gunbot Pro $ 299,00 gunbot/promoPro
    Gunbot Ultimate $ 499,00 gunbot/promoUltimate

    (*) You can always upgrade to a higher license later – I can help you – contact me on Telegram @magicdude4eva

    ๐Ÿ† If you are new to Binance, I can share my affiliate link where both of us will earn 10% commission on trades.

    ๐Ÿš€ 2021-11-20: If you have not signed up with Crypto.com to trade in CRO, read this: Crypto.com Visa Debit Card with Cashback and 100% rebate on Netflix, Spotify & Amazon Prime

    Docker image with colorised output & Telegram Support

    Gunbot Colorised Console Output via Docker
    Gunbot Dockerfile with glibc and colorised output

    Gunbot Telegram Notifications via Docker
    Gunbot Dockerfile with Telegram Notifications

    Setup On Synology

    โ„น๏ธ I use the container gunbot for Binance and the container gunbot-kucoinfor Kucoin. If you do not need both, delete the one you are using.

    โ„น๏ธ The container gunbot-kucoin only trades USDT-CRO as I like Crypto.com – please adjust if you need anything else. The trading limit for USDT-CRO is set to USDT=150 per trade (see "TRADING_LIMIT": "150",in

    1. If you have a mount-point /volume1/, create the directory /volume1/docker/gunbot/ and skip to Step 3)

    2. If you do not have /volume1/, adjust the mountpoints of /volume1/docker/gunbot/ in docker-compose.yml

    3. Copy docker-compose.yml, dockerignore and Dockerfile from this repo to your ./gunbot/-folder. If you also want to use beta-releases, use the Dockerfile.slipstream.local instead and rename it to Dockerfile. This requires that you have the beta-release in the same folder as the Dockerfile named as gunthy-linux.zip

    3.a.) I created a setup.sh which you can execute in your gunbot-directory which will do the copying of files and adjusting permissions – run this in your gunbot directory:

    curl -fsSL -H 'Cache-Control: no-cache' -o setup.sh https://raw.githubusercontent.com/magicdude4eva/docker-gunbot/refs/heads/main/setup.sh && bash setup.sh
    

    โ„น๏ธ Note: you will still need to adjust config/config.js and adjust your docker-compose.yml

    1. Adjust the timezone setting TZ=Europe/Vienna in docker-compose.yml and Dockerfile to your local settings

    2. Place your config.js into /config and/or /config-kucoin

    3. Adjust the download Link in Dockerfile for INSTALL_URL. The latest software can be found via: https://www.gunbot.com/downloads/

    4. and then execute:

    cd /volume1/docker/gunbot/
    docker build -t gunbot .
    docker-compose up -d
    
    # Logs for Gunbot-Binance
    docker logs -n 100 -f gunbot
    
    # Logs for Gunbot-Kucoin
    docker logs -n 100 -f gunbot-kucoin
    

    Updating Gunbot

    From time to time I publish updates – mostly to adjust the Linux image or to include the latest Gunbot release. You can manually update by:

    1. Stop and delete the Gunbot-Container in Synology Docker
    2. Repeat Steps 6-7 above

    Telegram Configuration

    Notifications work by first creating a personal bot on Telegram, Gunbot then connects to this bot to push notifications to you.

    This is how to create a bot:

    • Talk to @botfather. Create a new bot with the command /newbot and choose a name and username for your bot. Save the bot token shown.
    • Talk to @myidbot to see your Chat ID, save it.
    • Enable Telegram notifications for Gunbot, and enter the token and ID you’ve just gathered. Use the ID for both the user and admin ID fields, this makes sure that only you can interact with the Telegram bot. Alternatively, you can set a comma separated list for Admin ID, specifying multiple IDs who may interact with the bot.
    • Start a chat with the username you’ve picked for your bot, and hit the start button. If you don’t see a start button, write “/start” and send it as message.
    • To enable trade notifications, enable these in the settings menu inside the Telegram bot.
    • The Telegram bot is fully integrated into Gunbot. All you need to do to start the Telegram bot is enable Telegram notifications in your Gunbot settings.
    • After setting it up, type /start to your bot to open the menu.

    Overview of Gunbot Licenses

    Note: You will need to have at lease “Gunbot Standard” to support all strategies, and I strongly recommend it. If you want to trade on multiple exchanges use “Gunbot Pro” (3 API Slots) or “Gunbot Ultimate (5 API Slots)

    Gunbot License differences
    Gunbot License differences – click to purchase a “Gunbot Standard License” or pick other licenses from above

    How does the autoconfig work?

    The idea is to have a fully automated setup for BTC-alt trading that trades relatively frequently (in tests, about 20-50 times per day) and only focusses on small trades with around 0.5% to 2% profit per trade. This config bundle offers completely autonomous trading with the stepGrid strategy. You set a few basic settings like how many pairs to trade, the script handles everything else.

    CleanShot 2021-09-19 at 11 53 11@2x

    The setup consists of a config.js and autoconfig.json file, which do the following (summarized):

    ๐Ÿšธ The “autoconfig.json” in the “gunbot” container trades as base both BTC-ALT and BNB-ALT and each base uses 6 pairs – so you will have 6 BTC-trades and 6-BNB-trades. Please adjust this if you do not want to trade in these volumes (you will need 0,3BTC and 2BNB for it to properly work)

    Autoconfig.json

    ๐Ÿšธ Warnings:

    • Because of how trading limit compounding is handled, the setup is difficult to combine with other trades on the same acount
    • Manual trading on the same exchange account and base currency, or manually made config changes can lead to unexpected behavior
    • Due to the lack of a bid/ask spread filter on Huobi, pair selection is likely more risky there
    • Since stop losses are sometimes used in this setup, losing sell orders can happen
    • The stepGrid strategy is great, but beware for very low volume markets as trading behavior might get erratic. In such a case using the enforce step size option in the strategy itself can help.
    • All pairs for the exchange must be handled by the included AutoConfig jobs
    • READ THE WHOLE INSTRUCTIONS

    Features:

    • Scans markets for volatile pairs and adds them automatically, trades them with the stepGrid strategy
    • Evaluates results for active trading pairs, continously replacing the worst performing pair with another
    • Supports trading multiple base currencies on the same account, overlap between pairs is prevented automatically
    • Supports the following base currencies: BTC
    • Compounding trading limit, with an option to keep reserves
    • Occasionally uses a higher trading limit when the market seems favorable, including a stop loss mechanism
    • Frees up funds in case the account runs out of money for further buy orders
    • Protection against possible losing trades after a very large price difference between buy orders

    Notes:

    • Donโ€™t use all your funds for this. Keeping reserves is always a good idea, you never know what the market will bring in the future
    • Try to keep relatively low numbers of pairs, to ensure frequent processing per pair
    • You’ll see more pairs being added than it may trade, this is fine because it won’t actually trade every single added pair
    • Upgrades are as simple as overwriting the autoconfig.json file, unless specified differently in the release notes

    Troubleshooting

    If you do not manage to resolve your problems with basic troubleshooting, log a Issue in this project. For basic problems:

    1. Check that your permissions of folders are correct:
    image
    1. Check the log output when starting the container docker logs -n 100 -f gunbot

    2. Check for any Gunbot errors – most of the time the JSON is invalid (missing brackets, commas, quotes)

    If you log an issue, ensure that you include your logs, but make sure to remove any reference to your API keys or Gunbot masterkeys/passwords.

    Donations are always welcome

    ๐Ÿป Support my work
    All my software is free and built in my personal time. If it helps you or your business, please consider a small donation via PayPal โ€” it keeps the coffee โ˜• and ideas flowing!

    ๐Ÿ’ธ Crypto Donations
    You can also send crypto to one of the addresses below:

    (BTC)   bc1qdgdkk7l98pje8ny9u4xavsvrea8dw6yu8jpnyf
    (ETH)   0x5986f713A538D6bCaC0865564dCD45E2600A3469  
    (POL)   0x5986f713A538D6bCaC0865564dCD45E2600A3469
    (CRO)   0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C (Cronos or Crypto.com Paystring magicdude$paystring.crypto.com)
    (BNB)   0x5986f713A538D6bCaC0865564dCD45E2600A3469
    (LTC)   ltc1qexst2exxksfyg7erfzlfrm23twkjgf7e5fn64t
    (DOGE)  DMQsxc9XGF6526drBJDZeX7AjFDJsEz4mN
    (SOL)   t4bYQCUuoCUrp7kJ4Mz314npcTuKoUSXj28UgdMrfTb
    

    ๐Ÿงพ Recommended Platforms

    • ๐Ÿ‘‰ Curve.com: Add your Crypto.com card to Apple Pay
    • ๐Ÿ” Crypto.com: Stake and get your free Crypto Visa card
    • ๐Ÿ“ˆ Binance: Trade altcoins easily

    Use Rotki for Crypto Tracking

    Referral: A great crypto currency tracking platform which can be selfhosted is Rotki CleanShot 2021-10-03 at 10 09 53@2x

    You can find the composer file under the rotki folder.

    visitors

    Visit original content creator repository https://github.com/magicdude4eva/docker-gunbot