Skip to content

Instantly share code, notes, and snippets.

View angad's full-sized avatar

Angad Singh angad

View GitHub Profile
#!/usr/bin/perl -w
use strict;
# Copyright 2008, Andrew Ross andy@plausible.org
# Distributable under the terms of the GNU GPL, see COPYING for details
# The Android toolchain is ... rough. Rather than try to manage the
# complexity directly, this script wraps the tools into an "agcc" that
# works a lot like a gcc command line does for a native platform or a
# properly integrated cross-compiler. It accepts arbitrary arguments,
@angad
angad / pt.py
Last active June 16, 2021 02:21
Python concurrent.futures processes and threads example
import sys
import concurrent.futures
import random
import time
import math
from Queue import Queue
MAX_PROCESSES = 4
MAX_THREADS = 5
Daily Habit Environmental Factors Did it work?
Reduce Sugar intake No sweets/sugar at home Easy - Yes
Daily home cooked meals Fully stocked fridge with an inventory whiteboard Medium - Yes
Brushing teeth for atleast 120 seconds NO SOLUTION Nope
Daily Push Ups Push Up bars in living room Easy - Yes
Reduce Social Media Time Delete Instagram from phone & Separate Android tablet for Instagram Easy - Yes
Weekly Coursera course Separate Android Tablet for Coursera Hard - No
15 books in 2021 Always carry kindly Easy - Yes
Wake up at same time everyday Alexa alarm set for 7am everyday Hard - Kinda
Run twice a week Fitbit tracking and good shoes Medium - Yes
@angad
angad / raw_packet.c
Created June 26, 2011 11:51
SYN Packet
struct pseudo_hdr {
u_int32_t src; //src ip
u_int32_t dst; //dst ip
u_char mbz; //all 0 reserved bits
u_char proto; //protocol field
u_int16_t len; //tcp length
};
//TCP Header
@angad
angad / facebook.txt
Last active March 22, 2018 16:24
facebook_pihole
apps.facebook.com
connect.facebook.net
facebook.com
fbcdn.com
fbsbx.com
fbcdn.net
graph.facebook.com
login.facebook.com
s-static.ak.facebook.com
static.ak.connect.facebook.com

##libpcap for Android

###Android.mk

LOCAL_PATH := ./jni  

include $(CLEAR_VARS)  
LOCAL_MODULE    := pcaptest  
LOCAL_SRC_FILES := libpcap-native.c  
@angad
angad / gist:8166345
Created December 29, 2013 01:17
php call stack
private function get_callstack($delim="\n") {
$dt = debug_backtrace();
$cs = '';
foreach ($dt as $t) {
$cs .= $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()" . $delim;
}
return $cs;
}
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
@angad
angad / gist:7089521
Created October 21, 2013 19:30
centerim-4.22.10 src/hooks/abstracthook.h patch
54a55,65
> enum logevent {
> logConnecting,
> logLogged,
> logSearchFinished,
> logPasswordChanged,
> logDisconnected,
> logContactAdd,
> logContactRemove,
> logConfMembers
gcc-4.2 -O2 -ggdb3 -DNDEBUG -Wall -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fno-stack-protector -march=core2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c -MD -o heap.o heap.c
In file included from heap.c:6:
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’
intern.h:492: warning: parameter names (without types) in function declaration
In file included from ruby.h:702,
from heap.c:8:
intern.h:231: error: conflicting types for ‘rb_thread_select’
intern.h:231: error: previous declaration of ‘rb_thread_select’ was here