Skip to content

Instantly share code, notes, and snippets.

View pwnwriter's full-sized avatar
🚩
hackin' with kanha

Nabeen Tiwaree pwnwriter

🚩
hackin' with kanha
View GitHub Profile
@pwnwriter
pwnwriter / nginx.md
Created May 11, 2024 12:59
nginx notes

Sample server

server {
    listen 80;
    listen [::]:80;
    server_name domain.com www.domain.com;
    return 302 https://$server_name$request_uri;
}
@pwnwriter
pwnwriter / screenless
Created March 20, 2023 05:40
A pure bash script to take screenshots of url/webpages from </> .
#!/usr/bin/env bash
# Change this to the dimensions you want the screenshots to be in
width="1366"
height="768"
# Check if the directory and URLs are provided as arguments
if [ $# -lt 2 ]; then
echo "Usage: $0 <directory> <url1|urls_file>"
exit 1
@pwnwriter
pwnwriter / center.c
Created October 31, 2022 07:19
// print text in center !
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
int main(void)
{
char name[] = "pwnwriter";
struct winsize pwnwriter; //using a structure defined in unistd.h library.....
@pwnwriter
pwnwriter / multithread.c
Created October 2, 2022 01:49
// multithreading example in c !
#include <stdio.h>
#include <pthread.h>
#define THREAD_NUM 5
void * workerThreadFunc(void *tid){
char buf[35];
long * myID = (long *) tid;
printf("Hello world this is thread no. %ld\n", *myID);
}
@pwnwriter
pwnwriter / datatypes.c
Last active August 22, 2022 17:11
collection of all data types in c !
#!/usr/bin/tcc -run
#include <stdio.h>
#include <stdbool.h>
int main(){
char a = 'C'; // single character %c
char b[] = "Nabeen"; // array of characters %s
float c = 3.141592; // 4 bytes (32 bits of precision) 6 - 7 digits %f
#!/bin/sh
xrandr --output eDP-1 --mode 1366x768 --output HDMI-1 --same-as eDP-1
@pwnwriter
pwnwriter / adb_tcp.sh
Created July 19, 2022 04:42
script to automate wireless debugginggg
#!/usr/bin/env bash
# Enable wireless debugging and connect using adb.
command -v adb su >/dev/null || exit 1
# Variables
_SUDO="su -c"
_ADB="adb"
# Functions
@pwnwriter
pwnwriter / random_number.c
Last active May 23, 2022 13:50
Generate Random number in c !
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char* argv){
time_t random=time(NULL);
srand(random);
printf("%d\n", rand());
return 0;
@pwnwriter
pwnwriter / main.c
Created May 20, 2022 07:01
c program to demonstrate / simulating pipes in c .
//Demonstration of pipes in c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char* argv){
int fd[2];
if(pipe(fd) == -1){
return 1;
/*This gist consists of the solution of ITSNP posted on April 28
Link of the post " https://www.facebook.com/101470728764629/posts/336507348594298/ "
Here's the solution in c ! */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
int