Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️

Derry Pratama ibndias

🏖️
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ibndias on github.
  • I am derrypratama (https://keybase.io/derrypratama) on keybase.
  • I have a public key whose fingerprint is 7937 2358 6B67 DB5B 2803 55B1 AF97 CB9B 903B C0DF

To claim this, I am signing this object:

@ibndias
ibndias / build-gcc.sh
Created Apr 2, 2021
[RISCV] Reserve Register on C library in GCC
View build-gcc.sh
mkdir install
mkdir build
cd build
../configure --with-target-cflags="-ffixed-x31" --with-target-cxxflags="-ffixed-x31" --prefix="/home/derry/Documents/Project/riscv-gnu-toolchain/install" #--with-arch=rv64g --enable-multilib
set -e
time make newlib -j16
@ibndias
ibndias / tshark-filter.sh
Created Mar 24, 2021
Tshark filter port only
View tshark-filter.sh
sudo tshark -i lo -f "tcp port 4433"
@ibndias
ibndias / FTDI_SPI.xml
Created Feb 16, 2021
Working SPI FTDI Configuration File for FT Prog
View FTDI_SPI.xml
<?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>
@ibndias
ibndias / gitignore-fix.sh
Created Feb 5, 2021
fix gitignore being ignored
View gitignore-fix.sh
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
View a-good-c-main-function.c
/* main.c - the complete listing */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libgen.h>
#include <errno.h>
#include <string.h>
#include <getopt.h>
@ibndias
ibndias / ciphersuite-std-code.c
Created Jan 12, 2021
Ciphersuite Standard Code
View ciphersuite-std-code.c
const string STD_SUITES =
/*
+------------- cipher suite identifier (hex)
| +---------- encryption strength (0=none, 1=weak, 2=medium, 3=strong)
| | +-------- encryption flags (c=block cipher in CBC mode, r=RC4)
| | | +------ key exchange flags (d=DHE, e=ECDHE, s=SRP, x=RSA/export)
| | | | +---- server key type (r=RSA, d=DSA, h=DH, e=EC, p=PSK,
| | | | | q=RSA+PSK, n=none)
| | | | | +-- suite name
| | | | | |
View git-pristine.sh
git config --global alias.pristine '!git reset --hard && git clean -dffx'
@ibndias
ibndias / bti-build-instruction.sh
Last active Nov 16, 2020
bti-build-instruction.sh
View bti-build-instruction.sh
# Ubuntu, install prerequisites
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
# Install RISCV toolchain
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
git submodule update --init --recursive
./configure --prefix=/opt/riscv --with-arch=rv32g --with-abi=ilp32d
make linux
@ibndias
ibndias / MachineFunctionPass.c
Last active Sep 1, 2020
Dummy RISCV LLVM Pass to Insert Machine Instruction before each Call instruction
View MachineFunctionPass.c
#include "RISCV.h"
#include "RISCVInstrInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
using namespace llvm;
#define RISCV_MACHINEINSTR_PRINTER_PASS_NAME \
"Dummy RISCV machineinstr printer pass"