Blog

  • CS2-ReservedSlots

    Reseved Slots is a CS2 plugin that is used to reserve slots for VIP players or Admins.
    Designed for CounterStrikeSharp framework


    Discord Support Server

    Installation

    1. Download the lastest release https://github.com/NockyCZ/CS2-ReservedSlots/releases/latest
      • ReservedSlots.zip file is a version that does not support Discord Utilities
      • ReservedSlots_DU_Support.zip file is a version that supports Discord Utilities (You can combine flags and discord roles)
    2. Unzip into your servers csgo/addons/counterstrikesharp/plugins/ dir
    3. Restart the server

    Dependencies

    Configuration

    configs/plugins/ReservedSlots/ReservedSlots.json

    What it does
    Reserved Slots Plugin version that does not support Discord Utilities
    Reserved Flags • List of Flags for reserved slot
    – Cannot be empty!
    Reserved Admin Flags • List of Flags for admin reserved slot
    – When a player with an Admin reserved slot joins, no one is kicked
    – Can be empty
    Reserved Slots (With Discord Utilities Support) Plugin version that supports Discord Utilities
    Reserved Flags and Roles • List of Flags and Discord Roles for reserved slot
    – You can combine roles and flags (If a player does not have a role, his flags will be checked)
    – Cannot be empty!
    Reserved Admin Flags and Roles • List of Flags and Discord Roles for admin reserved slot
    – When a player with an Admin reserved slot joins, no one is kicked
    – You can combine roles and flags (If a player does not have a role, his flags will be checked)
    – Can be empty!

    What it does
    Reserved Slots How many slots will be reserved if the reserved slots method is 1 or 2
    Reserved Slots Method 0 – There will always be one slot open. For example, if your maxplayers is set to 10, the server can have a maximum of 9 players. If a 10th player joins with a Reservation flag/role, it will kick a player based on the Kick type. If the 10th player doesn’t have a reservation flag/role, they will be kicked
    1 – Maintains the number of available slots according to the reservation slots setting, allowing only players with a Reservation flag/role to join. For example, if you have maxplayers set to 10 and Reserved slots set to 3, when there are 7/10 players on the server, additional players can only join if they have a Reservation flag/role. If they don’t, they will be kicked. If the server is already full and a player with a Reservation flag/role attempts to join, it will kick a player based on the Kick type
    2 – It works the same way as in method 2, except players with a Reservation flag/role are not counted towards the total player count. For example, if there are 7/10 players on the server, and Reserved slots are set to 3. Out of those 7 players, two players have a Reservation flag/role. The plugin will then consider that there are 5 players on the server, allowing two more players without a Reservation flag/role to connect. If the server is already full and a player with a Reservation flag/role attempts to join, it will kick a player based on the Kick type
    Leave One Slot Open Works only if reserved slots method is set to 1 or 2. If set to true, there will always be one slot open. (true or false)
    Kick Immunity Type Who will be immune to the kick?
    0 – Players with a Reserved flag/role or an Admin reserved flag/role
    1 – Only players with a Reserved flag/role
    2 – Only players with an Admin reserved flag/role
    Kick Reason Reason for the kick (Use the number from NetworkDisconnectionReason)
    Kick Delay This means that the player will be kicked after a certain time (seconds) (value less than 1 means the player will be kicked immediately)
    Kick Check Method When a player will be selected for kick when a player with a Reserved flag/role joins??
    0 – When a player with a Reserved flag/role joins
    1 – When a player with a Reserved flag/role choose a team
    Kick Type How is a players selected to be kicked?
    0 – Players will be kicked randomly
    1 – Players will be kicked by highest ping
    2 – Players will be kicked by highest score
    3 – Players will be kicked by lowest score
    Kick Players In Spectate Kick players who are in spectate first? (true or false)
    Log Kicked Players (true or false)
    Display Kicked Players Message Who will see the message when a player is kicked due to a reserved slot
    0 – None
    1 – All players
    2 – Only Admins with the @css/generic flag


    Visit original content creator repository
    https://github.com/NockyCZ/CS2-ReservedSlots

  • nucc-cpp-library

    WARNING: This documentation is horribly outdated! All will be updated once I’m done with it.

    Welcome to the NUCC C++ Library, a multi-include library of headers for modern C++ (from C++17).

    Its purpose is to allow easy interaction with data from CyberConnect2‘s in-house NUCC engine, that mostly being data found in the XFBIN container format, which sports the file signature: NUCC / 4E 55 43 43.

    This library is nowhere near finished, and many design choices are subject to change, but otherwise, its internal functionality is more-or-less already figured out, and the library should be updated at least semi-frequently.

    Contributing

    Although I intend to work on this library myself for the most part, largely for my own learning and development as a programmer, help and feedback is much appreciated – granted it’s constructive!

    More importantly though, the best way to contribute to this project by expanding its support of the various nuccChunkBinary formats for the various different games that use them. I’ll release more info about this as the library’s basic functionality nears completion.

    Design Goals

    While there are XFBIN libraries out there for Rust, Python, and C#, this is the first for C++.

    This library aims for:

    • Ease of integration → Everything is intended to be as abstracted as is useful, and although there are multiple headers you may need to include, they are also intentionally structured to be easy to organise. Most projects focusing on one game shouldn’t need to include more than 2.
    • A myriad of features → Across the CC2 NUCC games, there’s a lot that happens with XFBINs behind the scenes, such as en/decryption, hashing, and more – all actions which this library will support.
    • Efficiency → For a library intended to be used in bigger projects, the faster it can do its part, the better. As such, it should be as optimal as possible.
    • Flexibility → This library should be able to achieve any (reasonable) task without driving users insane.

    Features

    Below is a list of all the things this library can already do…

    • Load XFBIN files by path and deserialise them into an XFBIN class.
    • Access deserialised NUCC data for nuccChunkPage and nuccChunkBinary.
    • Serialise XFBIN files from scratch or otherwise.

    … and here is a list of things to-be-added in the near future:

    • More chunk support, eventually adding for them all.
    • CRC32 hashing, used in the CC2 games for various things.
    • Encryption and decryption.
    • And much more…

    How To Use

    The docs for this library are incredibly lacking for the timebeing, and will be updated once I’m more confident in the design.

    Everything in the library is under the nucc namespace.

    To access specific chunk information from an XFBIN object, you must first initialise an object depending on what chunk type you need.

    #include "include/nucc/xfbin.hpp" // Including the library
    
    int main() {
      nucc::XFBIN xfbin{"./PlayerColorParam.bin.xfbin"};
      nucc::Binary binary_chunk{ xfbin.fetch("PlayerColorParam") };
    }

    In the case of Binary objects, there is a vast library of the different formats they can contain.

    #include "include/nucc/xfbin.hpp"
    #include "include/nucc/chunks/binary/asbr.hpp" // JoJo's Bizarre Adventure: All-Star Battle R formats
    
    #include <iostream>
    
    int main() {
      nucc::XFBIN xfbin{"./PlayerColorParam.bin.xfbin"};
      nucc::Binary binary_chunk{ xfbin.fetch("PlayerColorParam") };
      nucc::ASBR::PlayerColorParam pcp{ binary_chunk.data() };
      std::cout << pcp.entries[0].character_id; // "1jnt01"
    }

    Examples

    A lot of us learn best from examples, so here are some common (and not so common) tasks you may want to do with this library.

    Drag-and-Drop Loading

    This can take an XFBIN file dragged onto the application and immediately parse it into an XFBIN object.

    int main(int argc, char* argv[]) {
      nucc::XFBIN xfbin{argv[1]};
    }

    Visit original content creator repository
    https://github.com/KojoBailey/nucc-cpp-library

  • harvest_qmcpack

    master build status

    harvest_qmcpack

    Python module containing useful routines to inspect and modify qmcpack objects.

    Quick Start

    Install

    Clone the repository and add it to PYTHONPATH. To use examples, add bin to PATH.

    git clone https://github.com/Paul-St-Young/harvest_qmcpack.git ~
    export PYTHONPATH=~/harvest_qmcpack:$PYTHONPATH
    export PATH=~/harvest_qmcpack/bin:$PATH

    Prerequisites can be installed following requirement.txt

    cd ~/harvest_qmcpack; pip install --user -r requirements.txt

    You can also use pip if you do not intend to change the code

    git clone https://github.com/Paul-St-Young/harvest_qmcpack.git ~/harvest_qmcpack
    pip install --user ~/harvest_qmcpack

    To update to the newest version:

    cd ~/harvest_qmcpack
    git pull
    pip install --user --upgrade ~/harvest_qmcpack

    Tests

    Unit tests should work with either nosetest or pytest

    cd ~/harvest_qmcpack; pytest -v .

    Use

    The library functions can be used in a python script

    # extract all scalar data from a run directory 
    #  look for scalar.dat files and collect statistics
    #  hint: run dirrctory does not have to be an actual run
    import os
    from qharv.reel  import scalar_dat, mole
    from qharv.sieve import scalar_df
    """
    *** Strategy adopted in this script:
     1. use "mole" to dig up the locations of all 
      scalar.dat to be analyzed.
     2. use "reel" to reel in all scalar data 
      without prejudice.
     3. use "sieve" to remove equilibration data 
      and perform averages to shrink the database.
    only two human inputs are required: folder, nequil
    """
    
    # folder containing QMCPACK scalar.dat files
    folder = './runs'
    
    # define equilibration length and autocorrelation length
    nequil = 5
    kappa  = 1.0 # None to re-calculate
    #  runs should be designed to have short equilibration and
    # no autocorrelation. kappa can be calculated on-the-fly
    # ,be warned though: kappa calculation is slow. For nequil:
    # unfortunately I have yet to find a fast and RELIABLE
    # algorithm to determine nequil. For custom nequil, use
    # a dictionary in the `for floc in flist` loop.
    
    # generate the list of scalar.dat files to analyze
    flist = mole.files_with_regex('*scalar.dat', folder)
    
    # analyze the list of scalar.dat files
    data  = []
    for floc in flist:
      mydf = scalar_dat.parse(floc)
      mdf  = scalar_df.mean_error_scalar_df(mydf,nequil,kappa=kappa)
      assert len(mdf) == 1 # each scalar.dat should contribute only one entry
      # add metadata to identify runs
      mdf['path'] = os.path.dirname(floc)
      mdf['fdat'] = os.path.basename(floc)
      data.append(mdf)
    df = pd.concat(data).reset_index() # index must be unique for the database to be saved

    The examples in the “bin” folder can be ran in the shell

    $ stalk vmc.in.xml
    $ stab vmc.s000.scalar.dat
    $ slash-and-burn -y -v nscf
    $ rebuild_wf opt.in.xml

    Documentation

    Documentation is available on github pages.
    A local copy can be generated using sphinx (pip install --user sphinx).
    To generate the documentation, first use sphinx-apidoc to convert doc strings to rst documentation:

    cd ~/harvest_qmcpack/doc; sphinx-apidoc -o source ../qharv

    Next, use the generated Makefile to create html documentation:

    cd ~/harvest_qmcpack/doc; make html

    Finally, use your favorite browser to view the documentation:

    cd ~/harvest_qmcpack/doc/build; firefox index.html

    Examples

    Example usage of the qharv library are included in the “harvest_qmcpack/bin” folder.
    Each file in the folder is a Python script that performs a very specific task:

    • stalk: Show crystal structure specified in a QMCPACK input e.g. stalk vmc.in.xml
    • stab: Scalar TABle (stab) analyzer, analyze one column of a scalar table file, e.g. stab vmc.s000.scalar.dat
    • transplant: Backup nexus-generated folders. Allow user to select subfolders to backup. e.g. transplant graphene attic -s opt -s qmc -e will backup the QMC runs in folder “opt” and “qmc” from graphene/results and graphene/runs to attic/graphene/results and attic/graphene/runs. The “scf” and “nscf” folders will not be backed up.
    • slash-and-burn: Remove temporary files generated by Quantum Espresso.
    • rebuild_wf: Rerun QMCPACK on optimized wavefunctions, e.g. rebuild_wf opt.xml

    Description

    This module is intended to speed up on-the-fly setup, run, and analysis of QMCPACK calculations.
    The module should be used as a collection of python equivalents of bash commands.
    This module is NOT intended to be a full-fledged workflow tool.
    Please refer to nexus for complete workflow magnagement.

    Development Guidelines

    sown the seeds, inspect the crop;
    crossbreed to improve, transplant to adapt;
    reel them in, sieve for good, and refine for the best.
    — qharv maxim

    Laws of Programming (fully plagiarized from Asimov)

    1. A program may not produce wrong results or, through inaction, allow a user to produce wrong results.
    2. A program must accept manual overrides given to it by a user, except where such overrides will conflict with the First Law.
    3. A program must be as simple and as readable as possible, as long as doing so does not conflict with the First or the Second Law.

    note: the simplest way to satisfy both the First and the Second Law is to abort at an unknown request.

    Visit original content creator repository
    https://github.com/Paul-St-Young/harvest_qmcpack

  • CyberHawk

    CyberHawk : Anti-Theft Application for Windows Laptops

    Build Status Requirements Status License Badge Compatibility

    Laptops change the ways of communication, it provides an advantage of communicating with anyone virtually through video conferencing, email, etc., and it also provides a facility to store contact numbers, email id’s, in memory which reduces the concept of File-System to store personal information. Company related information and documents can be viewed anywhere and can be shared with anyone. Because of its light weight and small size, it can be stolen very easily and the confidential-information of any organization or personal details of people stored in the phone memory can be easily exposed. My project’s aim is to put forward a technique through which the thief, who steals any laptop installed with CyberHawk, gets captured and the user can make him/her stop misusing any confidential information. This application includes Socket communication, Reverse TCP where you can send video clips and photos to owner even under a firewall, unlike Email which includes only text. It gives the information about the thief by sending the snapshots and a small video clip of the thief to an alternate account, which helps us to recognize the thief.

    Getting Started

    These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

    Prerequisites

    1. Python 3.5
    2. PyQt 5.6
    3. MySQL (XAMPP Server Preferred)

    The complete Prerequisite can be obtained from requirements.txt

    Installing

    CyberHawk can run on Python 3.5.

    Before you proceed to start the application, you need to change the DB variables to suite your needs

    #Change line <b>89</b> in /CLIENT/main.py
    #Change line <b>5</b> in /MASTER/db.py
    db = MySQLdb.connect("localhost","<username>","<password>","<DB name>")
    

    OPTIONAL: phpMyAdmin SQL Dump of DB I used during development

    #You can import it through phpMyAdmin if you need
    Filename: credentials.sql
    DB name: credentials
    Table name: Master , Client
    
    # To open Client window
    $ cd CLIENT/
    $ python main.py
    

    Screenshots

    Client

    Client

    Master

    Master Master

    Usage

    # To open Client window
    $ cd CLIENT/
    $ python main.py
    
    # To open Master window
    $ cd MASTER/
    $ python main.py
    

    Deployment

    This project is still in dev-bench. I will be working in my spare time to make it fully production ready. I am open to any kind of collaboration make this project reach production level

    Built With

    • PyQT – GUI framework
    • Requests – Do I need to tell you more about it 😉

    Contributing

    All contributions are welcome. 🙂

    Authors

    • Aslam Muhammed Ideator, worker, debugger,… Ash-Shaun

    Troubleshooting

    1. MySQLdb may have a compatibility issue with Python 3.x . Also some users reported they were not able to install MySQLdb through pip.
    #Solution:
    $ pip install pymysql
    
    #change the import statement
    
    #import MySQLdb -> import pymysql
    

    Contributors

    None so far…

    License

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

    Acknowledgments

    Visit original content creator repository https://github.com/Ash-Shaun/CyberHawk
  • be-log

    title


    main


    🎯프로젝트 소개

    ✨ Version 2️ ✨ Version 1️
    팀원 구성 FE 1 FE 2, BE 4
    구현 기간 23.08.26 ~ 23.09.01 (6일) 23.05.05 ~ 23.05.11 (7일)
    담당 기능 클라이언트&서버 1인 프로젝트로 구현
    – JWT Token을 이용한 회원가입/로그인
    – 메인페이지/헤더
    – 게시글 CRUD
    – 프론트엔드 리딩 및 전반적인 UI 구현 전담
    – JWT Token을 이용한 회원가입/로그인
    – 메인페이지/헤더
    – 댓글 CRUD
    관련 링크 refactoring branch (← click!) before_main branch (← click!)

    ✨  React 학습 직후의 첫 협업 프로젝트인 Version 1의
        코드 개선 및 CRUD의 TypeScript 적용을 위해 Version 2를 구현하였습니다.
    


    🛠️ 사용기술

    구분 ✨ Version 2️ ✨ Version 1️
    Library React React
    Programming Language TypeScript JavaScript
    Styling Styled-Components Styled-Components
    State Management Recoil Tanstack-Query Redux Toolkit Tanstack-Query
    Server & DataBase Flask MongoDB Node.js MySQL
    Formatting ESLint Prettier Not used
    Version Control Git GitHub Git GitHub


    💭 기술적 의사결정

       TypeScript
    JavaScript는 변수의 타입을 자동으로 추론해주지만, 때로는 예기치 않은 동작을 할 수 있습니다.
    TypeScript는 정적 타입 시스템을 제공해 런타임에 발생하는 타입 관련 버그를 사전에 방지할 수 있으며,
    명시적인 타입 어노테이션을 사용해 코드의 가독성을 향상시킵니다.
    
    따라서 기존의 JavaScript가 아닌, TypeScript의 추가적인 학습을 위해 선정하였습니다.
    


       Styled-Components
    Styled-Components는 CSS-in-JS이므로 컴포넌트 단위로 스타일을 관리할 수 있으며
    JavaScript 표현식을 이용해 컴포넌트의 상태나 데이터에 따라 스타일을 동적으로 변경할 수 있습니다.
    
    또한 인라인으로 코드를 작성하는 테일윈드보다 코드 가독성이 더 좋다고 판단하였으며,
    꾸준히 사용했던 경험이 있으므로 빠른 구현을 위해 Styled-Components를 선정하였습니다.
    


       Recoil
    ver.1의 기존 코드는 Redux의 추가적인 학습을 위해
    Redux의 복잡성을 낮춘 Redux Toolkit을 사용하여 상태 관리를 진행했습니다.
    
    ver.2를 새롭게 구현하며 액션이나 리듀서를 사용하지 않고 atom을 기반으로 한 상태관리의 학습과,
    빠른 구현을 위해 상대적으로 간단하게 상태를 관리할 수 있는 Recoil을 선정하였습니다.
    


       Tanstack-Query
    Axios를 이용해 HTTP 네트워크 통신이 가능하지만 서버 상태관리나 캐싱을 직접 지원하지 않습니다.
    
    캐싱은 이전의 데이터나 리소스를 임시로 저장해 다음 요청 시 저장된 데이터를 사용함으로써
    서버 부하를 줄이고 성능을 향상시키므로, 이러한 기능을 지원하는 Tanstack-Query를 함께 사용했습니다.
    


       Flask MongoDB
    짧은 기간 내에 1인 프로젝트를 구현하기 위해 러닝커브가 높지 않고 간결한 Python과,
    미니멀한 기능을 제공하는 프레임워크인 Flask를 선정하였습니다.
    
    또한 Flask와 MongoDB는 모두 JSON 데이터 형식을 사용하여 클라이언트단과의 통신이 용이하므로
    빠른 개발을 위해 MongoDB를 선정하였습니다.
    


       ESLint Prettier
    타입을 잘 넘기고 있는지, 설정해둔 컨벤션을 준수하고 있는지 체킹해주는
    ESLint와 Prettier를 지정하여 코드 컨벤션을 일관성있게 유지하고,
    타입 에러나 불필요한 변수의 사용 등을 방지할 수 있었습니다.
    


    👀 기능 미리보기

      💡 회원가입

    📌 Portal을 이용한 모달 구현, true/false를 이용한 로그인/회원가입 화면 스위칭

    로그인 회원가입 화면스위치
    • React의 Portal을 이용해 모달을 구현하였습니다.

    • 회원가입과 로그인 모두 좌측에 공통되는 영역이 있으므로, useState에 true/false값을 부여해
      버튼 클릭에 따라 우측의 회원가입/로그인의 화면이 스위칭될 수 있도록 구현하였습니다.

    • 또한 화면이 스위칭될 때 기존의 input에 입력했던 값이 초기화될 수 있도록 하였습니다.


    📌 회원가입 유효성 검사

    유효성 회원가입
    • input에 입력하는 onChange값을 실시간으로 감지하여 정규표현식을 통해 유효성 검사를 진행했고,
      해당 값이 유효한지의 여부가 안내메시지를 통해 바로 확인될 수 있도록 하였습니다.

    • 필수값인 아이디, 비밀번호, 닉네임 중 하나라도 값이 입력되지 않았거나,
      모든 값은 입력했으나 하나라도 유효성 검증을 통과하지 못할 경우
      button의 disabled 속성을 이용해 회원가입 버튼이 비활성화되도록 구현하였습니다.

    • 비밀번호는 flask_bcrypt를 이용해 암호화하여 DB에 저장하였습니다.


    📌 ID 중복체크

    이미 존재하는 아이디
    • 입력한 ID가 DB에 존재하는지 중복 체크를 진행해 중복일 경우 에러 메세지를 출력했고,
      동시에 ID input을 초기화시켜 사용자가 명시적으로 알 수 있도록 구현하였습니다.



      💡 로그인

    📌 ID/PWD 유효성 검사

    ID 유효성 검증 PWD 유효성 검증
    ID 유효성 검증
    • 입력한 ID/PWD가 DB에 존재하지 않는다면 에러 메세지를 출력하고,
      해당하는 input을 초기화하여 사용자가 명시적으로 알 수 있도록 하였습니다.

    • 입력한 비밀번호 값 역시 bcrypt를 이용해 암호화된 값이 일치하는지 확인하였습니다.


    📌 로그아웃 시 저장된 데이터/토큰 초기화

    로그인아웃 토큰
    • 로그인 시 값이 모두 일치할 경우하여 로그인에 성공했을 경우만 jwt 토큰을 발급하였습니다.

    • 서버에서 발급한 토큰은 react-cookie 라이브러리를 이용해 cookie에 저장하고,
      response로 받은 id와 nickname은 Local Storage에 저장하였습니다.

    • 로그아웃 시 unset_jwt_cookies로 발급한 토큰을 삭제하고,
      해당 요청이 성공했을 경우 클라이언트에서도 cookie와 storage에 저장된 값을 삭제하였습니다.


    📌 JWT 토큰을 이용한 인증/인가 처리

    글 작성 인증
    • 모든 화면에 공통적으로 출력되는 Header에서 useEffect를 통해 렌더링이 될 때마다
      storage와 cookie에 있는 값이 유효한지 검증할 수 있도록 하였습니다.

    • 사용자가 하나라도 데이터를 임의로 삭제했을 경우 유효하지 않다는 alert를 보내고
      로그아웃 될 수 있도록 구현하였습니다.

    • 게시글 작성 시에는 모든 토큰과 저장된 값이 유효한지 먼저 체크했고,
      작성 도중 로그아웃하거나 정보를 임의 삭제할 때도 해당 인가가 유효하지 않도록 처리했습니다.



      💡 게시글

    📌 게시글 작성 및 입력값 유효성 검사

    마크다운을 이용한 게시글 작성 게시글 작성 유효성 검사
    마크다운을 이용한 게시글 작성
    • react-md-editor를 이용해 마크다운으로 게시글을 작성 및 출력할 수 있도록 구현하였습니다.

    • 작성 API 호출 전 모든 입력값이 존재하는지 유효성 검증을 진행했습니다.

    • 특히 썸네일을 담당하는 이미지 URL의 경우 값을 입력할 때마다
      new Image()의 이미지 객체를 이용해 해당 url로 이미지를 로딩할 수 있는지 체크하여
      유효하지 않은 이미지 URL값의 입력을 제한했습니다.

    • 사용자가 게시글 작성 페이지에 진입했을 때 바로 토큰과 저장된 정보를 체크하여
      토큰 및 정보가 유효하지 않을 경우에도 로그아웃 처리를 진행하지만,
      서버단 코드에서도 사용자가 작성 시 보낸 토큰과 DB에 존재하는 유저 정보를 대조하여
      유효한 토큰으로 접근하고 있는지, 해당 토큰에 저장된 값이 존재하는지 이중으로 인가를 확인했습니다.

    • 페이지 진입 시 게시글 작성인지, 수정인지 넘어오는 데이터를 통해 확인하여
      게시글 작성, 수정 두 개의 기능을 한 개의 컴포넌트로 재사용하였습니다.


    📌 게시글 수정/삭제

    게시글 수정 게시글 삭제
    게시글 수정
    • 게시글 수정, 삭제는 로그인 후 storage에 저장된 id값과 게시글 작성자의 id값을 비교하여
      일치할 경우에만 수정, 삭제 버튼이 출력되도록 하였습니다.

    • 게시글 수정 시에는 useLocation의 state를 이용해 기존 데이터를 수정 페이지로 넘겨주었으며,
      설정한 flag값으로 작성, 수정 기능을 구분하여 한 개의 컴포넌트를 재사용하였습니다.

    • 게시글 삭제 후에는 메인페이지로 랜딩시킴과 동시에
      invalidateQueries를 이용해 삭제된 내역이 반영되어 다시 보여질 수 있도록 하였습니다.

    • 수정, 삭제에도 서버로 넘어오는 토큰의 검증 및 해당 토큰에 담긴 값이
      DB에 담긴 작성자의 id값과 일치하는지 인가 확인을 진행했습니다.



      💡 기타

    📌 유효하지 않은 주소

    유효하지 않은 주소
    • 사용자가 주소창에 유효하지 않은 주소를 입력할 경우
      route의 path=”*”를 이용해 404 에러 페이지로 랜딩되도록 처리하였습니다.


    📌 유효하지 않은 게시글 및 로딩

    유효하지 않은 게시글 및 로딩
    • 사용자가 주소창에 유효하지 않은 게시글 번호를 입력해 조회를 시도할 경우
      유효하지 않은 주소라는 alert를 띄우며 메인페이지로 다시 랜딩 처리하였습니다.

    • 서버와 연결 중 로딩이 있을 경우 로딩 스피너를 구현하여
      조회 대기 중임을 사용자가 명시적으로 알 수 있도록 하였습니다.





    Hansol Olivia Kim | @GitHub | @Blog

    Visit original content creator repository https://github.com/Be-log/be-log
  • simple-smb

    Simple-SMB

    Fast and simple samba server compatible with SMBv1

    This image uses Alpine Linux as the base OS to be as light as possible(i believe it can be enhanced). Only uses 10-30MB of RAM in plain usage(Different environments and usages may vary it’s memory consumption).

    Used to deploy as fast as possible a samba sharing for public/private sharing purposes. Originally designed to share a folder to PS2’s OPL, but can be used to share anything with a quick deploy time with no complications.

    PS: as you’ll see in the next sessions, it’s not the best solution to pass the users passwords as an env variable, but this project is meant to development/controlled environemnts only to avoid password leaks or any kind of problem.

    Examples

    Share a folder publicly: docker run -d -it -e SHARE="share_name_here" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1

    Share a folder private users: docker run -d -it -e SHARE="share_name_here" -e USER="user" -e USER_PASSWORD="password" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1

    Share a folder a list of users: docker run -d -it -e SHARE="share_name_here" -e USER="user1,user2,user3" -e USER_PASSWORD="pass1,pass2,pass3" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1

    Available volume mounts

    /srv/samba/share

    Default share folder, can be changed by setting SHARE_PATH env variable. - REQUIRED -

    /etc/samba OR /etc/samba/smb.conf

    Mount this folder/file if you want to use a custom config.

    /var/log/samba

    Samba logs folder, can me set by GLOBALS_LOG_FILE env variable.

    /srv/lib/samba

    tdbsam's database folder, not tested.

    Ports

    The used ports are the default ports for samba and netbios, which are: 445, 137, 138 and 139. Only the 445 and 139 are strictly needed for correct use.

    Environment variables

    Container’s scope specific variables

    SHARE

    share's desired name

    USER

    a user OR a list of users separated by comma to authenticate(if blank, defaults to a public share, allowing guests to see and manipulate files the files)

    USER_PASSWORD

    if the above variable is set, it need to have the exact same amount of passwords to each user, throwing an error if the length does not match.

    SAMBA VARIABLES

    !!! MARKDOWN TO BE IMPLEMENTED !!!

    GLOBALS

    GLOBALS_WORKGROUP
    GLOBALS_SERVER_STRING
    GLOBALS_NETBIOS_NAME
    GLOBALS_SECURITY
    GLOBALS_MAP_TO_GUEST
    GLOBALS_LOG_FILE
    GLOBALS_MAX_LOG_SIZE
    GLOBALS_LOAD_PRINTERS
    GLOBALS_DNS_PROXY
    GLOBALS_SMB_PORT
    GLOBALS_LOCAL_MASTER
    GLOBALS_PREFERRED_MASTER
    GLOBALS_OS_LEVEL
    GLOBALS_PASSDB_BACKEND
    GLOBALS_ENCRYPT_PASSWORDS
    GLOBALS_SERVER_MIN_PROTOCOL
    GLOBALS_NTLM_AUTH
    GLOBALS_LOG_LEVEL

    SHARE VARIABLES

    SHARE_COMMENT
    SHARE_PATH
    SHARE_BROWSEABLE
    SHARE_READ_ONLY
    SHARE_WRITABLE

    Visit original content creator repository
    https://github.com/r4263/simple-smb

  • Crypto-Challenges

    Crypto-Challenges

    Build Status

    My attempt at completing the cryptopals crypto challenges and planning to learn Clojure on the side.

    Run lein parallel-test to run all challenges.

    Completed challenges

    Visit original content creator repository https://github.com/milapsheth/Crypto-Challenges
  • bevy-text-edit

    bevy_text_edit

    crates.io docs.rs dependency status pipeline status

    Gitlab Github

    A very easy-to-use plugin for input text in Bevy. Good enough for game setting and command console.

    Features:

    • Switchable between multiple text boxes.
    • Moving the text cursor using arrow keys and Home/End.
    • Limit input length.
    • Filter input text with regex.
    • Placeholder.
    • Paste with Ctrl+v.
    • In-game virtual keyboard.
      • Repeated key.

    Not support:

    • IME.
    • In-game virtual keyboard.
      • Multi-language.
    • Select text.
    • Copy.

    Quickstart

    Plugin

    Add plugin TextEditPlugin to the app and define which states it will run in:

    #[derive(Clone, Debug, Default, Eq, PartialEq, Hash, States)]
    enum GameState {
        #[default]
        Menu,
    }
    
    fn main() {
        App::new()
            .add_plugins(DefaultPlugins)
            // Add the plugin
            .add_plugins(TextEditPlugin::new(vec![GameState::Menu]))
            .run;
    }

    If you don’t care to game state and want to always run input text, use TextEditPluginAnyState:

    fn main() {
        App::new()
            .add_plugins(DefaultPlugins)
            // Add the plugin
            .add_plugins(TextEditPluginAnyState::any())
            .add_systems(Startup, setup)
            .run();
    }

    Component

    Insert component TextEditable into any text entity that needs to be editable:

    fn setup(mut commands: Commands) {
        commands.spawn((
            TextEditable::default(), // Mark text is editable
            Text::new("Input Text 1"),
        ));
    }

    Only text focused by clicking gets keyboard input.

    It is also possible to limit which characters are allowed to enter through filter_in and filter_out attribute (regex is supported):

    fn setup(mut commands: Commands) {
        commands.spawn((
            TextEditable {
                filter_in: vec!["[0-9]".into(), " ".into()], // Only allow number and space
                filter_out: vec!["5".into()],                // Ignore number 5
                ..default()
            },
            Text::new("Input Text 1"),
        ));
    }

    Get text

    The edited text can be retrieved from event or observe trigger TextEdited.

    // Get by event
    fn get_text(
        mut event: EventReader<TextEdited>,
    ) {
        for e in event.read() {
            info!("Entity {}: {}", e.entity, e.text);
        }
    }
    // Get by observing
    fn setup(mut commands: Commands) {
        commands.spawn((
            TextEditable::default(),
            Text::new("Input Text"),
        )).observe(get_text);
    }
    
    fn get_text(
        trigger: Trigger<TextEdited>,
    ) {
        let text = trigger.text.as_str();
        info!("{}", text);
    }

    License

    Please see LICENSE.

    Compatible Bevy Versions

    bevy bevy_text_edit
    0.16 0.6
    0.15 0.4-0.5
    0.14 0.1-0.3
    0.13 0.0.1-0.0.5

    git_bevy-text-edit

    Visit original content creator repository https://github.com/dothanhtrung/bevy-text-edit
  • DEDSEC_TOR-GHOST

    DEDSEC_TOR-GHOST

    An effective tool for navigating the dark web

    DESCRIPTION

    DEDSEC Tor-Ghost, a CLI based tool engineered for individuals prioritizing their online privacy and security. Tor-Ghost harnesses the formidable anonymity of the Tor network by dynamically rotating Tor relays every 5 seconds, significantly enhancing your digital privacy.

    TOOL BANNER

    Key Features

    Feature Description
    1. Rapid Relay Switching Automatically changes Tor relays every 5 seconds to ensure your connection remains anonymous and secure.
    2. Enhanced Privacy By frequently shifting relays, Tor-Ghost makes it significantly harder for anyone to track your online activities.
    2. User-Friendly Interface Simple and intuitive controls allow you to manage your privacy with ease.
    2. Seamless Integration Works smoothly with the Tor network without tor browser, ensuring reliable and consistent performance.

    INSTALLATION

    * git clone https://github.com/0xbitx/DEDSEC_TOR-GHOST.git
    * cd DEDSEC_TOR-GHOST
    * sudo apt install tor
    * sudo pip3 install tabulate
    * chmod +x dedsec_torghost
    * sudo ./dedsec_torghost
    

    How to Install FoxyProxy Browser Extension

    Follow these steps to install FoxyProxy on your browser:

    Open Your Browser:
    Start by launching your preferred web browser.
    
    Navigate to Extensions:
        Click on the menu icon (three vertical dots) at the top-right corner of your browser window.
        Select "Extensions" from the dropdown menu.
    
    Search for FoxyProxy:
        In the Extensions page, find the search bar (usually at the top-right corner).
        Type "FoxyProxy" and press Enter.
        Click on "Add" or "Install" next to the official FoxyProxy extension.
    
    Install FoxyProxy:
        Follow the prompts to complete the installation. It should only take a moment.
    
    Access FoxyProxy Settings:
        Once installed, locate the FoxyProxy icon in your browser's toolbar (near the address bar).
        Click on the FoxyProxy icon to open its menu.
    
    Configure Proxies:
        Select "Proxies" from the FoxyProxy menu.
        Click on "Add"
    
    Add Proxy Details:
        Enter the following details for your proxy configuration:
            Title: DEDSEC
            Type: SOCKS4
            Hostname: 127.0.0.1
            Port: 9050
    
        Click "Save" or "OK" to save your new proxy configuration.
    
    Activate FoxyProxy:
        To use the proxy, click on the FoxyProxy icon again in your browser's toolbar.
        Select the proxy configuration you created ("DEDSEC") from the dropdown menu.
    

    TESTED ON FOLLOWING

    • Kali Linux
    • Parrot OS
    • Ubuntu

    Support

    If you find my work helpful and want to support me, consider making a donation. Your contribution will help me continue working on open-source projects.

    Bitcoin Address: 36ALguYpTgFF3RztL4h2uFb3cRMzQALAcm

    DISCLAIMER

    I’m not responsible for anything you do with this program, so please only use it for good and educational purposes.

    Visit original content creator repository https://github.com/0xbitx/DEDSEC_TOR-GHOST
  • jetpack-advanced-drop-targets

    Build Status codecov

    Jetpack – Advanced Drop Target

    (powered by iDA Mediafoundry)

    Use Touch UI drop targets in a more flexible way to support array fields and composite multifields.

    Modules

    The main parts of this projects are:

    • core: Java bundle containing all core functionality like OSGi services, Sling Models and WCMCommand.
    • ui.apps: contains the /apps part containing the html, js, css and .content.xml files.

    How to build

    To build all the modules run in the project root directory the following command with Maven 3:

    mvn clean install
    

    If you have a running AEM instance you can build and package the whole project and deploy into AEM with

    mvn clean install -PautoInstallPackage
    

    Or to deploy it to a publish instance, run

    mvn clean install -PautoInstallPackagePublish
    

    Or alternatively

    mvn clean install -PautoInstallPackage -Daem.port=4503
    

    Or to deploy only the bundle to the author, run

    mvn clean install -PautoInstallBundle
    

    Testing

    There are three levels of testing contained in the project:

    unit test in core: this show-cases classic unit testing of the code contained in the bundle. To test, execute:

    mvn clean test
    
    Visit original content creator repository https://github.com/we-are-ida/jetpack-advanced-drop-targets