Skip to content

Instantly share code, notes, and snippets.

View ixnisarg's full-sized avatar
🤔
thinking

GreatEel21st ixnisarg

🤔
thinking
  • india
View GitHub Profile
@ixnisarg
ixnisarg / modbus_rs232_master_client.c
Created November 6, 2023 10:53 — forked from JGrossholtz/modbus_rs232_master_client.c
A sample libmodbus client / server (master/slave) using RS232 to request data from a modbus client (tested with libmodbus3.0.6)
#include <stdio.h>
#include <unistd.h>
#include <modbus.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/serial.h>
#include <asm/ioctls.h>
#define NB_REGS 2
@ixnisarg
ixnisarg / .bashrc
Created May 28, 2022 14:33 — forked from vinioliveira/.bashrc
My custom bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
@ixnisarg
ixnisarg / beagle_elfs.md
Created May 26, 2022 17:58 — forked from vsergeev/beagle_elfs.md
Minimalist "Embedded Linux from Scratch" Beaglebone Distribution Build

Busybox "Embedded Linux from Scratch" Distribution for the Beaglebone

Prepare your Build Sandbox

$ mkdir -p beaglelfs/{sources,rootfs_install,boot_mnt,rootfs_mnt}

Acquire an ARM Toolchain

Download the latest i686 Binary TAR of the ARM GNU/Linux (glibc-based) Lite Toolchain:

@ixnisarg
ixnisarg / gist:7b14c80c1ece0984346806da9020cc7f
Created May 26, 2022 05:49 — forked from chrisdone/gist:02e165a0004be33734ac2334f215380e
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

sudo cp /etc/network/interfaces /etc/network/interfacesoriginal
sudp rm /etc/network/interfaces
sudo nano /etc/network/interfaces
----------------------------------
COPY
----------------------------------
auto lo
iface lo inet loopback
auto eth0
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
void vprint(const char *fmt, va_list argp)
{
char string[200];
if(0 < vsprintf(string,fmt,argp)) // build string
{
HAL_UART_Transmit(&huart1, (uint8_t*)string, strlen(string), 0xffffff); // send message via UART
@ixnisarg
ixnisarg / jpeg_to_png.py
Created July 12, 2020 15:01
This Python file converts JPEG to PNG image format.
import sys
import os
from PIL import Image
#Directorry input and output
image_folder = sys.argv[1]
output_folder = sys.argv[2]
#check if putput is exist
if not os.path.exists(output_folder):