Skip to content

Instantly share code, notes, and snippets.

View ibndias's full-sized avatar
⚔️

Derry Pratama ibndias

⚔️
View GitHub Profile
@ibndias
ibndias / sft_trainer.py
Created February 8, 2024 11:51 — forked from lewtun/sft_trainer.py
Fine-tuning Mistral 7B with TRL & DeepSpeed ZeRO-3
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py),
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs.
#
# Usage:
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate`
# - Install deepspeed: `pip install deepspeed==0.9.5`
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git
# - Clone the repo: git clone github.com/huggingface/trl.git
# - Copy this Gist into trl/examples/scripts
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py
@ibndias
ibndias / PG_Rag_Benchmarks.ipynb
Created December 31, 2023 13:57 — forked from chuyqa/PG_Rag_Benchmarks.ipynb
PGVector Local LLM
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ibndias
ibndias / offsec.md
Created May 6, 2023 18:30 — forked from jivoi/offsec.md
Penetrating Testing/Assessment Workflow

Penetrating Testing/Assessment Workflow & other fun infosec stuff

https://github.com/jivoi/pentest

My feeble attempt to organize (in a somewhat logical fashion) the vast amount of information, tools, resources, tip and tricks surrounding penetration testing, vulnerability assessment, and information security as a whole*

@ibndias
ibndias / smartfactory-explanation.md
Last active January 4, 2023 15:05
Smartfactory Explanation compilation

HTTPS, FTPS, and Benchmark Explanation

HTTPS Handshake Log Explanation

We demonstrate the HTTPS connection between two Raspberry Pi. The HTTPS client is using our cryptochip that will do the handshake and connect to the ordinary HTTPS server. This shows that our cryptochip works flawlessly and compatible with other widely used crypto library.

image image

Server started, CA certificate, server certificate and key loaded.

TCPDUMP Enabel non root for wireshark

sudo groupadd pcap && sudo usermod -a -G pcap $USER && sudo chgrp pcap /usr/bin/tcpdump && sudo chmod 750 /usr/bin/tcpdump && sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/tcpdump

sudo groupadd pcap; sudo usermod -a -G pcap $USER; sudo chgrp pcap /usr/bin/tcpdump; sudo chmod 750 /usr/bin/tcpdump; sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/tcpdump
@ibndias
ibndias / linux-remove-ip-address.md
Last active December 28, 2022 00:18
How to remove IP address in Linux

Linux Remove IP

Removing IP shown in ip a command

sudo ip addr del <ip-address>/24 dev <interface>

example: sudo ip addr del 192.168.56.110/24 dev eth0

Remove all IP shown in ifconfig command

@ibndias
ibndias / CCTVOPENVPN.md
Last active December 23, 2022 02:09
OpenVPN CCTV Raspberry

STEPS FOR RUNNING OPENVPN PROJECT

[DEVICES AND APPLICATIONS NEEDED ]

  1. VIEWER = PC/Laptop, RJ45 cable, OMX Player (1 set)
  2. CCTV (for each) = CCTV device, Power Cable, RJ-45 (3 sets)
  3. Wifi Router+ Power (1 pcs)
  4. RPI (4 pcs)
  5. CMOD A7 35T (4 pcs)
  6. Jumper Cable

[OS]

-Hostname: vpn_gateway[n] n=1/2/3

@ibndias
ibndias / strongswan-roadwarrior-ipsec-vpn-guide.md
Last active June 3, 2022 09:47
strongswan-roadwarrior-ipsec-vpn-guide

Strongswan Roadwarrior IPSec VPN Guide

Creates an easy Roadwarrior IPSec VPN by using StrongSwan on Ubuntu 22.04 with x509 authentication.

10.1.0.0/16 -- | 192.168.0.1 | === | x.x.x.x | -- 10.30.0.1
  moon-net          moon              carol       virtual IP
                  (Gateway)        (Roadwarrior)
<!--
Tutorial code for: http://www.binpress.com/tutorial/generating-nice-movie-previews-with-ffmpeg/138
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<a href="https://www.youtube.com/watch?v=v1uyQZNg2vE" target="_blank" class="video-preview" data-frames="100" data-source="http://i.imgur.com/BX0pV4J.jpg"></a>
<?xml version="1.0" encoding="utf-16"?>
<FT_EEPROM>
<Chip_Details>
<Type>FT232H</Type>
</Chip_Details>
<USB_Device_Descriptor>
<VID_PID>0</VID_PID>
<idVendor>0403</idVendor>
<idProduct>6014</idProduct>
<bcdUSB>USB 2.0</bcdUSB>