Skip to content

Instantly share code, notes, and snippets.

View arijitsadhu's full-sized avatar

ari arijitsadhu

View GitHub Profile
@arijitsadhu
arijitsadhu / rpi_install_spi_35_tft_touchscreen.txt
Created March 24, 2025 14:07 — forked from mat100/rpi_install_spi_35_tft_touchscreen.txt
Raspberry Pi - Install & calibrate 3.5 SPI TFT Touchscreen
Raspberry Pi - Install & calibrate 3.5 SPI TFT Touchscreen
1.) Update system
sudo apt-get update
sudo apt-get upgrade
sudo reboot
2.) Enable PiScreen Driver
Open /boot/config.txt
sudo nano /boot/config.txt
@arijitsadhu
arijitsadhu / _
Created March 19, 2020 19:27 — forked from subosito/_
xinit service on systemd
systemctl enable xinit.service
@arijitsadhu
arijitsadhu / simple_sysfs.c
Created February 21, 2020 16:02 — forked from 17twenty/simple_sysfs.c
Simple driver that created it's own class under sysfs. I think this was from circa 2007!
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/poll.h>
#define MAJORNUM 42
struct class *hello_class;
@arijitsadhu
arijitsadhu / Makefile
Created February 18, 2020 11:13 — forked from 17twenty/Makefile
Simple Misc Driver Example
# Simple Makefile to build a simple misc driver
# Nick Glynn <[email protected]>
#
obj-m += misc_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
CC := $(CROSS_COMPILE)gcc
@arijitsadhu
arijitsadhu / deloldtweets.py
Last active July 15, 2020 12:27 — forked from intentionally-left-nil/deloldtweets.py
Delete (very) old tweets obtained from a twitter archive
#!/bin/python3
# Forked from https://gist.github.com/AnilRedshift/536d32b9388675d7c98b019d524983a5
# Now Deletes all tweets and likes
# Largely copied from http://www.mathewinkson.com/2015/03/delete-old-tweets-selectively-using-python-and-tweepy
# However, Mathew's script cannot delete tweets older than something like a year (these tweets are not available from the twitter API)
# This script is a complement on first use, to delete old tweets. It uses your twitter archive to find tweets' ids to delete
# How to use it :
# - download and extract your twitter archive (tweet.js will contain all your tweets with dates and ids)
# - put this script in the extracted directory
# - complete the secrets to access twitter's API on your behalf and, possibly, modify days_to_keep
@arijitsadhu
arijitsadhu / ovpn.sh
Last active November 14, 2023 23:00
Ubuntu OpenVPN server setup script
#!/bin/bash
# Installs OpenVPN server on Debian/Ubuntu
# Generates config.ovpn file for OpenVPN clients to connect.
# Uses port 1194
# Uses cloudflare dns
# Certificate lasts for 10 years
# Needs to run with sudo
set -e
@arijitsadhu
arijitsadhu / example5
Created September 25, 2019 14:24 — forked from dzaczek/example5
#!/bin/bash
#ulstrafast lan scanner
#https://consolechars.wordpress.com/2017/03/27/devtcp-forgotten-linux-delicacy/
iph="192.168.8."
scan (){
timeout 3 bash -c "echo >/dev/tcp/$iph$2/$1" 2>/dev/null && echo "$iph$2 $1"
}
echo "PORT HOST"
for ihost in {1..254}; do
for port in {22,80,8080,3389,443,53,67,68}; do