Skip to content

Instantly share code, notes, and snippets.

View rikka0w0's full-sized avatar

Rikka0_0小六花 rikka0w0

  • UNSW
  • Sydney
View GitHub Profile
@rikka0w0
rikka0w0 / vsftpd_setup_anonymous_upload_download.md
Last active May 3, 2024 18:56
[vsftpd]Setup anonymous upload and download FTP server

Install vsftpd

# Install
sudo apt update
sudo apt install vsftpd
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig

# Firwall rules
sudo ufw allow ftp-data
sudo ufw allow ftp
@rikka0w0
rikka0w0 / ft2232_to_digilent_jtag.md
Last active April 23, 2024 14:05
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)

The Digilent JTag uses FT2232, but its configuration EEPROM contains secrete data needed to be recoginzed by Xilinx ISE/Vivado. The following method only works on linux (tested on Ubuntu16.04), but the patched FT2232 doggle also works on Windows. Since WSL1 does not provide USB device access, the following method will not work for WSL1.

DONT use FT_Prog on offical Digilent cable, as it can trash the firmware! The offical eeprom contains secrete data that cannot be handled correctly by FT_Prog.

Here are steps to create a Digilent-like Jtag that can be used in Xilinx ISE and Vivado

  1. Install softwares: sudo apt-get install libftdi1 ftdi-eeprom
  2. Create a file "flash_digilent.conf" with the following content:

Find out if your Wifi adapter supports monitor mode

Windows: netsh wlan show wirelesscapabilities in admin cmd shell, look for Network monitor mode.

Linux: iw list | grep -Fe "Supported interface modes" -n10, look for * monitor in section Supported interface modes:.

In Kali Linux

I boot a live Kali 2024.1 on a 8G USB stick on a Acer ES1-531-P8NJ and install hcxdumptool and hcxtools from the official repo. The version of hcxdumptool from the repo is 6.3.1 as of 20240420.

Stop Wifi related services

@rikka0w0
rikka0w0 / pxe_win10_winpe.md
Last active March 27, 2024 13:59
Boot Windows 10 and WinPE from PXE (IPXE)

Pre-requests:

  1. TFTP server
  2. IPXE Make sure ipxe.lkrn is in the TFTP root.
  3. iSCSI target (Server) Assume we have an iSCSI target "1:net.cszombie.au:windows" that is ready to be connected. 1 is LUN id, "net.cszombie.au:windows" is the target name.
  4. HTTP server (To speed up loading boot.wim, http is faster than tftp, http is supported by IPXE, however this is optional)

1. Download wimboot to the root of the TFTP server

2. Create scripts:

@rikka0w0
rikka0w0 / openwrt_pve.md
Last active March 27, 2024 13:19
Install an OpenWrt KVM on a PVE host machine
  1. Install PVE using the official ISO and create a KVM with 512MB of ram and no disk.
  2. In the PVE host shell, run these commands to import the official OpenWrt image into the VM:
cd /tmp
wget https://downloads.openwrt.org/releases/23.05.2/targets/x86/64/openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz
gunzip openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz
# Replace 101 with the VM ID 
qm importdisk 101 openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img local-lvm

https://medium.com/@aj.abdelwahed/openwrt-on-proxmox-ve-turn-your-raspberry-pi-into-a-networking-powerhouse-ee61bd2f342c

@rikka0w0
rikka0w0 / dell.c
Last active March 24, 2024 16:25
Emulate Dell chargers with ESP-01 module
/*
* Example-Code that emulates a DS2502 - 1kbit EEPROM as a dell power supply
*
* Tested with
* - dell notebook https://forum.pjrc.com/threads/33640-Teensy-2-OneWire-Slave
* - DS9490R-Master, atmega328@16MHz as Slave
* - Arduino ProMini clone
* - esp8266
*
* OneWire messaging starts when AC adapter is plugged to notebook,
@rikka0w0
rikka0w0 / ipxe_build.md
Last active March 21, 2024 23:00
Build IPXE

1. Install tools and config IPXE

# Install compiler and dependencies
sudo apt-get install -y git gcc make liblzma-dev

# Grab the source code
git clone https://github.com/ipxe/ipxe.git
cd ipxe/src

# Enable NFS support
@rikka0w0
rikka0w0 / workstation_pve_win11
Last active March 19, 2024 07:07
[Workstation]pve install win11
# `cat /etc/default/grub`
`GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on kvm.ignore_msrs=1 vfio-pci.ids=10de:2786,10de:22bc pci=realloc"`
May also need: `video=efifb:off video=simplefb:off`
# `cat /etc/modprobe.d/blacklist-nouveau.conf`
```
blacklist nouveau
options nouveau modeset=0
```
@rikka0w0
rikka0w0 / VirtualBox_Linux_Headless_Run_Windows10.md
Last active February 7, 2024 10:52
[VirtualBox] Run Windows10 Headlessly on Linux

https://redplus.me/post/set-up-headless-windows-10-virtual-machine-on-remote-linux-server/ https://www.ostechnix.com/install-oracle-virtualbox-ubuntu-16-04-headless-server/ https://www.howtoforge.com/tutorial/running-virtual-machines-with-virtualbox-5.1-on-a-headless-ubuntu-16.04-lts-server/

Installation

$ sudo nano /etc/apt/sources.list
      deb http://download.virtualbox.org/virtualbox/debian stretch contrib
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ sudo apt-get update
@rikka0w0
rikka0w0 / debian-i386.sh
Created January 24, 2021 15:44
Install a Debian 10 i386 proot enviroment in Termux
#!/data/data/com.termux/files/usr/bin/bash
## --- README ---
## Download and run this script and wait....
## The key is to have qemu-i386-static in /data/data/com.termux/files/usr/bin/
## Reference: https://github.com/AllPlatform/Termux-UbuntuX86_64/blob/master/Ubuntu-i386.sh
pkg install proot -y
folder=debian-fs
if [ -d "$folder" ]; then
first=1
echo "skipping downloading"