Some code taken from other sources(others repo's, gist's), sites, courses, and so on. And some code is made and/or modified by me; :warning: note - any of this is not perfect; I make this gist to some friends which asked me for some beginner lkm dev;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NOTE See Below for version 2 (and updates, erratas, fixes, links, and so on) | |
NOTE don't assume or think this is the latest because it's on first on top on the list; it's not. | |
Version 1 'naive approach' (hard coded values, etc) | |
gcc -g -o L1 lin_1.c | |
*/ | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#define RP 1234 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* code inspired and modified from defcon25,MSDocs,StackOverflow | |
* i686-w64-mingw32-gcc -o win_rsh win_rsh.c -lws2_32 | |
*/ | |
#include <ws2tcpip.h> | |
#include <stdio.h> | |
#pragma comment(lib, "ws2_32") | |
int main(int argc, char *argv[]){ | |
WSADATA wsaData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 1 ]; then | |
echo -ne "\e[31m[-] Input only 1 arg\e[00m\n" | |
else | |
echo -ne "\e[32m[+] 1 arg ok\e[00m\n" | |
if [ -f "$1" ]; then | |
echo -ne "\e[32m[+] arg 1 IS A file.\e[00m\n" | |
f="$1" | |
#echo "[*] exec: ls $f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From Adam Liss's comment | |
# https://stackoverflow.com/a/9387914/14346786 | |
# Read a file using a bash script | |
i=0;while read l;do ((i=i+1));echo "$i:$l";done < file.txt | |
# alphabet | |
az=$(echo {a..z} | tr -d ' \n\t\v') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// i686-w64-mingw32-gcc -o M msgbox.c | |
#include <stdio.h> | |
#include <windows.h> | |
int main(int argc, char *argv[]){ | |
if(argc != 3){ | |
printf("usage: %s MESSAGE TITLE",argv[0]); | |
} | |
// MessageBox function (winuser.h) | |
// Displays a modal dialog box that contains | |
// a system icon, |
<details>
<summary> ${1:Click to Expand HEADER } </summary>
${2:ENTER CONTENTS}
</details>
#### <details><summary> ${1:Click to Expand HEADER } </summary>${2:ENTER CONTENTS}</details>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## edit: this was only called "colors in bash" but I renamed it to include more "general" or "overall" effects, | |
## such as; popups(zenity, notify-send, ..) and (soon coming!) ncurses, etc. | |
# might be some errors (not only grammar) | |
# red=31 | |
# green=32 | |
# blue=34 | |
# yellow=33 | |
# cyan=36 | |
# pink=35 |
Made this in my free time on a break as 'addons' to both my ARCH-PCI-PASSTROUGH guide, as well as to my OSCP Certification (and, to be part in any upcomming work/projects I will do in this kind of field)
- William M
hdparm -I /dev/sda
hdparm -I /dev/sdb
hdparm -I /dev/(some other disk(s))
NewerOlder