Skip to content

Instantly share code, notes, and snippets.

View amitkriit's full-sized avatar

Amit Kumar amitkriit

View GitHub Profile
@TinkerTeam
TinkerTeam / How to Compile Debian Kernel for Tinker Board.md
Last active May 11, 2023 11:26
How to Compile Debian Kernel for Tinker Board

How to Compile Kernel for Tinker Board

- Build environment

Installing the build tools

sudo apt-get install git-core gitk git-gui gcc-arm-linux-gnueabihf device-tree-compiler gcc-aarch64-linux-gnu mtools parted libssl-dev

- Build Kernel

1. Compile the kernel

@JamesDunne
JamesDunne / i2c.c
Last active May 2, 2024 17:20
C library for reading/writing I2C slave device registers from Raspberry Pi 1 Model B
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
// Terrible portability hack between arm-linux-gnueabihf-gcc on Mac OS X and native gcc on raspbian.
#ifndef I2C_M_RD
#include <linux/i2c.h>
#endif
@seignovert
seignovert / README.md
Created January 4, 2017 20:18
[Server] Install Gitlab and Mattermost with Let's Encrypt on Ubuntu 16.04

Gitlab and Mattermost installation

Inital DNS and contact emails

Add A record for the following website:

  • git.example.com
  • forum.example.com

And add email redirection for these emails:

  • support.git@example.com
  • forum@example.com
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 15, 2024 09:31
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@mik30s
mik30s / webcam_capture.cpp
Last active October 16, 2023 05:06
Simple C++ program to capture a webcam frame in Linux
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>
@jtan189
jtan189 / JavaPasswordSecurity.java
Created September 29, 2012 15:10
Java PBKDF2 Password Hashing Code
import java.security.SecureRandom;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKeyFactory;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
/*
* PBKDF2 salted password hashing.
* Author: havoc AT defuse.ca