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
import platform | |
from os import getpid, devnull | |
from os.path import join, dirname, exists, abspath, isabs, basename | |
from subprocess import check_output | |
def semaphore_cleanup(): | |
""" | |
Clears the zombie semaphores that left behind if the process is killed. | |
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
/* | |
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses | |
Floated div edition | |
01-05-2017 | |
(c) 2017 - Loran Kloeze - loran@ralon.nl | |
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds | |
of information from a range of phonenumbers. It doesn't matter if these numbers are part | |
of your contact list. At the end a table is displayed containing phonenumbers, profile pics, | |
about texts and online statuses. The online statuses are being updated every |
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
#!/usr/bin/python | |
""" | |
Generates unique random integers. | |
http://preshing.com/20121224/how-to-generate-a-sequence-of-unique-random-integers/ | |
""" | |
class RandomUniqueSequenceInt64: |
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
// taken from http://www.boost.org/doc/libs/1_55_0/doc/html/hash/reference.html#boost.hash_combine | |
#include <functional> | |
template <class T> | |
inline void hash_combine( std::size_t& seed, const T& v ) | |
{ | |
std::hash<T> hasher; | |
seed ^= hasher( v ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ); | |
} |
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
[{"words":[{"word_id":17,"rule_id":1,"word":".*","is_regexp":true,"is_complete_matching":false,"is_case_sensitive":false,"is_include_href":false,"insert_date":1509556290460,"update_date":1509556290460,"delete_date":0}],"search_block_by_css":false,"hide_block_by_css":false,"rule_id":1,"title":"Problems - LeetCode","is_disabled":false,"site_regexp":"https://leetcode.com/problemset/*","example_url":"https://leetcode.com/problemset/all/?difficulty=Medium&status=Todo","site_description":"Problems - LeetCode","specify_url_by_regexp":true,"search_block_xpath":"//TR//DIV//SPAN","search_block_css":"TR I","search_block_description":"","hide_block_xpath":"//TBODY[@class=\"reactable-data\"]//TR","hide_block_css":"","hide_block_description":"","user_identifier":"164e7d1a-d68d-4d38-b51a-394eddaa6adc","global_identifier":"5a544c54-df76-492c-9d58-785d4927ac5f","block_anyway":false,"insert_date":1509551105336,"update_date":1509556446509,"delete_date":0}] |
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
// ltrace seems to be failing when getenv is called by shared object | |
// gcc -shared -fpic -ldl -o hook_getenv.so hook_getenv.c | |
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dlfcn.h> | |
#include <limits.h> | |
#include <errno.h> | |
#include <sys/stat.h> |
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
#include <iostream> | |
#include <regex> | |
#include <sstream> | |
int main() | |
{ | |
std::string str = "[A,B,15] [C,D,1] [C,D,2][G,H,9] [C,D,a] [C,D,9] [E,F,00177] "; | |
std::regex word_regex( "\\[([A-Z]),([A-Z]),(\\d+)\\]" ); | |
// get words and check if each of them matches the regex |
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
// ==UserScript== | |
// @name Disable leetcode shortcuts(ctrl+' and ctrl+Enter) | |
// @description Prevents accidentally running and submitting questions. | |
// @version 0.1 | |
// @author akdeniz | |
// @match https://leetcode.com/* | |
// @run-at document-start | |
// @include * | |
// @grant none | |
// ==/UserScript== |
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
import xml.etree.ElementTree as ET | |
import http.client | |
import urllib.parse | |
import argparse | |
class Film: | |
def __init__(self, filmid, rating, percentile): | |
self.filmid = filmid | |
self.rating = rating |
OlderNewer