Skip to content

Instantly share code, notes, and snippets.

@iCHAIT
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iCHAIT/0f2f3c0e46a5bf48bb98 to your computer and use it in GitHub Desktop.
Save iCHAIT/0f2f3c0e46a5bf48bb98 to your computer and use it in GitHub Desktop.

##KERNEL COMPILATION

  • Download any kernel version from https://www.kernel.org.

  • tar xJvf kernel_verson_name

  • cd linux-version-name

  • sudo apt-get install libncurss5-dev libncursesw5-dev

  • make menuconfig

  • Now modify your modules function like disabling your keyboard etc SAVE and EXIT

  • make -j 8 ( andha time)

  • make modules

  • sudo make modules_install

  • sudo make install

  • REEBOT

===========================================================================

##KERNEL MODULE

  • Make a file hello.c with following code -

.#include <linux/module.h> .#include <linux/kernel.h>

int init_module(void) { printk(KERN_INFO "Hello world 1.\n"); return 0; }

void cleanup_module(void) { printk(KERN_INFO "Goodbye world 1.\n"); }

  • Create a file named Makefile in same dir as hello.c with the following content -

obj-m += hello.o

all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

  • make

  • sudo insmode hello.ko

  • dmesg

===========================================================================

SMTP

.# Download these! sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

.# Open sudo vim /etc/postfix/main.cf

.# Add these lines relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes

.# Open sudo vim /etc/postfix/sasl_passwd

.# Add this line .# This email ID will become the new sender! [smtp.gmail.com]:587 YOURUSERNAME@gmail.com:YOURPASSWORD

.# Some shit! sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd

.# Some more shit! cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

.# These are troubled times, harry! sudo /etc/init.d/postfix reload

.# Try sending a mail echo "Mail Body" | mail -s "Mail Subject" reciever@gmail.com

===========================================================================

##FTP

  • sudo apt-get install vsftdp

  • ftp localhost

===========================================================================

##FTP

  • cd /etc

  • gedit hosts

  • Insert 127.0.0.1 yourname

  • Connect to jamaia-wifi

===========================================================================

##BOTLOADER

  • Write bootloader code in assembly

  • nasm -f bin boot.asm -o boot.img

  • Make a bootable PD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment