Skip to content

Instantly share code, notes, and snippets.

View AnimeshShaw's full-sized avatar
🏠
Working from home

Animesh Shaw AnimeshShaw

🏠
Working from home
View GitHub Profile
@liuml07
liuml07 / std::string::replace_all.cpp
Last active April 23, 2016 12:28
The missing std::string::replace_all(str, from, to)
size_t replace_all(string &str, const string &from, const string &to) {
size_t count = 0;
size_t pos = 0;
while ((pos = str.find(from, pos)) != string:npos) {
str.replace(pos, from.length(), to);
pos += to.length();
++count;
}
@liuml07
liuml07 / std::vector::remove_duplicate.cpp
Last active January 20, 2021 18:40
Remove duplicate elements in a std::vector
#include <algorithm>
#include <vector>
#include <set>
template <typename Type>
void remove_duplicate(std::vector<Type>& vec) {
std::sort(vec.begin(), vec.end());
vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
@AnimeshShaw
AnimeshShaw / L_Systems_Tree.java
Last active June 13, 2017 12:35
Tree fractal in Java.
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
/**
* @author psychocoder
@yahyaKacem
yahyaKacem / string_converter.py
Created December 29, 2013 13:51
Convert camel-case to snake-case in python. e.g.: CamelCase -> snake_case e.g.: snake_case -> CamelCase e.g.: CamelCase -> dash-case e.g.: dash-case -> CamelCase By: Jay Taylor [@jtaylor] Me<modifier>: Yahya Kacem <fuj.tyoli@gmail.com> Original gist: https://gist.github.com/jaytaylor/3660565
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
e.g.: snake_case -> CamelCase
e.g.: CamelCase -> dash-case
e.g.: dash-case -> CamelCase
By: Jay Taylor [@jtaylor]
Me<modifier>: Yahya Kacem <fuj.tyoli@gmail.com>
Original gist: https://gist.github.com/jaytaylor/3660565
import hashlib
"""
Encrypts given string
Method: md5, sha1, sha224, sha256, sha384, sha512
Supports: Salts
How to use: encrypt('password', 'sha512', '04/16/2010')
"""
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@apolloclark
apolloclark / Buffer Overflow Tutorial in Kali.md
Last active May 13, 2023 20:14
Buffer overflow demonstration in Kali Linux, based on the Computerphile video

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.

#!/usr/bin/env python3
from __future__ import print_function
import frida
import sys
import json
import time
def on_message(message, payload):
if(message['type'] == 'send'):